diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt
index e6a01b1162e01..8c536753ca924 100644
--- a/eng/versioning/version_client.txt
+++ b/eng/versioning/version_client.txt
@@ -331,6 +331,7 @@ com.azure.resourcemanager:azure-resourcemanager-desktopvirtualization;1.0.0-beta
com.azure.resourcemanager:azure-resourcemanager-loadtestservice;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2
+com.azure.resourcemanager:azure-resourcemanager-compute-generated;1.0.0-beta.1;1.0.0-beta.1
com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0
# Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current
diff --git a/pom.xml b/pom.xml
index 9cb3ad482fa80..4075ce0abd30e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -736,6 +736,7 @@
sdk/cognitiveservices
sdk/commerce
sdk/communication
+ sdk/compute
sdk/confidentialledger
sdk/confluent
sdk/consumption
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/CHANGELOG.md b/sdk/compute/azure-resourcemanager-compute-generated/CHANGELOG.md
new file mode 100644
index 0000000000000..96c232437c3dc
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Release History
+
+## 1.0.0-beta.1 (2022-01-19)
+
+- Azure Resource Manager Compute client library for Java. This package contains Microsoft Azure SDK for Compute Management SDK. Compute Client. Package tag package-2021-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/README.md b/sdk/compute/azure-resourcemanager-compute-generated/README.md
new file mode 100644
index 0000000000000..d9b8cde81459c
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/README.md
@@ -0,0 +1,102 @@
+# Azure Resource Manager Compute client library for Java
+
+Azure Resource Manager Compute client library for Java.
+
+This package contains Microsoft Azure SDK for Compute Management SDK. Compute Client. Package tag package-2021-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+
+## We'd love to hear your feedback
+
+We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better.
+
+If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together.
+
+Thank you in advance for your collaboration. We really appreciate your time!
+
+## Documentation
+
+Various documentation is available to help you get started
+
+- [API reference documentation][docs]
+
+## Getting started
+
+### Prerequisites
+
+- [Java Development Kit (JDK)][jdk] with version 8 or above
+- [Azure Subscription][azure_subscription]
+
+### Adding the package to your product
+
+[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-compute-generated;current})
+```xml
+
+ com.azure.resourcemanager
+ azure-resourcemanager-compute-generated
+ 1.0.0-beta.1
+
+```
+[//]: # ({x-version-update-end})
+
+### Include the recommended packages
+
+Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client.
+
+[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation.
+
+### Authentication
+
+By default, Azure Active Directory token authentication depends on correct configure of following environment variables.
+
+- `AZURE_CLIENT_ID` for Azure client ID.
+- `AZURE_TENANT_ID` for Azure tenant ID.
+- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
+
+In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
+
+With above configuration, `azure` client can be authenticated by following code:
+
+```java
+AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
+TokenCredential credential = new DefaultAzureCredentialBuilder()
+ .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
+ .build();
+ComputeManager manager = ComputeManager
+ .authenticate(credential, profile);
+```
+
+The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
+
+See [Authentication][authenticate] for more options.
+
+## Key concepts
+
+See [API design][design] for general introduction on design and key concepts on Azure Management Libraries.
+
+## Examples
+
+[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/compute/azure-resourcemanager-compute-generated/SAMPLE.md)
+
+
+## Troubleshooting
+
+## Next steps
+
+## Contributing
+
+For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
+
+1. Fork it
+1. Create your feature branch (`git checkout -b my-new-feature`)
+1. Commit your changes (`git commit -am 'Add some feature'`)
+1. Push to the branch (`git push origin my-new-feature`)
+1. Create new Pull Request
+
+
+[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
+[docs]: https://azure.github.io/azure-sdk-for-java/
+[jdk]: https://docs.microsoft.com/java/azure/jdk/
+[azure_subscription]: https://azure.microsoft.com/free/
+[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
+[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
+[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
+[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/SAMPLE.md b/sdk/compute/azure-resourcemanager-compute-generated/SAMPLE.md
new file mode 100644
index 0000000000000..ce37e03031ad1
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/SAMPLE.md
@@ -0,0 +1,16660 @@
+# Code snippets and samples
+
+
+## AvailabilitySets
+
+- [CreateOrUpdate](#availabilitysets_createorupdate)
+- [Delete](#availabilitysets_delete)
+- [GetByResourceGroup](#availabilitysets_getbyresourcegroup)
+- [List](#availabilitysets_list)
+- [ListAvailableSizes](#availabilitysets_listavailablesizes)
+- [ListByResourceGroup](#availabilitysets_listbyresourcegroup)
+- [Update](#availabilitysets_update)
+
+## CapacityReservationGroups
+
+- [CreateOrUpdate](#capacityreservationgroups_createorupdate)
+- [Delete](#capacityreservationgroups_delete)
+- [GetByResourceGroup](#capacityreservationgroups_getbyresourcegroup)
+- [List](#capacityreservationgroups_list)
+- [ListByResourceGroup](#capacityreservationgroups_listbyresourcegroup)
+- [Update](#capacityreservationgroups_update)
+
+## CapacityReservations
+
+- [CreateOrUpdate](#capacityreservations_createorupdate)
+- [Delete](#capacityreservations_delete)
+- [Get](#capacityreservations_get)
+- [ListByCapacityReservationGroup](#capacityreservations_listbycapacityreservationgroup)
+- [Update](#capacityreservations_update)
+
+## CloudServiceOperatingSystems
+
+- [GetOSFamily](#cloudserviceoperatingsystems_getosfamily)
+- [GetOSVersion](#cloudserviceoperatingsystems_getosversion)
+- [ListOSFamilies](#cloudserviceoperatingsystems_listosfamilies)
+- [ListOSVersions](#cloudserviceoperatingsystems_listosversions)
+
+## CloudServiceRoleInstances
+
+- [Delete](#cloudserviceroleinstances_delete)
+- [Get](#cloudserviceroleinstances_get)
+- [GetInstanceView](#cloudserviceroleinstances_getinstanceview)
+- [List](#cloudserviceroleinstances_list)
+- [Rebuild](#cloudserviceroleinstances_rebuild)
+- [Reimage](#cloudserviceroleinstances_reimage)
+- [Restart](#cloudserviceroleinstances_restart)
+
+## CloudServiceRoles
+
+- [Get](#cloudserviceroles_get)
+- [List](#cloudserviceroles_list)
+
+## CloudServices
+
+- [CreateOrUpdate](#cloudservices_createorupdate)
+- [Delete](#cloudservices_delete)
+- [DeleteInstances](#cloudservices_deleteinstances)
+- [GetByResourceGroup](#cloudservices_getbyresourcegroup)
+- [GetInstanceView](#cloudservices_getinstanceview)
+- [List](#cloudservices_list)
+- [ListByResourceGroup](#cloudservices_listbyresourcegroup)
+- [PowerOff](#cloudservices_poweroff)
+- [Rebuild](#cloudservices_rebuild)
+- [Reimage](#cloudservices_reimage)
+- [Restart](#cloudservices_restart)
+- [Start](#cloudservices_start)
+- [Update](#cloudservices_update)
+
+## CloudServicesUpdateDomain
+
+- [GetUpdateDomain](#cloudservicesupdatedomain_getupdatedomain)
+- [ListUpdateDomains](#cloudservicesupdatedomain_listupdatedomains)
+- [WalkUpdateDomain](#cloudservicesupdatedomain_walkupdatedomain)
+
+## CommunityGalleries
+
+- [Get](#communitygalleries_get)
+
+## CommunityGalleryImageVersions
+
+- [Get](#communitygalleryimageversions_get)
+
+## CommunityGalleryImages
+
+- [Get](#communitygalleryimages_get)
+
+## DedicatedHostGroups
+
+- [CreateOrUpdate](#dedicatedhostgroups_createorupdate)
+- [Delete](#dedicatedhostgroups_delete)
+- [GetByResourceGroup](#dedicatedhostgroups_getbyresourcegroup)
+- [List](#dedicatedhostgroups_list)
+- [ListByResourceGroup](#dedicatedhostgroups_listbyresourcegroup)
+- [Update](#dedicatedhostgroups_update)
+
+## DedicatedHosts
+
+- [CreateOrUpdate](#dedicatedhosts_createorupdate)
+- [Delete](#dedicatedhosts_delete)
+- [Get](#dedicatedhosts_get)
+- [ListByHostGroup](#dedicatedhosts_listbyhostgroup)
+- [Restart](#dedicatedhosts_restart)
+- [Update](#dedicatedhosts_update)
+
+## DiskAccesses
+
+- [CreateOrUpdate](#diskaccesses_createorupdate)
+- [Delete](#diskaccesses_delete)
+- [DeleteAPrivateEndpointConnection](#diskaccesses_deleteaprivateendpointconnection)
+- [GetAPrivateEndpointConnection](#diskaccesses_getaprivateendpointconnection)
+- [GetByResourceGroup](#diskaccesses_getbyresourcegroup)
+- [GetPrivateLinkResources](#diskaccesses_getprivatelinkresources)
+- [List](#diskaccesses_list)
+- [ListByResourceGroup](#diskaccesses_listbyresourcegroup)
+- [ListPrivateEndpointConnections](#diskaccesses_listprivateendpointconnections)
+- [Update](#diskaccesses_update)
+- [UpdateAPrivateEndpointConnection](#diskaccesses_updateaprivateendpointconnection)
+
+## DiskEncryptionSets
+
+- [CreateOrUpdate](#diskencryptionsets_createorupdate)
+- [Delete](#diskencryptionsets_delete)
+- [GetByResourceGroup](#diskencryptionsets_getbyresourcegroup)
+- [List](#diskencryptionsets_list)
+- [ListAssociatedResources](#diskencryptionsets_listassociatedresources)
+- [ListByResourceGroup](#diskencryptionsets_listbyresourcegroup)
+- [Update](#diskencryptionsets_update)
+
+## DiskRestorePoint
+
+- [Get](#diskrestorepoint_get)
+- [GrantAccess](#diskrestorepoint_grantaccess)
+- [ListByRestorePoint](#diskrestorepoint_listbyrestorepoint)
+- [RevokeAccess](#diskrestorepoint_revokeaccess)
+
+## Disks
+
+- [CreateOrUpdate](#disks_createorupdate)
+- [Delete](#disks_delete)
+- [GetByResourceGroup](#disks_getbyresourcegroup)
+- [GrantAccess](#disks_grantaccess)
+- [List](#disks_list)
+- [ListByResourceGroup](#disks_listbyresourcegroup)
+- [RevokeAccess](#disks_revokeaccess)
+- [Update](#disks_update)
+
+## Galleries
+
+- [CreateOrUpdate](#galleries_createorupdate)
+- [Delete](#galleries_delete)
+- [GetByResourceGroup](#galleries_getbyresourcegroup)
+- [List](#galleries_list)
+- [ListByResourceGroup](#galleries_listbyresourcegroup)
+- [Update](#galleries_update)
+
+## GalleryApplicationVersions
+
+- [CreateOrUpdate](#galleryapplicationversions_createorupdate)
+- [Delete](#galleryapplicationversions_delete)
+- [Get](#galleryapplicationversions_get)
+- [ListByGalleryApplication](#galleryapplicationversions_listbygalleryapplication)
+- [Update](#galleryapplicationversions_update)
+
+## GalleryApplications
+
+- [CreateOrUpdate](#galleryapplications_createorupdate)
+- [Delete](#galleryapplications_delete)
+- [Get](#galleryapplications_get)
+- [ListByGallery](#galleryapplications_listbygallery)
+- [Update](#galleryapplications_update)
+
+## GalleryImageVersions
+
+- [CreateOrUpdate](#galleryimageversions_createorupdate)
+- [Delete](#galleryimageversions_delete)
+- [Get](#galleryimageversions_get)
+- [ListByGalleryImage](#galleryimageversions_listbygalleryimage)
+- [Update](#galleryimageversions_update)
+
+## GalleryImages
+
+- [CreateOrUpdate](#galleryimages_createorupdate)
+- [Delete](#galleryimages_delete)
+- [Get](#galleryimages_get)
+- [ListByGallery](#galleryimages_listbygallery)
+- [Update](#galleryimages_update)
+
+## GallerySharingProfile
+
+- [Update](#gallerysharingprofile_update)
+
+## Images
+
+- [CreateOrUpdate](#images_createorupdate)
+- [Delete](#images_delete)
+- [GetByResourceGroup](#images_getbyresourcegroup)
+- [List](#images_list)
+- [ListByResourceGroup](#images_listbyresourcegroup)
+- [Update](#images_update)
+
+## LogAnalytics
+
+- [ExportRequestRateByInterval](#loganalytics_exportrequestratebyinterval)
+- [ExportThrottledRequests](#loganalytics_exportthrottledrequests)
+
+## Operations
+
+- [List](#operations_list)
+
+## ProximityPlacementGroups
+
+- [CreateOrUpdate](#proximityplacementgroups_createorupdate)
+- [Delete](#proximityplacementgroups_delete)
+- [GetByResourceGroup](#proximityplacementgroups_getbyresourcegroup)
+- [List](#proximityplacementgroups_list)
+- [ListByResourceGroup](#proximityplacementgroups_listbyresourcegroup)
+- [Update](#proximityplacementgroups_update)
+
+## ResourceSkus
+
+- [List](#resourceskus_list)
+
+## RestorePointCollections
+
+- [CreateOrUpdate](#restorepointcollections_createorupdate)
+- [Delete](#restorepointcollections_delete)
+- [GetByResourceGroup](#restorepointcollections_getbyresourcegroup)
+- [List](#restorepointcollections_list)
+- [ListByResourceGroup](#restorepointcollections_listbyresourcegroup)
+- [Update](#restorepointcollections_update)
+
+## RestorePoints
+
+- [Create](#restorepoints_create)
+- [Delete](#restorepoints_delete)
+- [Get](#restorepoints_get)
+
+## SharedGalleries
+
+- [Get](#sharedgalleries_get)
+- [List](#sharedgalleries_list)
+
+## SharedGalleryImageVersions
+
+- [Get](#sharedgalleryimageversions_get)
+- [List](#sharedgalleryimageversions_list)
+
+## SharedGalleryImages
+
+- [Get](#sharedgalleryimages_get)
+- [List](#sharedgalleryimages_list)
+
+## Snapshots
+
+- [CreateOrUpdate](#snapshots_createorupdate)
+- [Delete](#snapshots_delete)
+- [GetByResourceGroup](#snapshots_getbyresourcegroup)
+- [GrantAccess](#snapshots_grantaccess)
+- [List](#snapshots_list)
+- [ListByResourceGroup](#snapshots_listbyresourcegroup)
+- [RevokeAccess](#snapshots_revokeaccess)
+- [Update](#snapshots_update)
+
+## SshPublicKeys
+
+- [Create](#sshpublickeys_create)
+- [Delete](#sshpublickeys_delete)
+- [GenerateKeyPair](#sshpublickeys_generatekeypair)
+- [GetByResourceGroup](#sshpublickeys_getbyresourcegroup)
+- [List](#sshpublickeys_list)
+- [ListByResourceGroup](#sshpublickeys_listbyresourcegroup)
+- [Update](#sshpublickeys_update)
+
+## Usage
+
+- [List](#usage_list)
+
+## VirtualMachineExtensionImages
+
+- [Get](#virtualmachineextensionimages_get)
+- [ListTypes](#virtualmachineextensionimages_listtypes)
+- [ListVersions](#virtualmachineextensionimages_listversions)
+
+## VirtualMachineExtensions
+
+- [CreateOrUpdate](#virtualmachineextensions_createorupdate)
+- [Delete](#virtualmachineextensions_delete)
+- [Get](#virtualmachineextensions_get)
+- [List](#virtualmachineextensions_list)
+- [Update](#virtualmachineextensions_update)
+
+## VirtualMachineImages
+
+- [Get](#virtualmachineimages_get)
+- [List](#virtualmachineimages_list)
+- [ListOffers](#virtualmachineimages_listoffers)
+- [ListPublishers](#virtualmachineimages_listpublishers)
+- [ListSkus](#virtualmachineimages_listskus)
+
+## VirtualMachineImagesEdgeZone
+
+- [Get](#virtualmachineimagesedgezone_get)
+- [List](#virtualmachineimagesedgezone_list)
+- [ListOffers](#virtualmachineimagesedgezone_listoffers)
+- [ListPublishers](#virtualmachineimagesedgezone_listpublishers)
+- [ListSkus](#virtualmachineimagesedgezone_listskus)
+
+## VirtualMachineRunCommands
+
+- [CreateOrUpdate](#virtualmachineruncommands_createorupdate)
+- [Delete](#virtualmachineruncommands_delete)
+- [Get](#virtualmachineruncommands_get)
+- [GetByVirtualMachine](#virtualmachineruncommands_getbyvirtualmachine)
+- [List](#virtualmachineruncommands_list)
+- [ListByVirtualMachine](#virtualmachineruncommands_listbyvirtualmachine)
+- [Update](#virtualmachineruncommands_update)
+
+## VirtualMachineScaleSetExtensions
+
+- [CreateOrUpdate](#virtualmachinescalesetextensions_createorupdate)
+- [Delete](#virtualmachinescalesetextensions_delete)
+- [Get](#virtualmachinescalesetextensions_get)
+- [List](#virtualmachinescalesetextensions_list)
+- [Update](#virtualmachinescalesetextensions_update)
+
+## VirtualMachineScaleSetRollingUpgrades
+
+- [Cancel](#virtualmachinescalesetrollingupgrades_cancel)
+- [GetLatest](#virtualmachinescalesetrollingupgrades_getlatest)
+- [StartExtensionUpgrade](#virtualmachinescalesetrollingupgrades_startextensionupgrade)
+- [StartOSUpgrade](#virtualmachinescalesetrollingupgrades_startosupgrade)
+
+## VirtualMachineScaleSetVMExtensions
+
+- [CreateOrUpdate](#virtualmachinescalesetvmextensions_createorupdate)
+- [Delete](#virtualmachinescalesetvmextensions_delete)
+- [Get](#virtualmachinescalesetvmextensions_get)
+- [List](#virtualmachinescalesetvmextensions_list)
+- [Update](#virtualmachinescalesetvmextensions_update)
+
+## VirtualMachineScaleSetVMRunCommands
+
+- [CreateOrUpdate](#virtualmachinescalesetvmruncommands_createorupdate)
+- [Delete](#virtualmachinescalesetvmruncommands_delete)
+- [Get](#virtualmachinescalesetvmruncommands_get)
+- [List](#virtualmachinescalesetvmruncommands_list)
+- [Update](#virtualmachinescalesetvmruncommands_update)
+
+## VirtualMachineScaleSetVMs
+
+- [Deallocate](#virtualmachinescalesetvms_deallocate)
+- [Delete](#virtualmachinescalesetvms_delete)
+- [Get](#virtualmachinescalesetvms_get)
+- [GetInstanceView](#virtualmachinescalesetvms_getinstanceview)
+- [List](#virtualmachinescalesetvms_list)
+- [PerformMaintenance](#virtualmachinescalesetvms_performmaintenance)
+- [PowerOff](#virtualmachinescalesetvms_poweroff)
+- [Redeploy](#virtualmachinescalesetvms_redeploy)
+- [Reimage](#virtualmachinescalesetvms_reimage)
+- [ReimageAll](#virtualmachinescalesetvms_reimageall)
+- [Restart](#virtualmachinescalesetvms_restart)
+- [RetrieveBootDiagnosticsData](#virtualmachinescalesetvms_retrievebootdiagnosticsdata)
+- [RunCommand](#virtualmachinescalesetvms_runcommand)
+- [SimulateEviction](#virtualmachinescalesetvms_simulateeviction)
+- [Start](#virtualmachinescalesetvms_start)
+- [Update](#virtualmachinescalesetvms_update)
+
+## VirtualMachineScaleSets
+
+- [ConvertToSinglePlacementGroup](#virtualmachinescalesets_converttosingleplacementgroup)
+- [CreateOrUpdate](#virtualmachinescalesets_createorupdate)
+- [Deallocate](#virtualmachinescalesets_deallocate)
+- [Delete](#virtualmachinescalesets_delete)
+- [DeleteInstances](#virtualmachinescalesets_deleteinstances)
+- [ForceRecoveryServiceFabricPlatformUpdateDomainWalk](#virtualmachinescalesets_forcerecoveryservicefabricplatformupdatedomainwalk)
+- [GetByResourceGroup](#virtualmachinescalesets_getbyresourcegroup)
+- [GetInstanceView](#virtualmachinescalesets_getinstanceview)
+- [GetOSUpgradeHistory](#virtualmachinescalesets_getosupgradehistory)
+- [List](#virtualmachinescalesets_list)
+- [ListByLocation](#virtualmachinescalesets_listbylocation)
+- [ListByResourceGroup](#virtualmachinescalesets_listbyresourcegroup)
+- [ListSkus](#virtualmachinescalesets_listskus)
+- [PerformMaintenance](#virtualmachinescalesets_performmaintenance)
+- [PowerOff](#virtualmachinescalesets_poweroff)
+- [Redeploy](#virtualmachinescalesets_redeploy)
+- [Reimage](#virtualmachinescalesets_reimage)
+- [ReimageAll](#virtualmachinescalesets_reimageall)
+- [Restart](#virtualmachinescalesets_restart)
+- [SetOrchestrationServiceState](#virtualmachinescalesets_setorchestrationservicestate)
+- [Start](#virtualmachinescalesets_start)
+- [Update](#virtualmachinescalesets_update)
+- [UpdateInstances](#virtualmachinescalesets_updateinstances)
+
+## VirtualMachineSizes
+
+- [List](#virtualmachinesizes_list)
+
+## VirtualMachines
+
+- [AssessPatches](#virtualmachines_assesspatches)
+- [Capture](#virtualmachines_capture)
+- [ConvertToManagedDisks](#virtualmachines_converttomanageddisks)
+- [CreateOrUpdate](#virtualmachines_createorupdate)
+- [Deallocate](#virtualmachines_deallocate)
+- [Delete](#virtualmachines_delete)
+- [Generalize](#virtualmachines_generalize)
+- [GetByResourceGroup](#virtualmachines_getbyresourcegroup)
+- [InstallPatches](#virtualmachines_installpatches)
+- [InstanceView](#virtualmachines_instanceview)
+- [List](#virtualmachines_list)
+- [ListAvailableSizes](#virtualmachines_listavailablesizes)
+- [ListByLocation](#virtualmachines_listbylocation)
+- [ListByResourceGroup](#virtualmachines_listbyresourcegroup)
+- [PerformMaintenance](#virtualmachines_performmaintenance)
+- [PowerOff](#virtualmachines_poweroff)
+- [Reapply](#virtualmachines_reapply)
+- [Redeploy](#virtualmachines_redeploy)
+- [Reimage](#virtualmachines_reimage)
+- [Restart](#virtualmachines_restart)
+- [RetrieveBootDiagnosticsData](#virtualmachines_retrievebootdiagnosticsdata)
+- [RunCommand](#virtualmachines_runcommand)
+- [SimulateEviction](#virtualmachines_simulateeviction)
+- [Start](#virtualmachines_start)
+- [Update](#virtualmachines_update)
+### AvailabilitySets_CreateOrUpdate
+
+```java
+/** Samples for AvailabilitySets CreateOrUpdate. */
+public final class AvailabilitySetsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnAvailabilitySet.json
+ */
+ /**
+ * Sample code: Create an availability set.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAnAvailabilitySet(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .availabilitySets()
+ .define("myAvailabilitySet")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withPlatformUpdateDomainCount(20)
+ .withPlatformFaultDomainCount(2)
+ .create();
+ }
+}
+```
+
+### AvailabilitySets_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailabilitySets Delete. */
+public final class AvailabilitySetsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: AvailabilitySets_Delete_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void availabilitySetsDeleteMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.availabilitySets().deleteWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Delete_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: AvailabilitySets_Delete_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void availabilitySetsDeleteMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.availabilitySets().deleteWithResponse("rgcompute", "aaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### AvailabilitySets_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailabilitySets GetByResourceGroup. */
+public final class AvailabilitySetsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: AvailabilitySets_Get_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void availabilitySetsGetMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.availabilitySets().getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Get_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: AvailabilitySets_Get_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void availabilitySetsGetMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.availabilitySets().getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### AvailabilitySets_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailabilitySets List. */
+public final class AvailabilitySetsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailabilitySetsInASubscription.json
+ */
+ /**
+ * Sample code: List availability sets in a subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAvailabilitySetsInASubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.availabilitySets().list("virtualMachines\\$ref", Context.NONE);
+ }
+}
+```
+
+### AvailabilitySets_ListAvailableSizes
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailabilitySets ListAvailableSizes. */
+public final class AvailabilitySetsListAvailableSizesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: AvailabilitySets_ListAvailableSizes_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void availabilitySetsListAvailableSizesMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.availabilitySets().listAvailableSizes("rgcompute", "aa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_ListAvailableSizes_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: AvailabilitySets_ListAvailableSizes_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void availabilitySetsListAvailableSizesMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.availabilitySets().listAvailableSizes("rgcompute", "aaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### AvailabilitySets_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for AvailabilitySets ListByResourceGroup. */
+public final class AvailabilitySetsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: AvailabilitySets_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void availabilitySetsListMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.availabilitySets().listByResourceGroup("rgcompute", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: AvailabilitySets_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void availabilitySetsListMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.availabilitySets().listByResourceGroup("rgcompute", Context.NONE);
+ }
+}
+```
+
+### AvailabilitySets_Update
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.AvailabilitySet;
+import com.azure.resourcemanager.compute.generated.models.Sku;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for AvailabilitySets Update. */
+public final class AvailabilitySetsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: AvailabilitySets_Update_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void availabilitySetsUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ AvailabilitySet resource =
+ manager
+ .availabilitySets()
+ .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaa", Context.NONE)
+ .getValue();
+ resource.update().apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/AvailabilitySets_Update_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: AvailabilitySets_Update_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void availabilitySetsUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ AvailabilitySet resource =
+ manager
+ .availabilitySets()
+ .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaa", Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withTags(mapOf("key2574", "aaaaaaaa"))
+ .withSku(new Sku().withName("DSv3-Type1").withTier("aaa").withCapacity(7L))
+ .withPlatformUpdateDomainCount(20)
+ .withPlatformFaultDomainCount(2)
+ .withVirtualMachines(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")))
+ .withProximityPlacementGroup(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))
+ .apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### CapacityReservationGroups_CreateOrUpdate
+
+```java
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CapacityReservationGroups CreateOrUpdate. */
+public final class CapacityReservationGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservationGroup.json
+ */
+ /**
+ * Sample code: Create or update a capacity reservation group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateACapacityReservationGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .capacityReservationGroups()
+ .define("myCapacityReservationGroup")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withTags(mapOf("department", "finance"))
+ .withZones(Arrays.asList("1", "2"))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### CapacityReservationGroups_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CapacityReservationGroups Delete. */
+public final class CapacityReservationGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: CapacityReservationGroups_Delete_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void capacityReservationGroupsDeleteMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.capacityReservationGroups().deleteWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Delete_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: CapacityReservationGroups_Delete_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void capacityReservationGroupsDeleteMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.capacityReservationGroups().deleteWithResponse("rgcompute", "a", Context.NONE);
+ }
+}
+```
+
+### CapacityReservationGroups_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CapacityReservationGroups GetByResourceGroup. */
+public final class CapacityReservationGroupsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservationGroup.json
+ */
+ /**
+ * Sample code: Get a capacity reservation Group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getACapacityReservationGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .capacityReservationGroups()
+ .getByResourceGroupWithResponse("myResourceGroup", "myCapacityReservationGroup", null, Context.NONE);
+ }
+}
+```
+
+### CapacityReservationGroups_List
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups;
+
+/** Samples for CapacityReservationGroups List. */
+public final class CapacityReservationGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInSubscription.json
+ */
+ /**
+ * Sample code: List capacity reservation groups in subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listCapacityReservationGroupsInSubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .capacityReservationGroups()
+ .list(ExpandTypesForGetCapacityReservationGroups.VIRTUAL_MACHINES_REF, Context.NONE);
+ }
+}
+```
+
+### CapacityReservationGroups_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups;
+
+/** Samples for CapacityReservationGroups ListByResourceGroup. */
+public final class CapacityReservationGroupsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationGroupsInResourceGroup.json
+ */
+ /**
+ * Sample code: List capacity reservation groups in resource group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listCapacityReservationGroupsInResourceGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .capacityReservationGroups()
+ .listByResourceGroup(
+ "myResourceGroup", ExpandTypesForGetCapacityReservationGroups.VIRTUAL_MACHINES_REF, Context.NONE);
+ }
+}
+```
+
+### CapacityReservationGroups_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroup;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CapacityReservationGroups Update. */
+public final class CapacityReservationGroupsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: CapacityReservationGroups_Update_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void capacityReservationGroupsUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ CapacityReservationGroup resource =
+ manager
+ .capacityReservationGroups()
+ .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("key5355", "aaa")).apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservationGroups_Update_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: CapacityReservationGroups_Update_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void capacityReservationGroupsUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ CapacityReservationGroup resource =
+ manager
+ .capacityReservationGroups()
+ .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, Context.NONE)
+ .getValue();
+ resource.update().apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### CapacityReservations_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.Sku;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CapacityReservations CreateOrUpdate. */
+public final class CapacityReservationsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateACapacityReservation.json
+ */
+ /**
+ * Sample code: Create or update a capacity reservation .
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateACapacityReservation(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .capacityReservations()
+ .define("myCapacityReservation")
+ .withRegion("westus")
+ .withExistingCapacityReservationGroup("myResourceGroup", "myCapacityReservationGroup")
+ .withSku(new Sku().withName("Standard_DS1_v2").withCapacity(4L))
+ .withTags(mapOf("department", "HR"))
+ .withZones(Arrays.asList("1"))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### CapacityReservations_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CapacityReservations Delete. */
+public final class CapacityReservationsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: CapacityReservations_Delete_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void capacityReservationsDeleteMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.capacityReservations().delete("rgcompute", "aaa", "aaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Delete_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: CapacityReservations_Delete_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void capacityReservationsDeleteMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.capacityReservations().delete("rgcompute", "aaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### CapacityReservations_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CapacityReservations Get. */
+public final class CapacityReservationsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetACapacityReservation.json
+ */
+ /**
+ * Sample code: Get a capacity reservation.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getACapacityReservation(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .capacityReservations()
+ .getWithResponse(
+ "myResourceGroup", "myCapacityReservationGroup", "myCapacityReservation", null, Context.NONE);
+ }
+}
+```
+
+### CapacityReservations_ListByCapacityReservationGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CapacityReservations ListByCapacityReservationGroup. */
+public final class CapacityReservationsListByCapacityReservationGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListCapacityReservationsInReservationGroup.json
+ */
+ /**
+ * Sample code: List capacity reservations in reservation group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listCapacityReservationsInReservationGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .capacityReservations()
+ .listByCapacityReservationGroup("myResourceGroup", "myCapacityReservationGroup", Context.NONE);
+ }
+}
+```
+
+### CapacityReservations_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.CapacityReservation;
+import com.azure.resourcemanager.compute.generated.models.Sku;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CapacityReservations Update. */
+public final class CapacityReservationsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: CapacityReservations_Update_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void capacityReservationsUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ CapacityReservation resource =
+ manager
+ .capacityReservations()
+ .getWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaa", null, Context.NONE)
+ .getValue();
+ resource.update().apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CapacityReservations_Update_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: CapacityReservations_Update_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void capacityReservationsUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ CapacityReservation resource =
+ manager
+ .capacityReservations()
+ .getWithResponse("rgcompute", "aaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withTags(mapOf("key4974", "aaaaaaaaaaaaaaaa"))
+ .withSku(new Sku().withName("DSv3-Type1").withTier("aaa").withCapacity(7L))
+ .apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### CloudServiceOperatingSystems_GetOSFamily
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceOperatingSystems GetOSFamily. */
+public final class CloudServiceOperatingSystemsGetOSFamilySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSFamily.json
+ */
+ /**
+ * Sample code: Get Cloud Service OS Family.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getCloudServiceOSFamily(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServiceOperatingSystems().getOSFamilyWithResponse("westus2", "3", Context.NONE);
+ }
+}
+```
+
+### CloudServiceOperatingSystems_GetOSVersion
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceOperatingSystems GetOSVersion. */
+public final class CloudServiceOperatingSystemsGetOSVersionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSVersion.json
+ */
+ /**
+ * Sample code: Get Cloud Service OS Version.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getCloudServiceOSVersion(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .cloudServiceOperatingSystems()
+ .getOSVersionWithResponse("westus2", "WA-GUEST-OS-3.90_202010-02", Context.NONE);
+ }
+}
+```
+
+### CloudServiceOperatingSystems_ListOSFamilies
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceOperatingSystems ListOSFamilies. */
+public final class CloudServiceOperatingSystemsListOSFamiliesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSFamilies.json
+ */
+ /**
+ * Sample code: List Cloud Service OS Families in a subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listCloudServiceOSFamiliesInASubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServiceOperatingSystems().listOSFamilies("westus2", Context.NONE);
+ }
+}
+```
+
+### CloudServiceOperatingSystems_ListOSVersions
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceOperatingSystems ListOSVersions. */
+public final class CloudServiceOperatingSystemsListOSVersionsSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSVersions.json
+ */
+ /**
+ * Sample code: List Cloud Service OS Versions in a subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listCloudServiceOSVersionsInASubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServiceOperatingSystems().listOSVersions("westus2", Context.NONE);
+ }
+}
+```
+
+### CloudServiceRoleInstances_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances Delete. */
+public final class CloudServiceRoleInstancesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Delete Cloud Service Role Instance.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteCloudServiceRoleInstance(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServiceRoleInstances().delete("{roleInstance-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServiceRoleInstances_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances Get. */
+public final class CloudServiceRoleInstancesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Get Cloud Service Role Instance.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getCloudServiceRoleInstance(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .cloudServiceRoleInstances()
+ .getWithResponse("{roleInstance-name}", "ConstosoRG", "{cs-name}", null, Context.NONE);
+ }
+}
+```
+
+### CloudServiceRoleInstances_GetInstanceView
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances GetInstanceView. */
+public final class CloudServiceRoleInstancesGetInstanceViewSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetInstanceViewOfCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Get Instance View of Cloud Service Role Instance.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getInstanceViewOfCloudServiceRoleInstance(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .cloudServiceRoleInstances()
+ .getInstanceViewWithResponse("{roleInstance-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServiceRoleInstances_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances List. */
+public final class CloudServiceRoleInstancesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRolesInstances.json
+ */
+ /**
+ * Sample code: List Role Instances in a Cloud Service.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listRoleInstancesInACloudService(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServiceRoleInstances().list("ConstosoRG", "{cs-name}", null, Context.NONE);
+ }
+}
+```
+
+### CloudServiceRoleInstances_Rebuild
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances Rebuild. */
+public final class CloudServiceRoleInstancesRebuildSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Rebuild Cloud Service Role Instance.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void rebuildCloudServiceRoleInstance(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServiceRoleInstances().rebuild("{roleInstance-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServiceRoleInstances_Reimage
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances Reimage. */
+public final class CloudServiceRoleInstancesReimageSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Reimage Cloud Service Role Instance.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void reimageCloudServiceRoleInstance(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServiceRoleInstances().reimage("{roleInstance-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServiceRoleInstances_Restart
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances Restart. */
+public final class CloudServiceRoleInstancesRestartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Restart Cloud Service Role Instance.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void restartCloudServiceRoleInstance(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServiceRoleInstances().restart("{roleInstance-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServiceRoles_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoles Get. */
+public final class CloudServiceRolesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRole.json
+ */
+ /**
+ * Sample code: Get Cloud Service Role.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getCloudServiceRole(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServiceRoles().getWithResponse("{role-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServiceRoles_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoles List. */
+public final class CloudServiceRolesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRoles.json
+ */
+ /**
+ * Sample code: List Roles in a Cloud Service.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listRolesInACloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServiceRoles().list("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServices_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceExtensionProfile;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceExtensionProperties;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceNetworkProfile;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceOsProfile;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceProperties;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleProfile;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleProfileProperties;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleSku;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceUpgradeMode;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceVaultCertificate;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceVaultSecretGroup;
+import com.azure.resourcemanager.compute.generated.models.Extension;
+import com.azure.resourcemanager.compute.generated.models.LoadBalancerConfiguration;
+import com.azure.resourcemanager.compute.generated.models.LoadBalancerConfigurationProperties;
+import com.azure.resourcemanager.compute.generated.models.LoadBalancerFrontendIpConfiguration;
+import com.azure.resourcemanager.compute.generated.models.LoadBalancerFrontendIpConfigurationProperties;
+import java.util.Arrays;
+
+/** Samples for CloudServices CreateOrUpdate. */
+public final class CloudServicesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRole.json
+ */
+ /**
+ * Sample code: Create New Cloud Service with Single Role.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createNewCloudServiceWithSingleRole(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .cloudServices()
+ .define("{cs-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("ConstosoRG")
+ .withProperties(
+ new CloudServiceProperties()
+ .withPackageUrl("{PackageUrl}")
+ .withConfiguration("{ServiceConfiguration}")
+ .withUpgradeMode(CloudServiceUpgradeMode.AUTO)
+ .withRoleProfile(
+ new CloudServiceRoleProfile()
+ .withRoles(
+ Arrays
+ .asList(
+ new CloudServiceRoleProfileProperties()
+ .withName("ContosoFrontend")
+ .withSku(
+ new CloudServiceRoleSku()
+ .withName("Standard_D1_v2")
+ .withTier("Standard")
+ .withCapacity(1L)))))
+ .withNetworkProfile(
+ new CloudServiceNetworkProfile()
+ .withLoadBalancerConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerConfiguration()
+ .withName("myLoadBalancer")
+ .withProperties(
+ new LoadBalancerConfigurationProperties()
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerFrontendIpConfiguration()
+ .withName("myfe")
+ .withProperties(
+ new LoadBalancerFrontendIpConfigurationProperties()
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"))))))))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRoleAndCertificate.json
+ */
+ /**
+ * Sample code: Create New Cloud Service with Single Role and Certificate from Key Vault.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .cloudServices()
+ .define("{cs-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("ConstosoRG")
+ .withProperties(
+ new CloudServiceProperties()
+ .withPackageUrl("{PackageUrl}")
+ .withConfiguration("{ServiceConfiguration}")
+ .withUpgradeMode(CloudServiceUpgradeMode.AUTO)
+ .withRoleProfile(
+ new CloudServiceRoleProfile()
+ .withRoles(
+ Arrays
+ .asList(
+ new CloudServiceRoleProfileProperties()
+ .withName("ContosoFrontend")
+ .withSku(
+ new CloudServiceRoleSku()
+ .withName("Standard_D1_v2")
+ .withTier("Standard")
+ .withCapacity(1L)))))
+ .withOsProfile(
+ new CloudServiceOsProfile()
+ .withSecrets(
+ Arrays
+ .asList(
+ new CloudServiceVaultSecretGroup()
+ .withSourceVault(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"))
+ .withVaultCertificates(
+ Arrays
+ .asList(
+ new CloudServiceVaultCertificate()
+ .withCertificateUrl(
+ "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"))))))
+ .withNetworkProfile(
+ new CloudServiceNetworkProfile()
+ .withLoadBalancerConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerConfiguration()
+ .withName("contosolb")
+ .withProperties(
+ new LoadBalancerConfigurationProperties()
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerFrontendIpConfiguration()
+ .withName("contosofe")
+ .withProperties(
+ new LoadBalancerFrontendIpConfigurationProperties()
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"))))))))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRoleAndRDP.json
+ */
+ /**
+ * Sample code: Create New Cloud Service with Single Role and RDP Extension.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createNewCloudServiceWithSingleRoleAndRDPExtension(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .cloudServices()
+ .define("{cs-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("ConstosoRG")
+ .withProperties(
+ new CloudServiceProperties()
+ .withPackageUrl("{PackageUrl}")
+ .withConfiguration("{ServiceConfiguration}")
+ .withUpgradeMode(CloudServiceUpgradeMode.AUTO)
+ .withRoleProfile(
+ new CloudServiceRoleProfile()
+ .withRoles(
+ Arrays
+ .asList(
+ new CloudServiceRoleProfileProperties()
+ .withName("ContosoFrontend")
+ .withSku(
+ new CloudServiceRoleSku()
+ .withName("Standard_D1_v2")
+ .withTier("Standard")
+ .withCapacity(1L)))))
+ .withNetworkProfile(
+ new CloudServiceNetworkProfile()
+ .withLoadBalancerConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerConfiguration()
+ .withName("contosolb")
+ .withProperties(
+ new LoadBalancerConfigurationProperties()
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerFrontendIpConfiguration()
+ .withName("contosofe")
+ .withProperties(
+ new LoadBalancerFrontendIpConfigurationProperties()
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))
+ .withExtensionProfile(
+ new CloudServiceExtensionProfile()
+ .withExtensions(
+ Arrays
+ .asList(
+ new Extension()
+ .withName("RDPExtension")
+ .withProperties(
+ new CloudServiceExtensionProperties()
+ .withPublisher("Microsoft.Windows.Azure.Extensions")
+ .withType("RDP")
+ .withTypeHandlerVersion("1.2.1")
+ .withAutoUpgradeMinorVersion(false)
+ .withSettings(
+ "UserAzure10/22/2021"
+ + " 15:05:45")
+ .withProtectedSettings(
+ "{password}"))))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithMultiRole.json
+ */
+ /**
+ * Sample code: Create New Cloud Service with Multiple Roles.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createNewCloudServiceWithMultipleRoles(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .cloudServices()
+ .define("{cs-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("ConstosoRG")
+ .withProperties(
+ new CloudServiceProperties()
+ .withPackageUrl("{PackageUrl}")
+ .withConfiguration("{ServiceConfiguration}")
+ .withUpgradeMode(CloudServiceUpgradeMode.AUTO)
+ .withRoleProfile(
+ new CloudServiceRoleProfile()
+ .withRoles(
+ Arrays
+ .asList(
+ new CloudServiceRoleProfileProperties()
+ .withName("ContosoFrontend")
+ .withSku(
+ new CloudServiceRoleSku()
+ .withName("Standard_D1_v2")
+ .withTier("Standard")
+ .withCapacity(1L)),
+ new CloudServiceRoleProfileProperties()
+ .withName("ContosoBackend")
+ .withSku(
+ new CloudServiceRoleSku()
+ .withName("Standard_D1_v2")
+ .withTier("Standard")
+ .withCapacity(1L)))))
+ .withNetworkProfile(
+ new CloudServiceNetworkProfile()
+ .withLoadBalancerConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerConfiguration()
+ .withName("contosolb")
+ .withProperties(
+ new LoadBalancerConfigurationProperties()
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerFrontendIpConfiguration()
+ .withName("contosofe")
+ .withProperties(
+ new LoadBalancerFrontendIpConfigurationProperties()
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"))))))))))
+ .create();
+ }
+}
+```
+
+### CloudServices_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices Delete. */
+public final class CloudServicesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudService.json
+ */
+ /**
+ * Sample code: Delete Cloud Service.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteCloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServices().delete("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServices_DeleteInstances
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.RoleInstances;
+import java.util.Arrays;
+
+/** Samples for CloudServices DeleteInstances. */
+public final class CloudServicesDeleteInstancesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstances.json
+ */
+ /**
+ * Sample code: Delete Cloud Service Role Instances.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteCloudServiceRoleInstances(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .cloudServices()
+ .deleteInstances(
+ "ConstosoRG",
+ "{cs-name}",
+ new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")),
+ Context.NONE);
+ }
+}
+```
+
+### CloudServices_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices GetByResourceGroup. */
+public final class CloudServicesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceWithMultiRoleAndRDP.json
+ */
+ /**
+ * Sample code: Get Cloud Service with Multiple Roles and RDP Extension.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getCloudServiceWithMultipleRolesAndRDPExtension(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServices().getByResourceGroupWithResponse("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServices_GetInstanceView
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices GetInstanceView. */
+public final class CloudServicesGetInstanceViewSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceInstanceViewWithMultiRole.json
+ */
+ /**
+ * Sample code: Get Cloud Service Instance View with Multiple Roles.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getCloudServiceInstanceViewWithMultipleRoles(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServices().getInstanceViewWithResponse("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServices_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices List. */
+public final class CloudServicesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInSubscription.json
+ */
+ /**
+ * Sample code: List Cloud Services in a Subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listCloudServicesInASubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServices().list(Context.NONE);
+ }
+}
+```
+
+### CloudServices_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices ListByResourceGroup. */
+public final class CloudServicesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInResourceGroup.json
+ */
+ /**
+ * Sample code: List Cloud Services in a Resource Group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listCloudServicesInAResourceGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServices().listByResourceGroup("ConstosoRG", Context.NONE);
+ }
+}
+```
+
+### CloudServices_PowerOff
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices PowerOff. */
+public final class CloudServicesPowerOffSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/PowerOffCloudService.json
+ */
+ /**
+ * Sample code: Stop or PowerOff Cloud Service.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void stopOrPowerOffCloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServices().powerOff("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServices_Rebuild
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.RoleInstances;
+import java.util.Arrays;
+
+/** Samples for CloudServices Rebuild. */
+public final class CloudServicesRebuildSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstances.json
+ */
+ /**
+ * Sample code: Rebuild Cloud Service Role Instances.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void rebuildCloudServiceRoleInstances(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .cloudServices()
+ .rebuild(
+ "ConstosoRG",
+ "{cs-name}",
+ new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")),
+ Context.NONE);
+ }
+}
+```
+
+### CloudServices_Reimage
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.RoleInstances;
+import java.util.Arrays;
+
+/** Samples for CloudServices Reimage. */
+public final class CloudServicesReimageSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstances.json
+ */
+ /**
+ * Sample code: Reimage Cloud Service Role Instances.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void reimageCloudServiceRoleInstances(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .cloudServices()
+ .reimage(
+ "ConstosoRG",
+ "{cs-name}",
+ new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")),
+ Context.NONE);
+ }
+}
+```
+
+### CloudServices_Restart
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.RoleInstances;
+import java.util.Arrays;
+
+/** Samples for CloudServices Restart. */
+public final class CloudServicesRestartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstances.json
+ */
+ /**
+ * Sample code: Restart Cloud Service Role Instances.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void restartCloudServiceRoleInstances(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .cloudServices()
+ .restart(
+ "ConstosoRG",
+ "{cs-name}",
+ new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")),
+ Context.NONE);
+ }
+}
+```
+
+### CloudServices_Start
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices Start. */
+public final class CloudServicesStartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/StartCloudService.json
+ */
+ /**
+ * Sample code: Start Cloud Service.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void startCloudService(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServices().start("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServices_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.CloudService;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CloudServices Update. */
+public final class CloudServicesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceToIncludeTags.json
+ */
+ /**
+ * Sample code: Update existing Cloud Service to add tags.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateExistingCloudServiceToAddTags(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ CloudService resource =
+ manager.cloudServices().getByResourceGroupWithResponse("ConstosoRG", "{cs-name}", Context.NONE).getValue();
+ resource.update().withTags(mapOf("Documentation", "RestAPI")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### CloudServicesUpdateDomain_GetUpdateDomain
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServicesUpdateDomain GetUpdateDomain. */
+public final class CloudServicesUpdateDomainGetUpdateDomainSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceUpdateDomain.json
+ */
+ /**
+ * Sample code: Get Cloud Service Update Domain.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getCloudServiceUpdateDomain(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServicesUpdateDomains().getUpdateDomainWithResponse("ConstosoRG", "{cs-name}", 1, Context.NONE);
+ }
+}
+```
+
+### CloudServicesUpdateDomain_ListUpdateDomains
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServicesUpdateDomain ListUpdateDomains. */
+public final class CloudServicesUpdateDomainListUpdateDomainsSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceUpdateDomains.json
+ */
+ /**
+ * Sample code: List Update Domains in Cloud Service.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listUpdateDomainsInCloudService(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServicesUpdateDomains().listUpdateDomains("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
+```
+
+### CloudServicesUpdateDomain_WalkUpdateDomain
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CloudServicesUpdateDomain WalkUpdateDomain. */
+public final class CloudServicesUpdateDomainWalkUpdateDomainSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceUpdateDomain.json
+ */
+ /**
+ * Sample code: Update Cloud Service to specified Domain.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateCloudServiceToSpecifiedDomain(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.cloudServicesUpdateDomains().walkUpdateDomain("ConstosoRG", "{cs-name}", 1, null, Context.NONE);
+ }
+}
+```
+
+### CommunityGalleries_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CommunityGalleries Get. */
+public final class CommunityGalleriesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGallery.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.communityGalleries().getWithResponse("myLocation", "publicGalleryName", Context.NONE);
+ }
+}
+```
+
+### CommunityGalleryImageVersions_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CommunityGalleryImageVersions Get. */
+public final class CommunityGalleryImageVersionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .communityGalleryImageVersions()
+ .getWithResponse(
+ "myLocation", "publicGalleryName", "myGalleryImageName", "myGalleryImageVersionName", Context.NONE);
+ }
+}
+```
+
+### CommunityGalleryImages_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for CommunityGalleryImages Get. */
+public final class CommunityGalleryImagesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImage.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .communityGalleryImages()
+ .getWithResponse("myLocation", "publicGalleryName", "myGalleryImageName", Context.NONE);
+ }
+}
+```
+
+### DedicatedHostGroups_CreateOrUpdate
+
+```java
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DedicatedHostGroups CreateOrUpdate. */
+public final class DedicatedHostGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Create or update a dedicated host group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateADedicatedHostGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .dedicatedHostGroups()
+ .define("myDedicatedHostGroup")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withTags(mapOf("department", "finance"))
+ .withZones(Arrays.asList("1"))
+ .withPlatformFaultDomainCount(3)
+ .withSupportAutomaticPlacement(true)
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### DedicatedHostGroups_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DedicatedHostGroups Delete. */
+public final class DedicatedHostGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHostGroups_Delete_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostGroupsDeleteMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.dedicatedHostGroups().deleteWithResponse("rgcompute", "aaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Delete_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHostGroups_Delete_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostGroupsDeleteMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.dedicatedHostGroups().deleteWithResponse("rgcompute", "a", Context.NONE);
+ }
+}
+```
+
+### DedicatedHostGroups_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DedicatedHostGroups GetByResourceGroup. */
+public final class DedicatedHostGroupsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Create a dedicated host group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createADedicatedHostGroup(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .dedicatedHostGroups()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDedicatedHostGroup", null, Context.NONE);
+ }
+}
+```
+
+### DedicatedHostGroups_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DedicatedHostGroups List. */
+public final class DedicatedHostGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHostGroups_ListBySubscription_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostGroupsListBySubscriptionMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.dedicatedHostGroups().list(Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListBySubscription_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHostGroups_ListBySubscription_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostGroupsListBySubscriptionMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.dedicatedHostGroups().list(Context.NONE);
+ }
+}
+```
+
+### DedicatedHostGroups_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DedicatedHostGroups ListByResourceGroup. */
+public final class DedicatedHostGroupsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHostGroups_ListByResourceGroup_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostGroupsListByResourceGroupMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.dedicatedHostGroups().listByResourceGroup("rgcompute", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_ListByResourceGroup_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHostGroups_ListByResourceGroup_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostGroupsListByResourceGroupMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.dedicatedHostGroups().listByResourceGroup("rgcompute", Context.NONE);
+ }
+}
+```
+
+### DedicatedHostGroups_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroup;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DedicatedHostGroups Update. */
+public final class DedicatedHostGroupsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHostGroups_Update_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostGroupsUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ DedicatedHostGroup resource =
+ manager
+ .dedicatedHostGroups()
+ .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaa", null, Context.NONE)
+ .getValue();
+ resource.update().apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostGroups_Update_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHostGroups_Update_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostGroupsUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ DedicatedHostGroup resource =
+ manager
+ .dedicatedHostGroups()
+ .getByResourceGroupWithResponse("rgcompute", "aaaa", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withTags(mapOf("key9921", "aaaaaaaaaa"))
+ .withZones(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))
+ .withPlatformFaultDomainCount(3)
+ .withSupportAutomaticPlacement(true)
+ .apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### DedicatedHosts_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.Sku;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DedicatedHosts CreateOrUpdate. */
+public final class DedicatedHostsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateADedicatedHost.json
+ */
+ /**
+ * Sample code: Create or update a dedicated host .
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateADedicatedHost(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .dedicatedHosts()
+ .define("myDedicatedHost")
+ .withRegion("westus")
+ .withExistingHostGroup("myResourceGroup", "myDedicatedHostGroup")
+ .withSku(new Sku().withName("DSv3-Type1"))
+ .withTags(mapOf("department", "HR"))
+ .withPlatformFaultDomain(1)
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### DedicatedHosts_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DedicatedHosts Delete. */
+public final class DedicatedHostsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHosts_Delete_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostsDeleteMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.dedicatedHosts().delete("rgcompute", "aaaaaa", "aaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Delete_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHosts_Delete_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostsDeleteMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.dedicatedHosts().delete("rgcompute", "aaaaaaaaaaaaaaa", "aaaaa", Context.NONE);
+ }
+}
+```
+
+### DedicatedHosts_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DedicatedHosts Get. */
+public final class DedicatedHostsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetADedicatedHost.json
+ */
+ /**
+ * Sample code: Get a dedicated host.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getADedicatedHost(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .dedicatedHosts()
+ .getWithResponse("myResourceGroup", "myDedicatedHostGroup", "myHost", null, Context.NONE);
+ }
+}
+```
+
+### DedicatedHosts_ListByHostGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DedicatedHosts ListByHostGroup. */
+public final class DedicatedHostsListByHostGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHosts_ListByHostGroup_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostsListByHostGroupMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.dedicatedHosts().listByHostGroup("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_ListByHostGroup_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHosts_ListByHostGroup_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostsListByHostGroupMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.dedicatedHosts().listByHostGroup("rgcompute", "aaaa", Context.NONE);
+ }
+}
+```
+
+### DedicatedHosts_Restart
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DedicatedHosts Restart. */
+public final class DedicatedHostsRestartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHostRestart.json
+ */
+ /**
+ * Sample code: Restart Dedicated Host.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void restartDedicatedHost(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.dedicatedHosts().restart("myResourceGroup", "myDedicatedHostGroup", "myHost", Context.NONE);
+ }
+}
+```
+
+### DedicatedHosts_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.DedicatedHost;
+import com.azure.resourcemanager.compute.generated.models.DedicatedHostLicenseTypes;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DedicatedHosts Update. */
+public final class DedicatedHostsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHosts_Update_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostsUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ DedicatedHost resource =
+ manager
+ .dedicatedHosts()
+ .getWithResponse("rgcompute", "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withTags(mapOf("key8813", "aaaaaaaaaaaaaaaaaaaaaaaaaaa"))
+ .withPlatformFaultDomain(1)
+ .withAutoReplaceOnFailure(true)
+ .withLicenseType(DedicatedHostLicenseTypes.WINDOWS_SERVER_HYBRID)
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DedicatedHosts_Update_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: DedicatedHosts_Update_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void dedicatedHostsUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ DedicatedHost resource =
+ manager
+ .dedicatedHosts()
+ .getWithResponse("rgcompute", "aa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", null, Context.NONE)
+ .getValue();
+ resource.update().apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### DiskAccesses_CreateOrUpdate
+
+```java
+/** Samples for DiskAccesses CreateOrUpdate. */
+public final class DiskAccessesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateADiskAccess.json
+ */
+ /**
+ * Sample code: Create a disk access resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createADiskAccessResource(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskAccesses()
+ .define("myDiskAccess")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .create();
+ }
+}
+```
+
+### DiskAccesses_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses Delete. */
+public final class DiskAccessesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/DeleteADiskAccess.json
+ */
+ /**
+ * Sample code: Delete a disk access resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteADiskAccessResource(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskAccesses().delete("myResourceGroup", "myDiskAccess", Context.NONE);
+ }
+}
+```
+
+### DiskAccesses_DeleteAPrivateEndpointConnection
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses DeleteAPrivateEndpointConnection. */
+public final class DiskAccessesDeleteAPrivateEndpointConnectionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/DeleteAPrivateEndpointConnection.json
+ */
+ /**
+ * Sample code: Delete a private endpoint connection under a disk access resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteAPrivateEndpointConnectionUnderADiskAccessResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskAccesses()
+ .deleteAPrivateEndpointConnection(
+ "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", Context.NONE);
+ }
+}
+```
+
+### DiskAccesses_GetAPrivateEndpointConnection
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses GetAPrivateEndpointConnection. */
+public final class DiskAccessesGetAPrivateEndpointConnectionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/GetInformationAboutAPrivateEndpointConnection.json
+ */
+ /**
+ * Sample code: Get information about a private endpoint connection under a disk access resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskAccesses()
+ .getAPrivateEndpointConnectionWithResponse(
+ "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", Context.NONE);
+ }
+}
+```
+
+### DiskAccesses_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses GetByResourceGroup. */
+public final class DiskAccessesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/GetInformationAboutADiskAccess.json
+ */
+ /**
+ * Sample code: Get information about a disk access resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getInformationAboutADiskAccessResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskAccesses().getByResourceGroupWithResponse("myResourceGroup", "myDiskAccess", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/GetInformationAboutADiskAccessWithPrivateEndpoints.json
+ */
+ /**
+ * Sample code: Get information about a disk access resource with private endpoints.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getInformationAboutADiskAccessResourceWithPrivateEndpoints(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskAccesses().getByResourceGroupWithResponse("myResourceGroup", "myDiskAccess", Context.NONE);
+ }
+}
+```
+
+### DiskAccesses_GetPrivateLinkResources
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses GetPrivateLinkResources. */
+public final class DiskAccessesGetPrivateLinkResourcesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/GetDiskAccessPrivateLinkResources.json
+ */
+ /**
+ * Sample code: List all possible private link resources under disk access resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllPossiblePrivateLinkResourcesUnderDiskAccessResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskAccesses().getPrivateLinkResourcesWithResponse("myResourceGroup", "myDiskAccess", Context.NONE);
+ }
+}
+```
+
+### DiskAccesses_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses List. */
+public final class DiskAccessesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListDiskAccessesInASubscription.json
+ */
+ /**
+ * Sample code: List all disk access resources in a subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllDiskAccessResourcesInASubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskAccesses().list(Context.NONE);
+ }
+}
+```
+
+### DiskAccesses_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses ListByResourceGroup. */
+public final class DiskAccessesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListDiskAccessesInAResourceGroup.json
+ */
+ /**
+ * Sample code: List all disk access resources in a resource group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllDiskAccessResourcesInAResourceGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskAccesses().listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
+```
+
+### DiskAccesses_ListPrivateEndpointConnections
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses ListPrivateEndpointConnections. */
+public final class DiskAccessesListPrivateEndpointConnectionsSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListPrivateEndpointConnectionsInADiskAccess.json
+ */
+ /**
+ * Sample code: Get information about a private endpoint connection under a disk access resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskAccesses().listPrivateEndpointConnections("myResourceGroup", "myDiskAccess", Context.NONE);
+ }
+}
+```
+
+### DiskAccesses_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.DiskAccess;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DiskAccesses Update. */
+public final class DiskAccessesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateADiskAccess.json
+ */
+ /**
+ * Sample code: Update a disk access resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateADiskAccessResource(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ DiskAccess resource =
+ manager
+ .diskAccesses()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDiskAccess", Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("department", "Development", "project", "PrivateEndpoints")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### DiskAccesses_UpdateAPrivateEndpointConnection
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner;
+import com.azure.resourcemanager.compute.generated.models.PrivateEndpointServiceConnectionStatus;
+import com.azure.resourcemanager.compute.generated.models.PrivateLinkServiceConnectionState;
+
+/** Samples for DiskAccesses UpdateAPrivateEndpointConnection. */
+public final class DiskAccessesUpdateAPrivateEndpointConnectionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ApprovePrivateEndpointConnection.json
+ */
+ /**
+ * Sample code: Approve a Private Endpoint Connection under a disk access resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void approveAPrivateEndpointConnectionUnderADiskAccessResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskAccesses()
+ .updateAPrivateEndpointConnection(
+ "myResourceGroup",
+ "myDiskAccess",
+ "myPrivateEndpointConnection",
+ new PrivateEndpointConnectionInner()
+ .withPrivateLinkServiceConnectionState(
+ new PrivateLinkServiceConnectionState()
+ .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED)
+ .withDescription("Approving myPrivateEndpointConnection")),
+ Context.NONE);
+ }
+}
+```
+
+### DiskEncryptionSets_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetIdentityType;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetType;
+import com.azure.resourcemanager.compute.generated.models.EncryptionSetIdentity;
+import com.azure.resourcemanager.compute.generated.models.KeyForDiskEncryptionSet;
+import com.azure.resourcemanager.compute.generated.models.SourceVault;
+
+/** Samples for DiskEncryptionSets CreateOrUpdate. */
+public final class DiskEncryptionSetsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateADiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Create a disk encryption set.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createADiskEncryptionSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskEncryptionSets()
+ .define("myDiskEncryptionSet")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED))
+ .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY)
+ .withActiveKey(
+ new KeyForDiskEncryptionSet()
+ .withSourceVault(
+ new SourceVault()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"))
+ .withKeyUrl("https://myvmvault.vault-int.azure-int.net/keys/{key}"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription.json
+ */
+ /**
+ * Sample code: Create a disk encryption set with key vault from a different subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createADiskEncryptionSetWithKeyVaultFromADifferentSubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskEncryptionSets()
+ .define("myDiskEncryptionSet")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED))
+ .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY)
+ .withActiveKey(
+ new KeyForDiskEncryptionSet()
+ .withKeyUrl("https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}"))
+ .create();
+ }
+}
+```
+
+### DiskEncryptionSets_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskEncryptionSets Delete. */
+public final class DiskEncryptionSetsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/DeleteADiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Delete a disk encryption set.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteADiskEncryptionSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskEncryptionSets().delete("myResourceGroup", "myDiskEncryptionSet", Context.NONE);
+ }
+}
+```
+
+### DiskEncryptionSets_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskEncryptionSets GetByResourceGroup. */
+public final class DiskEncryptionSetsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/GetInformationAboutADiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Get information about a disk encryption set.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getInformationAboutADiskEncryptionSet(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskEncryptionSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDiskEncryptionSet", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/GetInformationAboutADiskEncryptionSetWithAutoKeyRotationError.json
+ */
+ /**
+ * Sample code: Get information about a disk encryption set when auto-key rotation failed.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskEncryptionSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDiskEncryptionSet", Context.NONE);
+ }
+}
+```
+
+### DiskEncryptionSets_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskEncryptionSets List. */
+public final class DiskEncryptionSetsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListDiskEncryptionSetsInASubscription.json
+ */
+ /**
+ * Sample code: List all disk encryption sets in a subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllDiskEncryptionSetsInASubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskEncryptionSets().list(Context.NONE);
+ }
+}
+```
+
+### DiskEncryptionSets_ListAssociatedResources
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskEncryptionSets ListAssociatedResources. */
+public final class DiskEncryptionSetsListAssociatedResourcesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListDiskEncryptionSetAssociatedResources.json
+ */
+ /**
+ * Sample code: List all resources that are encrypted with this disk encryption set.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskEncryptionSets().listAssociatedResources("myResourceGroup", "myDiskEncryptionSet", Context.NONE);
+ }
+}
+```
+
+### DiskEncryptionSets_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskEncryptionSets ListByResourceGroup. */
+public final class DiskEncryptionSetsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListDiskEncryptionSetsInAResourceGroup.json
+ */
+ /**
+ * Sample code: List all disk encryption sets in a resource group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllDiskEncryptionSetsInAResourceGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskEncryptionSets().listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
+```
+
+### DiskEncryptionSets_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSet;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetIdentityType;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetType;
+import com.azure.resourcemanager.compute.generated.models.EncryptionSetIdentity;
+import com.azure.resourcemanager.compute.generated.models.KeyForDiskEncryptionSet;
+import com.azure.resourcemanager.compute.generated.models.SourceVault;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DiskEncryptionSets Update. */
+public final class DiskEncryptionSetsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabled.json
+ */
+ /**
+ * Sample code: Update a disk encryption set with rotationToLatestKeyVersionEnabled set to true - Succeeded.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ DiskEncryptionSet resource =
+ manager
+ .diskEncryptionSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDiskEncryptionSet", Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED))
+ .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY)
+ .withActiveKey(
+ new KeyForDiskEncryptionSet()
+ .withKeyUrl("https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1"))
+ .withRotationToLatestKeyVersionEnabled(true)
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledInProgress.json
+ */
+ /**
+ * Sample code: Update a disk encryption set with rotationToLatestKeyVersionEnabled set to true - Updating.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ DiskEncryptionSet resource =
+ manager
+ .diskEncryptionSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDiskEncryptionSet", Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED))
+ .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY)
+ .withActiveKey(
+ new KeyForDiskEncryptionSet()
+ .withKeyUrl("https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1"))
+ .withRotationToLatestKeyVersionEnabled(true)
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateADiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Update a disk encryption set.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateADiskEncryptionSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ DiskEncryptionSet resource =
+ manager
+ .diskEncryptionSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDiskEncryptionSet", Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withTags(mapOf("department", "Development", "project", "Encryption"))
+ .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY)
+ .withActiveKey(
+ new KeyForDiskEncryptionSet()
+ .withSourceVault(
+ new SourceVault()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"))
+ .withKeyUrl("https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion"))
+ .apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### DiskRestorePoint_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskRestorePoint Get. */
+public final class DiskRestorePointGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/GetDiskRestorePointWhenSourceResourceIsFromDifferentRegion.json
+ */
+ /**
+ * Sample code: Get an incremental disk restorePoint when source resource is from a different region.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskRestorePoints()
+ .getWithResponse(
+ "myResourceGroup",
+ "rpc",
+ "vmrp",
+ "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745",
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/GetDiskRestorePointResources.json
+ */
+ /**
+ * Sample code: Get an incremental disk restorePoint resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAnIncrementalDiskRestorePointResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskRestorePoints()
+ .getWithResponse(
+ "myResourceGroup",
+ "rpc",
+ "vmrp",
+ "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745",
+ Context.NONE);
+ }
+}
+```
+
+### DiskRestorePoint_GrantAccess
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.AccessLevel;
+import com.azure.resourcemanager.compute.generated.models.GrantAccessData;
+
+/** Samples for DiskRestorePoint GrantAccess. */
+public final class DiskRestorePointGrantAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/BeginGetAccessDiskRestorePoint.json
+ */
+ /**
+ * Sample code: Grants access to a diskRestorePoint.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void grantsAccessToADiskRestorePoint(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskRestorePoints()
+ .grantAccess(
+ "myResourceGroup",
+ "rpc",
+ "vmrp",
+ "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745",
+ new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300),
+ Context.NONE);
+ }
+}
+```
+
+### DiskRestorePoint_ListByRestorePoint
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskRestorePoint ListByRestorePoint. */
+public final class DiskRestorePointListByRestorePointSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListDiskRestorePointsInVmRestorePoint.json
+ */
+ /**
+ * Sample code: Get an incremental disk restorePoint resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAnIncrementalDiskRestorePointResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.diskRestorePoints().listByRestorePoint("myResourceGroup", "rpc", "vmrp", Context.NONE);
+ }
+}
+```
+
+### DiskRestorePoint_RevokeAccess
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for DiskRestorePoint RevokeAccess. */
+public final class DiskRestorePointRevokeAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/EndGetAccessDiskRestorePoint.json
+ */
+ /**
+ * Sample code: Revokes access to a diskRestorePoint.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void revokesAccessToADiskRestorePoint(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .diskRestorePoints()
+ .revokeAccess(
+ "myResourceGroup",
+ "rpc",
+ "vmrp",
+ "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745",
+ Context.NONE);
+ }
+}
+```
+
+### Disks_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.CreationData;
+import com.azure.resourcemanager.compute.generated.models.DiskCreateOption;
+import com.azure.resourcemanager.compute.generated.models.DiskSecurityProfile;
+import com.azure.resourcemanager.compute.generated.models.DiskSecurityTypes;
+import com.azure.resourcemanager.compute.generated.models.DiskSku;
+import com.azure.resourcemanager.compute.generated.models.DiskStorageAccountTypes;
+import com.azure.resourcemanager.compute.generated.models.Encryption;
+import com.azure.resourcemanager.compute.generated.models.ExtendedLocation;
+import com.azure.resourcemanager.compute.generated.models.ExtendedLocationTypes;
+import com.azure.resourcemanager.compute.generated.models.ImageDiskReference;
+import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy;
+import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes;
+
+/** Samples for Disks CreateOrUpdate. */
+public final class DisksCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription.json
+ */
+ /**
+ * Sample code: Create a managed disk by importing an unmanaged blob from a different subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.IMPORT)
+ .withStorageAccountId(
+ "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")
+ .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskFromImportSecure.json
+ */
+ /**
+ * Sample code: Create a managed disk from ImportSecure create option.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedDiskFromImportSecureCreateOption(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.IMPORT_SECURE)
+ .withStorageAccountId(
+ "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")
+ .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")
+ .withSecurityDataUri("https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd"))
+ .withSecurityProfile(
+ new DiskSecurityProfile()
+ .withSecurityType(DiskSecurityTypes.CONFIDENTIAL_VM_VMGUEST_STATE_ONLY_ENCRYPTED_WITH_PLATFORM_KEY))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskWithDiskAccess.json
+ */
+ /**
+ * Sample code: Create a managed disk and associate with disk access resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedDiskAndAssociateWithDiskAccessResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY))
+ .withDiskSizeGB(200)
+ .withNetworkAccessPolicy(NetworkAccessPolicy.ALLOW_PRIVATE)
+ .withDiskAccessId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}")
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskWithDiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Create a managed disk and associate with disk encryption set.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedDiskAndAssociateWithDiskEncryptionSet(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY))
+ .withDiskSizeGB(200)
+ .withEncryption(
+ new Encryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskFromAnExistingManagedDisk.json
+ */
+ /**
+ * Sample code: Create a managed disk from an existing managed disk in the same or different subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk2")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.COPY)
+ .withSourceResourceId(
+ "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskWithSecurityProfile.json
+ */
+ /**
+ * Sample code: Create a managed disk with security profile.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedDiskWithSecurityProfile(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("North Central US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.FROM_IMAGE)
+ .withImageReference(
+ new ImageDiskReference()
+ .withId(
+ "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}")))
+ .withSecurityProfile(new DiskSecurityProfile().withSecurityType(DiskSecurityTypes.TRUSTED_LAUNCH))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskWithLogicalSectorSize.json
+ */
+ /**
+ * Sample code: Create an ultra managed disk with logicalSectorSize 512E.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAnUltraManagedDiskWithLogicalSectorSize512E(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new DiskSku().withName(DiskStorageAccountTypes.ULTRA_SSD_LRS))
+ .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY).withLogicalSectorSize(512))
+ .withDiskSizeGB(200)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskFromAPlatformImage.json
+ */
+ /**
+ * Sample code: Create a managed disk from a platform image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedDiskFromAPlatformImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.FROM_IMAGE)
+ .withImageReference(
+ new ImageDiskReference()
+ .withId(
+ "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAnEmptyManagedDisk.json
+ */
+ /**
+ * Sample code: Create an empty managed disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAnEmptyManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY))
+ .withDiskSizeGB(200)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription.json
+ */
+ /**
+ * Sample code: Create a managed disk by importing an unmanaged blob from the same subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.IMPORT)
+ .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskFromUploadPreparedSecure.json
+ */
+ /**
+ * Sample code: Create a managed disk from UploadPreparedSecure create option.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedDiskFromUploadPreparedSecureCreateOption(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.UPLOAD_PREPARED_SECURE)
+ .withUploadSizeBytes(10737418752L))
+ .withSecurityProfile(new DiskSecurityProfile().withSecurityType(DiskSecurityTypes.TRUSTED_LAUNCH))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskByCopyingASnapshot.json
+ */
+ /**
+ * Sample code: Create a managed disk by copying a snapshot.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedDiskByCopyingASnapshot(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.COPY)
+ .withSourceResourceId(
+ "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAConfidentialVMDiskEncryptedWithCMK.json
+ */
+ /**
+ * Sample code: Create a confidential VM supported disk encrypted with customer managed key.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.FROM_IMAGE)
+ .withImageReference(
+ new ImageDiskReference()
+ .withId(
+ "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0")))
+ .withSecurityProfile(
+ new DiskSecurityProfile()
+ .withSecurityType(DiskSecurityTypes.CONFIDENTIAL_VM_DISK_ENCRYPTED_WITH_CUSTOMER_KEY)
+ .withSecureVMDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedDiskWithSSDZRSAccountType.json
+ */
+ /**
+ * Sample code: Create a managed disk with ssd zrs account type.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedDiskWithSsdZrsAccountType(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new DiskSku().withName(DiskStorageAccountTypes.PREMIUM_ZRS))
+ .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY))
+ .withDiskSizeGB(200)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAnEmptyManagedDiskInExtendedLocation.json
+ */
+ /**
+ * Sample code: Create an empty managed disk in extended location.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAnEmptyManagedDiskInExtendedLocation(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withExtendedLocation(
+ new ExtendedLocation().withName("{edge-zone-id}").withType(ExtendedLocationTypes.EDGE_ZONE))
+ .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY))
+ .withDiskSizeGB(200)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateAManagedUploadDisk.json
+ */
+ /**
+ * Sample code: Create a managed upload disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAManagedUploadDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .define("myDisk")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(
+ new CreationData().withCreateOption(DiskCreateOption.UPLOAD).withUploadSizeBytes(10737418752L))
+ .create();
+ }
+}
+```
+
+### Disks_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Disks Delete. */
+public final class DisksDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/DeleteAManagedDisk.json
+ */
+ /**
+ * Sample code: Delete a managed disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteAManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.disks().delete("myResourceGroup", "myDisk", Context.NONE);
+ }
+}
+```
+
+### Disks_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Disks GetByResourceGroup. */
+public final class DisksGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/GetInformationAboutAManagedDisk.json
+ */
+ /**
+ * Sample code: Get information about a managed disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getInformationAboutAManagedDisk(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.disks().getByResourceGroupWithResponse("myResourceGroup", "myManagedDisk", Context.NONE);
+ }
+}
+```
+
+### Disks_GrantAccess
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.AccessLevel;
+import com.azure.resourcemanager.compute.generated.models.GrantAccessData;
+
+/** Samples for Disks GrantAccess. */
+public final class DisksGrantAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/BeginGetAccessManagedDisk.json
+ */
+ /**
+ * Sample code: Get a sas on a managed disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getASasOnAManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .grantAccess(
+ "myResourceGroup",
+ "myDisk",
+ new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/BeginGetAccessManagedDiskWithVMGuestState.json
+ */
+ /**
+ * Sample code: Get sas on managed disk and VM guest state.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getSasOnManagedDiskAndVMGuestState(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .disks()
+ .grantAccess(
+ "myResourceGroup",
+ "myDisk",
+ new GrantAccessData()
+ .withAccess(AccessLevel.READ)
+ .withDurationInSeconds(300)
+ .withGetSecureVMGuestStateSas(true),
+ Context.NONE);
+ }
+}
+```
+
+### Disks_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Disks List. */
+public final class DisksListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListManagedDisksInASubscription.json
+ */
+ /**
+ * Sample code: List all managed disks in a subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllManagedDisksInASubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.disks().list(Context.NONE);
+ }
+}
+```
+
+### Disks_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Disks ListByResourceGroup. */
+public final class DisksListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListManagedDisksInAResourceGroup.json
+ */
+ /**
+ * Sample code: List all managed disks in a resource group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllManagedDisksInAResourceGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.disks().listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
+```
+
+### Disks_RevokeAccess
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Disks RevokeAccess. */
+public final class DisksRevokeAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/EndGetAccessManagedDisk.json
+ */
+ /**
+ * Sample code: Revoke access to a managed disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void revokeAccessToAManagedDisk(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.disks().revokeAccess("myResourceGroup", "myDisk", Context.NONE);
+ }
+}
+```
+
+### Disks_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.Disk;
+import com.azure.resourcemanager.compute.generated.models.NetworkAccessPolicy;
+import com.azure.resourcemanager.compute.generated.models.PurchasePlanAutoGenerated;
+import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities;
+
+/** Samples for Disks Update. */
+public final class DisksUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateAManagedDiskToDisableBursting.json
+ */
+ /**
+ * Sample code: Update a managed disk to disable bursting.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateAManagedDiskToDisableBursting(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ Disk resource =
+ manager.disks().getByResourceGroupWithResponse("myResourceGroup", "myDisk", Context.NONE).getValue();
+ resource.update().withBurstingEnabled(false).apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateAManagedDiskToAddPurchasePlan.json
+ */
+ /**
+ * Sample code: Update a managed disk to add purchase plan.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateAManagedDiskToAddPurchasePlan(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ Disk resource =
+ manager.disks().getByResourceGroupWithResponse("myResourceGroup", "myDisk", Context.NONE).getValue();
+ resource
+ .update()
+ .withPurchasePlan(
+ new PurchasePlanAutoGenerated()
+ .withName("myPurchasePlanName")
+ .withPublisher("myPurchasePlanPublisher")
+ .withProduct("myPurchasePlanProduct")
+ .withPromotionCode("myPurchasePlanPromotionCode"))
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateAManagedDiskToChangeTier.json
+ */
+ /**
+ * Sample code: Update a managed disk to change tier.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateAManagedDiskToChangeTier(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ Disk resource =
+ manager.disks().getByResourceGroupWithResponse("myResourceGroup", "myDisk", Context.NONE).getValue();
+ resource.update().withTier("P30").apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateOrUpdateABurstingEnabledManagedDisk.json
+ */
+ /**
+ * Sample code: Create or update a bursting enabled managed disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateABurstingEnabledManagedDisk(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ Disk resource =
+ manager.disks().getByResourceGroupWithResponse("myResourceGroup", "myDisk", Context.NONE).getValue();
+ resource.update().withDiskSizeGB(1024).withBurstingEnabled(true).apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateAManagedDiskToAddSupportsHibernation.json
+ */
+ /**
+ * Sample code: Update a managed disk to add supportsHibernation.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateAManagedDiskToAddSupportsHibernation(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ Disk resource =
+ manager.disks().getByResourceGroupWithResponse("myResourceGroup", "myDisk", Context.NONE).getValue();
+ resource.update().withSupportsHibernation(true).apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateAManagedDiskToRemoveDiskAccess.json
+ */
+ /**
+ * Sample code: Update managed disk to remove disk access resource association.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateManagedDiskToRemoveDiskAccessResourceAssociation(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ Disk resource =
+ manager.disks().getByResourceGroupWithResponse("myResourceGroup", "myDisk", Context.NONE).getValue();
+ resource.update().withNetworkAccessPolicy(NetworkAccessPolicy.ALLOW_ALL).apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateAManagedDiskToAddAcceleratedNetworking.json
+ */
+ /**
+ * Sample code: Update a managed disk to add accelerated networking.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateAManagedDiskToAddAcceleratedNetworking(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ Disk resource =
+ manager.disks().getByResourceGroupWithResponse("myResourceGroup", "myDisk", Context.NONE).getValue();
+ resource.update().withSupportedCapabilities(new SupportedCapabilities().withAcceleratedNetwork(false)).apply();
+ }
+}
+```
+
+### Galleries_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.GallerySharingPermissionTypes;
+import com.azure.resourcemanager.compute.generated.models.SharingProfile;
+import com.azure.resourcemanager.compute.generated.models.SoftDeletePolicy;
+
+/** Samples for Galleries CreateOrUpdate. */
+public final class GalleriesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryWithSharingProfile.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery with sharing profile.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryWithSharingProfile(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleries()
+ .define("myGalleryName")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withDescription("This is the gallery description.")
+ .withSharingProfile(new SharingProfile().withPermissions(GallerySharingPermissionTypes.GROUPS))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGallery.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGallery(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleries()
+ .define("myGalleryName")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withDescription("This is the gallery description.")
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryWithSoftDeletionEnabled.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery with soft deletion enabled.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryWithSoftDeletionEnabled(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleries()
+ .define("myGalleryName")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withDescription("This is the gallery description.")
+ .withSoftDeletePolicy(new SoftDeletePolicy().withIsSoftDeleteEnabled(true))
+ .create();
+ }
+}
+```
+
+### Galleries_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Galleries Delete. */
+public final class GalleriesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/DeleteAGallery.json
+ */
+ /**
+ * Sample code: Delete a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.galleries().delete("myResourceGroup", "myGalleryName", Context.NONE);
+ }
+}
+```
+
+### Galleries_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.SelectPermissions;
+
+/** Samples for Galleries GetByResourceGroup. */
+public final class GalleriesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryWithSelectPermissions.json
+ */
+ /**
+ * Sample code: Get a gallery with select permissions.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGalleryWithSelectPermissions(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleries()
+ .getByResourceGroupWithResponse(
+ "myResourceGroup", "myGalleryName", SelectPermissions.PERMISSIONS, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGallery.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.galleries().getByResourceGroupWithResponse("myResourceGroup", "myGalleryName", null, Context.NONE);
+ }
+}
+```
+
+### Galleries_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Galleries List. */
+public final class GalleriesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleriesInASubscription.json
+ */
+ /**
+ * Sample code: List galleries in a subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listGalleriesInASubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.galleries().list(Context.NONE);
+ }
+}
+```
+
+### Galleries_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Galleries ListByResourceGroup. */
+public final class GalleriesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleriesInAResourceGroup.json
+ */
+ /**
+ * Sample code: List galleries in a resource group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listGalleriesInAResourceGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.galleries().listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
+```
+
+### Galleries_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.Gallery;
+
+/** Samples for Galleries Update. */
+public final class GalleriesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGallery.json
+ */
+ /**
+ * Sample code: Update a simple gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateASimpleGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ Gallery resource =
+ manager
+ .galleries()
+ .getByResourceGroupWithResponse("myResourceGroup", "myGalleryName", null, Context.NONE)
+ .getValue();
+ resource.update().withDescription("This is the gallery description.").apply();
+ }
+}
+```
+
+### GalleryApplicationVersions_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPublishingProfile;
+import com.azure.resourcemanager.compute.generated.models.StorageAccountType;
+import com.azure.resourcemanager.compute.generated.models.TargetRegion;
+import com.azure.resourcemanager.compute.generated.models.UserArtifactManage;
+import com.azure.resourcemanager.compute.generated.models.UserArtifactSource;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+
+/** Samples for GalleryApplicationVersions CreateOrUpdate. */
+public final class GalleryApplicationVersionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryApplicationVersion.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery Application Version.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryApplicationVersion(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryApplicationVersions()
+ .define("1.0.0")
+ .withRegion("West US")
+ .withExistingApplication("myResourceGroup", "myGalleryName", "myGalleryApplicationName")
+ .withPublishingProfile(
+ new GalleryApplicationVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withStorageAccountType(StorageAccountType.STANDARD_LRS)))
+ .withReplicaCount(1)
+ .withEndOfLifeDate(OffsetDateTime.parse("2019-07-01T07:00:00Z"))
+ .withStorageAccountType(StorageAccountType.STANDARD_LRS)
+ .withSource(
+ new UserArtifactSource()
+ .withMediaLink(
+ "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"))
+ .withManageActions(
+ new UserArtifactManage()
+ .withInstall(
+ "powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\"")
+ .withRemove("del C:\\package ")))
+ .create();
+ }
+}
+```
+
+### GalleryApplicationVersions_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for GalleryApplicationVersions Delete. */
+public final class GalleryApplicationVersionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/DeleteAGalleryApplicationVersion.json
+ */
+ /**
+ * Sample code: Delete a gallery Application Version.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteAGalleryApplicationVersion(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryApplicationVersions()
+ .delete("myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", Context.NONE);
+ }
+}
+```
+
+### GalleryApplicationVersions_Get
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes;
+
+/** Samples for GalleryApplicationVersions Get. */
+public final class GalleryApplicationVersionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryApplicationVersion.json
+ */
+ /**
+ * Sample code: Get a gallery Application Version.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGalleryApplicationVersion(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryApplicationVersions()
+ .getWithResponse(
+ "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryApplicationVersionWithReplicationStatus.json
+ */
+ /**
+ * Sample code: Get a gallery Application Version with replication status.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGalleryApplicationVersionWithReplicationStatus(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryApplicationVersions()
+ .getWithResponse(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryApplicationName",
+ "1.0.0",
+ ReplicationStatusTypes.REPLICATION_STATUS,
+ Context.NONE);
+ }
+}
+```
+
+### GalleryApplicationVersions_ListByGalleryApplication
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for GalleryApplicationVersions ListByGalleryApplication. */
+public final class GalleryApplicationVersionsListByGalleryApplicationSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleryApplicationVersionsInAGalleryApplication.json
+ */
+ /**
+ * Sample code: List gallery Application Versions in a gallery Application Definition.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listGalleryApplicationVersionsInAGalleryApplicationDefinition(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryApplicationVersions()
+ .listByGalleryApplication("myResourceGroup", "myGalleryName", "myGalleryApplicationName", Context.NONE);
+ }
+}
+```
+
+### GalleryApplicationVersions_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersion;
+import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionPublishingProfile;
+import com.azure.resourcemanager.compute.generated.models.StorageAccountType;
+import com.azure.resourcemanager.compute.generated.models.TargetRegion;
+import com.azure.resourcemanager.compute.generated.models.UserArtifactManage;
+import com.azure.resourcemanager.compute.generated.models.UserArtifactSource;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+
+/** Samples for GalleryApplicationVersions Update. */
+public final class GalleryApplicationVersionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGalleryApplicationVersion.json
+ */
+ /**
+ * Sample code: Update a simple gallery Application Version.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateASimpleGalleryApplicationVersion(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ GalleryApplicationVersion resource =
+ manager
+ .galleryApplicationVersions()
+ .getWithResponse(
+ "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withPublishingProfile(
+ new GalleryApplicationVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withStorageAccountType(StorageAccountType.STANDARD_LRS)))
+ .withReplicaCount(1)
+ .withEndOfLifeDate(OffsetDateTime.parse("2019-07-01T07:00:00Z"))
+ .withStorageAccountType(StorageAccountType.STANDARD_LRS)
+ .withSource(
+ new UserArtifactSource()
+ .withMediaLink(
+ "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"))
+ .withManageActions(
+ new UserArtifactManage()
+ .withInstall(
+ "powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\"")
+ .withRemove("del C:\\package ")))
+ .apply();
+ }
+}
+```
+
+### GalleryApplications_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes;
+
+/** Samples for GalleryApplications CreateOrUpdate. */
+public final class GalleryApplicationsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryApplication.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery Application.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryApplication(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryApplications()
+ .define("myGalleryApplicationName")
+ .withRegion("West US")
+ .withExistingGallery("myResourceGroup", "myGalleryName")
+ .withDescription("This is the gallery application description.")
+ .withEula("This is the gallery application EULA.")
+ .withPrivacyStatementUri("myPrivacyStatementUri}")
+ .withReleaseNoteUri("myReleaseNoteUri")
+ .withSupportedOSType(OperatingSystemTypes.WINDOWS)
+ .create();
+ }
+}
+```
+
+### GalleryApplications_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for GalleryApplications Delete. */
+public final class GalleryApplicationsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/DeleteAGalleryApplication.json
+ */
+ /**
+ * Sample code: Delete a gallery Application.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteAGalleryApplication(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryApplications()
+ .delete("myResourceGroup", "myGalleryName", "myGalleryApplicationName", Context.NONE);
+ }
+}
+```
+
+### GalleryApplications_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for GalleryApplications Get. */
+public final class GalleryApplicationsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryApplication.json
+ */
+ /**
+ * Sample code: Get a gallery Application.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGalleryApplication(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryApplications()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryApplicationName", Context.NONE);
+ }
+}
+```
+
+### GalleryApplications_ListByGallery
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for GalleryApplications ListByGallery. */
+public final class GalleryApplicationsListByGallerySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleryApplicationsInAGallery.json
+ */
+ /**
+ * Sample code: List gallery Applications in a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listGalleryApplicationsInAGallery(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.galleryApplications().listByGallery("myResourceGroup", "myGalleryName", Context.NONE);
+ }
+}
+```
+
+### GalleryApplications_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.GalleryApplication;
+import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes;
+
+/** Samples for GalleryApplications Update. */
+public final class GalleryApplicationsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGalleryApplication.json
+ */
+ /**
+ * Sample code: Update a simple gallery Application.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateASimpleGalleryApplication(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ GalleryApplication resource =
+ manager
+ .galleryApplications()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryApplicationName", Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withDescription("This is the gallery application description.")
+ .withEula("This is the gallery application EULA.")
+ .withPrivacyStatementUri("myPrivacyStatementUri}")
+ .withReleaseNoteUri("myReleaseNoteUri")
+ .withSupportedOSType(OperatingSystemTypes.WINDOWS)
+ .apply();
+ }
+}
+```
+
+### GalleryImageVersions_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.DataDiskImageEncryption;
+import com.azure.resourcemanager.compute.generated.models.EncryptionImages;
+import com.azure.resourcemanager.compute.generated.models.GalleryArtifactVersionSource;
+import com.azure.resourcemanager.compute.generated.models.GalleryDataDiskImage;
+import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPublishingProfile;
+import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionStorageProfile;
+import com.azure.resourcemanager.compute.generated.models.GalleryOSDiskImage;
+import com.azure.resourcemanager.compute.generated.models.HostCaching;
+import com.azure.resourcemanager.compute.generated.models.OSDiskImageEncryption;
+import com.azure.resourcemanager.compute.generated.models.ReplicationMode;
+import com.azure.resourcemanager.compute.generated.models.StorageAccountType;
+import com.azure.resourcemanager.compute.generated.models.TargetRegion;
+import java.util.Arrays;
+
+/** Samples for GalleryImageVersions CreateOrUpdate. */
+public final class GalleryImageVersionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithShallowReplicationMode.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using shallow replication mode.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .define("1.0.0")
+ .withRegion("West US")
+ .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays.asList(new TargetRegion().withName("West US").withRegionalReplicaCount(1)))
+ .withReplicationMode(ReplicationMode.SHALLOW))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVHD.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using vhd as a source.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .define("1.0.0")
+ .withRegion("West US")
+ .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withOsDiskImage(
+ new GalleryOSDiskImage()
+ .withHostCaching(HostCaching.READ_ONLY)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}")
+ .withUri(
+ "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd")))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new GalleryDataDiskImage()
+ .withHostCaching(HostCaching.NONE)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}")
+ .withUri(
+ "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"))
+ .withLun(1))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVMAsSource.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using VM as source.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .define("1.0.0")
+ .withRegion("West US")
+ .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")
+ .withLun(1)))))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithImageVersionAsSource.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using shared image as source.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .define("1.0.0")
+ .withRegion("West US")
+ .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")
+ .withLun(1)))))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithSnapshotsAsSource.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using mix of disks and snapshots as a source.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .define("1.0.0")
+ .withRegion("West US")
+ .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")
+ .withLun(1)))))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withOsDiskImage(
+ new GalleryOSDiskImage()
+ .withHostCaching(HostCaching.READ_ONLY)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}")))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new GalleryDataDiskImage()
+ .withHostCaching(HostCaching.NONE)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}"))
+ .withLun(1))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithSnapshotsAsSource.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using snapshots as a source.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .define("1.0.0")
+ .withRegion("West US")
+ .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")
+ .withLun(1)))))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withOsDiskImage(
+ new GalleryOSDiskImage()
+ .withHostCaching(HostCaching.READ_ONLY)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}")))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new GalleryDataDiskImage()
+ .withHostCaching(HostCaching.NONE)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}"))
+ .withLun(1))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using managed image as source.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .define("1.0.0")
+ .withRegion("West US")
+ .withExistingImage("myResourceGroup", "myGalleryName", "myGalleryImageName")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")
+ .withLun(1)))))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}")))
+ .create();
+ }
+}
+```
+
+### GalleryImageVersions_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for GalleryImageVersions Delete. */
+public final class GalleryImageVersionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/DeleteAGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Delete a gallery image version.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteAGalleryImageVersion(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .delete("myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", Context.NONE);
+ }
+}
+```
+
+### GalleryImageVersions_Get
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes;
+
+/** Samples for GalleryImageVersions Get. */
+public final class GalleryImageVersionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryImageVersionWithVhdAsSource.json
+ */
+ /**
+ * Sample code: Get a gallery image version with vhd as a source.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGalleryImageVersionWithVhdAsASource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Get a gallery image version.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGalleryImageVersion(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryImageVersionWithReplicationStatus.json
+ */
+ /**
+ * Sample code: Get a gallery image version with replication status.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGalleryImageVersionWithReplicationStatus(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .getWithResponse(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ "1.0.0",
+ ReplicationStatusTypes.REPLICATION_STATUS,
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryImageVersionWithSnapshotsAsSource.json
+ */
+ /**
+ * Sample code: Get a gallery image version with snapshots as a source.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGalleryImageVersionWithSnapshotsAsASource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", null, Context.NONE);
+ }
+}
+```
+
+### GalleryImageVersions_ListByGalleryImage
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for GalleryImageVersions ListByGalleryImage. */
+public final class GalleryImageVersionsListByGalleryImageSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleryImageVersionsInAGalleryImage.json
+ */
+ /**
+ * Sample code: List gallery image versions in a gallery image definition.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listGalleryImageVersionsInAGalleryImageDefinition(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImageVersions()
+ .listByGalleryImage("myResourceGroup", "myGalleryName", "myGalleryImageName", Context.NONE);
+ }
+}
+```
+
+### GalleryImageVersions_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.GalleryArtifactVersionSource;
+import com.azure.resourcemanager.compute.generated.models.GalleryImageVersion;
+import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionPublishingProfile;
+import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionStorageProfile;
+import com.azure.resourcemanager.compute.generated.models.StorageAccountType;
+import com.azure.resourcemanager.compute.generated.models.TargetRegion;
+import java.util.Arrays;
+
+/** Samples for GalleryImageVersions Update. */
+public final class GalleryImageVersionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Update a simple Gallery Image Version (Managed Image as source).
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateASimpleGalleryImageVersionManagedImageAsSource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ GalleryImageVersion resource =
+ manager
+ .galleryImageVersions()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion().withName("West US").withRegionalReplicaCount(1),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}")))
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGalleryImageVersionWithoutSourceId.json
+ */
+ /**
+ * Sample code: Update a simple Gallery Image Version without source id.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateASimpleGalleryImageVersionWithoutSourceId(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ GalleryImageVersion resource =
+ manager
+ .galleryImageVersions()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion().withName("West US").withRegionalReplicaCount(1),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS))))
+ .withStorageProfile(new GalleryImageVersionStorageProfile())
+ .apply();
+ }
+}
+```
+
+### GalleryImages_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.GalleryImageIdentifier;
+import com.azure.resourcemanager.compute.generated.models.HyperVGeneration;
+import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes;
+import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes;
+
+/** Samples for GalleryImages CreateOrUpdate. */
+public final class GalleryImagesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImage.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateASimpleGalleryImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .galleryImages()
+ .define("myGalleryImageName")
+ .withRegion("West US")
+ .withExistingGallery("myResourceGroup", "myGalleryName")
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED)
+ .withHyperVGeneration(HyperVGeneration.V1)
+ .withIdentifier(
+ new GalleryImageIdentifier()
+ .withPublisher("myPublisherName")
+ .withOffer("myOfferName")
+ .withSku("mySkuName"))
+ .create();
+ }
+}
+```
+
+### GalleryImages_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for GalleryImages Delete. */
+public final class GalleryImagesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/DeleteAGalleryImage.json
+ */
+ /**
+ * Sample code: Delete a gallery image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteAGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.galleryImages().delete("myResourceGroup", "myGalleryName", "myGalleryImageName", Context.NONE);
+ }
+}
+```
+
+### GalleryImages_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for GalleryImages Get. */
+public final class GalleryImagesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryImage.json
+ */
+ /**
+ * Sample code: Get a gallery image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.galleryImages().getWithResponse("myResourceGroup", "myGalleryName", "myGalleryImageName", Context.NONE);
+ }
+}
+```
+
+### GalleryImages_ListByGallery
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for GalleryImages ListByGallery. */
+public final class GalleryImagesListByGallerySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleryImagesInAGallery.json
+ */
+ /**
+ * Sample code: List gallery images in a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listGalleryImagesInAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.galleryImages().listByGallery("myResourceGroup", "myGalleryName", Context.NONE);
+ }
+}
+```
+
+### GalleryImages_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.GalleryImage;
+import com.azure.resourcemanager.compute.generated.models.GalleryImageIdentifier;
+import com.azure.resourcemanager.compute.generated.models.HyperVGeneration;
+import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes;
+import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes;
+
+/** Samples for GalleryImages Update. */
+public final class GalleryImagesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGalleryImage.json
+ */
+ /**
+ * Sample code: Update a simple gallery image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateASimpleGalleryImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ GalleryImage resource =
+ manager
+ .galleryImages()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryImageName", Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED)
+ .withHyperVGeneration(HyperVGeneration.V1)
+ .withIdentifier(
+ new GalleryImageIdentifier()
+ .withPublisher("myPublisherName")
+ .withOffer("myOfferName")
+ .withSku("mySkuName"))
+ .apply();
+ }
+}
+```
+
+### GallerySharingProfile_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.SharingUpdateInner;
+import com.azure.resourcemanager.compute.generated.models.SharingProfileGroup;
+import com.azure.resourcemanager.compute.generated.models.SharingProfileGroupTypes;
+import com.azure.resourcemanager.compute.generated.models.SharingUpdateOperationTypes;
+import java.util.Arrays;
+
+/** Samples for GallerySharingProfile Update. */
+public final class GallerySharingProfileUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ResetSharingProfileInAGallery.json
+ */
+ /**
+ * Sample code: reset sharing profile of a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void resetSharingProfileOfAGallery(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .gallerySharingProfiles()
+ .update(
+ "myResourceGroup",
+ "myGalleryName",
+ new SharingUpdateInner().withOperationType(SharingUpdateOperationTypes.RESET),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/AddToSharingProfileInAGallery.json
+ */
+ /**
+ * Sample code: Add sharing id to the sharing profile of a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void addSharingIdToTheSharingProfileOfAGallery(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .gallerySharingProfiles()
+ .update(
+ "myResourceGroup",
+ "myGalleryName",
+ new SharingUpdateInner()
+ .withOperationType(SharingUpdateOperationTypes.ADD)
+ .withGroups(
+ Arrays
+ .asList(
+ new SharingProfileGroup()
+ .withType(SharingProfileGroupTypes.SUBSCRIPTIONS)
+ .withIds(
+ Arrays
+ .asList(
+ "34a4ab42-0d72-47d9-bd1a-aed207386dac",
+ "380fd389-260b-41aa-bad9-0a83108c370b")),
+ new SharingProfileGroup()
+ .withType(SharingProfileGroupTypes.AADTENANTS)
+ .withIds(Arrays.asList("c24c76aa-8897-4027-9b03-8f7928b54ff6")))),
+ Context.NONE);
+ }
+}
+```
+
+### Images_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters;
+import com.azure.resourcemanager.compute.generated.models.ImageDataDisk;
+import com.azure.resourcemanager.compute.generated.models.ImageOSDisk;
+import com.azure.resourcemanager.compute.generated.models.ImageStorageProfile;
+import com.azure.resourcemanager.compute.generated.models.OperatingSystemStateTypes;
+import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes;
+import java.util.Arrays;
+
+/** Samples for Images CreateOrUpdate. */
+public final class ImagesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromASnapshot.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a snapshot.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVirtualMachineImageFromASnapshot(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .images()
+ .define("myImage")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withSnapshot(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withZoneResilient(false))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAManagedDisk.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a managed disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVirtualMachineImageFromAManagedDisk(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .images()
+ .define("myImage")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withManagedDisk(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withZoneResilient(true))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromABlobWithDiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a blob with DiskEncryptionSet resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .images()
+ .define("myImage")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED)))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAManagedDiskWithDiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a managed disk with DiskEncryptionSet resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .images()
+ .define("myImage")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withManagedDisk(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"))
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED)))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromABlob.json
+ */
+ /**
+ * Sample code: Create a virtual machine image that includes a data disk from a blob.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVirtualMachineImageThatIncludesADataDiskFromABlob(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .images()
+ .define("myImage")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new ImageDataDisk()
+ .withBlobUri(
+ "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd")
+ .withLun(1)))
+ .withZoneResilient(false))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromASnapshotWithDiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a snapshot with DiskEncryptionSet resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .images()
+ .define("myImage")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withSnapshot(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED)))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromASnapshot.json
+ */
+ /**
+ * Sample code: Create a virtual machine image that includes a data disk from a snapshot.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVirtualMachineImageThatIncludesADataDiskFromASnapshot(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .images()
+ .define("myImage")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withSnapshot(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new ImageDataDisk()
+ .withSnapshot(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"))
+ .withLun(1)))
+ .withZoneResilient(true))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromABlob.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a blob.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVirtualMachineImageFromABlob(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .images()
+ .define("myImage")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withZoneResilient(true))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageFromAVM.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from an existing virtual machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVirtualMachineImageFromAnExistingVirtualMachine(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .images()
+ .define("myImage")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSourceVirtualMachine(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnImageThatIncludesADataDiskFromAManagedDisk.json
+ */
+ /**
+ * Sample code: Create a virtual machine image that includes a data disk from a managed disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .images()
+ .define("myImage")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withManagedDisk(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new ImageDataDisk()
+ .withManagedDisk(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"))
+ .withLun(1)))
+ .withZoneResilient(false))
+ .create();
+ }
+}
+```
+
+### Images_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Images Delete. */
+public final class ImagesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: Images_Delete_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void imagesDeleteMinimumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.images().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Images_Delete_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: Images_Delete_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void imagesDeleteMaximumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.images().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### Images_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Images GetByResourceGroup. */
+public final class ImagesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetInformationAboutAnImage.json
+ */
+ /**
+ * Sample code: Get information about a virtual machine image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getInformationAboutAVirtualMachineImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.images().getByResourceGroupWithResponse("myResourceGroup", "myImage", null, Context.NONE);
+ }
+}
+```
+
+### Images_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Images List. */
+public final class ImagesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInASubscription.json
+ */
+ /**
+ * Sample code: List all virtual machine images in a subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllVirtualMachineImagesInASubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.images().list(Context.NONE);
+ }
+}
+```
+
+### Images_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Images ListByResourceGroup. */
+public final class ImagesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListImagesInAResourceGroup.json
+ */
+ /**
+ * Sample code: List all virtual machine images in a resource group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllVirtualMachineImagesInAResourceGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.images().listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
+```
+
+### Images_Update
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.HyperVGenerationTypes;
+import com.azure.resourcemanager.compute.generated.models.Image;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Images Update. */
+public final class ImagesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateImage.json
+ */
+ /**
+ * Sample code: Updates tags of an Image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updatesTagsOfAnImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ Image resource =
+ manager
+ .images()
+ .getByResourceGroupWithResponse("myResourceGroup", "myImage", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withTags(mapOf("department", "HR"))
+ .withSourceVirtualMachine(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))
+ .withHyperVGeneration(HyperVGenerationTypes.V1)
+ .apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### LogAnalytics_ExportRequestRateByInterval
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.IntervalInMins;
+import com.azure.resourcemanager.compute.generated.models.RequestRateByIntervalInput;
+import java.time.OffsetDateTime;
+
+/** Samples for LogAnalytics ExportRequestRateByInterval. */
+public final class LogAnalyticsExportRequestRateByIntervalSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsRequestRateByInterval.json
+ */
+ /**
+ * Sample code: Export logs which contain all Api requests made to Compute Resource Provider within the given time
+ * period broken down by intervals.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void
+ exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .logAnalytics()
+ .exportRequestRateByInterval(
+ "westus",
+ new RequestRateByIntervalInput()
+ .withBlobContainerSasUri("https://somesasuri")
+ .withFromTime(OffsetDateTime.parse("2018-01-21T01:54:06.862601Z"))
+ .withToTime(OffsetDateTime.parse("2018-01-23T01:54:06.862601Z"))
+ .withGroupByResourceName(true)
+ .withIntervalLength(IntervalInMins.FIVE_MINS),
+ Context.NONE);
+ }
+}
+```
+
+### LogAnalytics_ExportThrottledRequests
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.ThrottledRequestsInput;
+import java.time.OffsetDateTime;
+
+/** Samples for LogAnalytics ExportThrottledRequests. */
+public final class LogAnalyticsExportThrottledRequestsSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/LogAnalyticsThrottledRequests.json
+ */
+ /**
+ * Sample code: Export logs which contain all throttled Api requests made to Compute Resource Provider within the
+ * given time period.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void
+ exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .logAnalytics()
+ .exportThrottledRequests(
+ "westus",
+ new ThrottledRequestsInput()
+ .withBlobContainerSasUri("https://somesasuri")
+ .withFromTime(OffsetDateTime.parse("2018-01-21T01:54:06.862601Z"))
+ .withToTime(OffsetDateTime.parse("2018-01-23T01:54:06.862601Z"))
+ .withGroupByOperationName(true)
+ .withGroupByResourceName(false)
+ .withGroupByClientApplicationId(false)
+ .withGroupByUserAgent(false),
+ Context.NONE);
+ }
+}
+```
+
+### Operations_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Operations List. */
+public final class OperationsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: Operations_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void operationsListMinimumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.operations().list(Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Operations_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: Operations_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void operationsListMaximumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.operations().list(Context.NONE);
+ }
+}
+```
+
+### ProximityPlacementGroups_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroupType;
+
+/** Samples for ProximityPlacementGroups CreateOrUpdate. */
+public final class ProximityPlacementGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAProximityPlacementGroup.json
+ */
+ /**
+ * Sample code: Create or Update a proximity placement group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateAProximityPlacementGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .proximityPlacementGroups()
+ .define("myProximityPlacementGroup")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withProximityPlacementGroupType(ProximityPlacementGroupType.STANDARD)
+ .create();
+ }
+}
+```
+
+### ProximityPlacementGroups_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ProximityPlacementGroups Delete. */
+public final class ProximityPlacementGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteAProximityPlacementGroup.json
+ */
+ /**
+ * Sample code: Create a proximity placement group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAProximityPlacementGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .proximityPlacementGroups()
+ .deleteWithResponse("myResourceGroup", "myProximityPlacementGroup", Context.NONE);
+ }
+}
+```
+
+### ProximityPlacementGroups_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ProximityPlacementGroups GetByResourceGroup. */
+public final class ProximityPlacementGroupsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAProximityPlacementGroup.json
+ */
+ /**
+ * Sample code: Create a proximity placement group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAProximityPlacementGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .proximityPlacementGroups()
+ .getByResourceGroupWithResponse("myResourceGroup", "myProximityPlacementGroup", null, Context.NONE);
+ }
+}
+```
+
+### ProximityPlacementGroups_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ProximityPlacementGroups List. */
+public final class ProximityPlacementGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInASubscription.json
+ */
+ /**
+ * Sample code: Create a proximity placement group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAProximityPlacementGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.proximityPlacementGroups().list(Context.NONE);
+ }
+}
+```
+
+### ProximityPlacementGroups_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ProximityPlacementGroups ListByResourceGroup. */
+public final class ProximityPlacementGroupsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListProximityPlacementGroupsInAResourceGroup.json
+ */
+ /**
+ * Sample code: Create a proximity placement group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAProximityPlacementGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.proximityPlacementGroups().listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
+```
+
+### ProximityPlacementGroups_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroup;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ProximityPlacementGroups Update. */
+public final class ProximityPlacementGroupsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/PatchAProximityPlacementGroup.json
+ */
+ /**
+ * Sample code: Create a proximity placement group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAProximityPlacementGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ ProximityPlacementGroup resource =
+ manager
+ .proximityPlacementGroups()
+ .getByResourceGroupWithResponse("myResourceGroup", "myProximityPlacementGroup", null, Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("additionalProp1", "string")).apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### ResourceSkus_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for ResourceSkus List. */
+public final class ResourceSkusListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json
+ */
+ /**
+ * Sample code: Lists all available Resource SKUs.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listsAllAvailableResourceSKUs(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.resourceSkus().list(null, null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json
+ */
+ /**
+ * Sample code: Lists all available Resource SKUs for the specified region.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listsAllAvailableResourceSKUsForTheSpecifiedRegion(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.resourceSkus().list("location eq 'westus'", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json
+ */
+ /**
+ * Sample code: Lists all available Resource SKUs with Extended Location information.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listsAllAvailableResourceSKUsWithExtendedLocationInformation(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.resourceSkus().list(null, "true", Context.NONE);
+ }
+}
+```
+
+### RestorePointCollections_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionSourceProperties;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for RestorePointCollections CreateOrUpdate. */
+public final class RestorePointCollectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateARestorePointCollectionForCrossRegionCopy.json
+ */
+ /**
+ * Sample code: Create or update a restore point collection for cross region copy.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateARestorePointCollectionForCrossRegionCopy(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .restorePointCollections()
+ .define("myRpc")
+ .withRegion("norwayeast")
+ .withExistingResourceGroup("myResourceGroup")
+ .withTags(mapOf("myTag1", "tagValue1"))
+ .withSource(
+ new RestorePointCollectionSourceProperties()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateARestorePointCollection.json
+ */
+ /**
+ * Sample code: Create or update a restore point collection.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateARestorePointCollection(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .restorePointCollections()
+ .define("myRpc")
+ .withRegion("norwayeast")
+ .withExistingResourceGroup("myResourceGroup")
+ .withTags(mapOf("myTag1", "tagValue1"))
+ .withSource(
+ new RestorePointCollectionSourceProperties()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### RestorePointCollections_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RestorePointCollections Delete. */
+public final class RestorePointCollectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: RestorePointCollections_Delete_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void restorePointCollectionsDeleteMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.restorePointCollections().delete("rgcompute", "aaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Delete_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: RestorePointCollections_Delete_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void restorePointCollectionsDeleteMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.restorePointCollections().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### RestorePointCollections_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RestorePointCollections GetByResourceGroup. */
+public final class RestorePointCollectionsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionWithContainedRestorePoints.json
+ */
+ /**
+ * Sample code: Get a restore point collection, including the restore points contained in the restore point
+ * collection.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .restorePointCollections()
+ .getByResourceGroupWithResponse("myResourceGroup", "rpcName", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollection.json
+ */
+ /**
+ * Sample code: Get a restore point collection (but not the restore points contained in the restore point
+ * collection).
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .restorePointCollections()
+ .getByResourceGroupWithResponse("myResourceGroup", "myRpc", null, Context.NONE);
+ }
+}
+```
+
+### RestorePointCollections_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RestorePointCollections List. */
+public final class RestorePointCollectionsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInASubscription.json
+ */
+ /**
+ * Sample code: Gets the list of restore point collections in a subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getsTheListOfRestorePointCollectionsInASubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.restorePointCollections().list(Context.NONE);
+ }
+}
+```
+
+### RestorePointCollections_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RestorePointCollections ListByResourceGroup. */
+public final class RestorePointCollectionsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointCollectionsInAResourceGroup.json
+ */
+ /**
+ * Sample code: Gets the list of restore point collections in a resource group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getsTheListOfRestorePointCollectionsInAResourceGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.restorePointCollections().listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
+```
+
+### RestorePointCollections_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.RestorePointCollection;
+import com.azure.resourcemanager.compute.generated.models.RestorePointCollectionSourceProperties;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for RestorePointCollections Update. */
+public final class RestorePointCollectionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: RestorePointCollections_Update_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void restorePointCollectionsUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ RestorePointCollection resource =
+ manager
+ .restorePointCollections()
+ .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaa", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withTags(mapOf("key8536", "aaaaaaaaaaaaaaaaaaa"))
+ .withSource(
+ new RestorePointCollectionSourceProperties()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePointCollections_Update_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: RestorePointCollections_Update_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void restorePointCollectionsUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ RestorePointCollection resource =
+ manager
+ .restorePointCollections()
+ .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaa", null, Context.NONE)
+ .getValue();
+ resource.update().apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### RestorePoints_Create
+
+```java
+import com.azure.resourcemanager.compute.generated.models.ApiEntityReference;
+import java.util.Arrays;
+
+/** Samples for RestorePoints Create. */
+public final class RestorePointsCreateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CopyRestorePointBetweenRegions.json
+ */
+ /**
+ * Sample code: Copy a restore point to a different region.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void copyARestorePointToADifferentRegion(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .restorePoints()
+ .define("rpName")
+ .withExistingRestorePointCollection("myResourceGroup", "rpcName")
+ .withSourceRestorePoint(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateARestorePoint.json
+ */
+ /**
+ * Sample code: Create a restore point.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createARestorePoint(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .restorePoints()
+ .define("rpName")
+ .withExistingRestorePointCollection("myResourceGroup", "rpcName")
+ .withExcludeDisks(
+ Arrays
+ .asList(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123")))
+ .create();
+ }
+}
+```
+
+### RestorePoints_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RestorePoints Delete. */
+public final class RestorePointsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: RestorePoints_Delete_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void restorePointsDeleteMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.restorePoints().delete("rgcompute", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RestorePoints_Delete_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: RestorePoints_Delete_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void restorePointsDeleteMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.restorePoints().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", "a", Context.NONE);
+ }
+}
+```
+
+### RestorePoints_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for RestorePoints Get. */
+public final class RestorePointsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePoint.json
+ */
+ /**
+ * Sample code: Get a restore point.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getARestorePoint(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.restorePoints().getWithResponse("myResourceGroup", "rpcName", "rpName", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetRestorePointWithInstanceView.json
+ */
+ /**
+ * Sample code: Get restore point with instance view.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getRestorePointWithInstanceView(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.restorePoints().getWithResponse("myResourceGroup", "rpcName", "rpName", null, Context.NONE);
+ }
+}
+```
+
+### SharedGalleries_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleries Get. */
+public final class SharedGalleriesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGallery.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.sharedGalleries().getWithResponse("myLocation", "galleryUniqueName", Context.NONE);
+ }
+}
+```
+
+### SharedGalleries_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleries List. */
+public final class SharedGalleriesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleries.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.sharedGalleries().list("myLocation", null, Context.NONE);
+ }
+}
+```
+
+### SharedGalleryImageVersions_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleryImageVersions Get. */
+public final class SharedGalleryImageVersionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .sharedGalleryImageVersions()
+ .getWithResponse(
+ "myLocation", "galleryUniqueName", "myGalleryImageName", "myGalleryImageVersionName", Context.NONE);
+ }
+}
+```
+
+### SharedGalleryImageVersions_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleryImageVersions List. */
+public final class SharedGalleryImageVersionsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImageVersions.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .sharedGalleryImageVersions()
+ .list("myLocation", "galleryUniqueName", "myGalleryImageName", null, Context.NONE);
+ }
+}
+```
+
+### SharedGalleryImages_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleryImages Get. */
+public final class SharedGalleryImagesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImage.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .sharedGalleryImages()
+ .getWithResponse("myLocation", "galleryUniqueName", "myGalleryImageName", Context.NONE);
+ }
+}
+```
+
+### SharedGalleryImages_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleryImages List. */
+public final class SharedGalleryImagesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImages.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAGallery(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.sharedGalleryImages().list("myLocation", "galleryUniqueName", null, Context.NONE);
+ }
+}
+```
+
+### Snapshots_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.CreationData;
+import com.azure.resourcemanager.compute.generated.models.DiskCreateOption;
+
+/** Samples for Snapshots CreateOrUpdate. */
+public final class SnapshotsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateASnapshotFromAnExistingSnapshot.json
+ */
+ /**
+ * Sample code: Create a snapshot from an existing snapshot in the same or a different subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .snapshots()
+ .define("mySnapshot2")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.COPY)
+ .withSourceResourceId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateASnapshotFromAnExistingSnapshotInDifferentRegion.json
+ */
+ /**
+ * Sample code: Create a snapshot from an existing snapshot in the same or a different subscription in a different
+ * region.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .snapshots()
+ .define("mySnapshot2")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.COPY_START)
+ .withSourceResourceId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription.json
+ */
+ /**
+ * Sample code: Create a snapshot by importing an unmanaged blob from the same subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .snapshots()
+ .define("mySnapshot1")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.IMPORT)
+ .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription.json
+ */
+ /**
+ * Sample code: Create a snapshot by importing an unmanaged blob from a different subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .snapshots()
+ .define("mySnapshot1")
+ .withRegion("West US")
+ .withExistingResourceGroup("myResourceGroup")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.IMPORT)
+ .withStorageAccountId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")
+ .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"))
+ .create();
+ }
+}
+```
+
+### Snapshots_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots Delete. */
+public final class SnapshotsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/DeleteASnapshot.json
+ */
+ /**
+ * Sample code: Delete a snapshot.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.snapshots().delete("myResourceGroup", "mySnapshot", Context.NONE);
+ }
+}
+```
+
+### Snapshots_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots GetByResourceGroup. */
+public final class SnapshotsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/GetInformationAboutASnapshot.json
+ */
+ /**
+ * Sample code: Get information about a snapshot.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getInformationAboutASnapshot(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.snapshots().getByResourceGroupWithResponse("myResourceGroup", "mySnapshot", Context.NONE);
+ }
+}
+```
+
+### Snapshots_GrantAccess
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.AccessLevel;
+import com.azure.resourcemanager.compute.generated.models.GrantAccessData;
+
+/** Samples for Snapshots GrantAccess. */
+public final class SnapshotsGrantAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/BeginGetAccessSnapshot.json
+ */
+ /**
+ * Sample code: Get a sas on a snapshot.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getASasOnASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .snapshots()
+ .grantAccess(
+ "myResourceGroup",
+ "mySnapshot",
+ new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300),
+ Context.NONE);
+ }
+}
+```
+
+### Snapshots_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots List. */
+public final class SnapshotsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListSnapshotsInASubscription.json
+ */
+ /**
+ * Sample code: List all snapshots in a subscription.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllSnapshotsInASubscription(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.snapshots().list(Context.NONE);
+ }
+}
+```
+
+### Snapshots_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots ListByResourceGroup. */
+public final class SnapshotsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/ListSnapshotsInAResourceGroup.json
+ */
+ /**
+ * Sample code: List all snapshots in a resource group.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listAllSnapshotsInAResourceGroup(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.snapshots().listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
+```
+
+### Snapshots_RevokeAccess
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots RevokeAccess. */
+public final class SnapshotsRevokeAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/EndGetAccessSnapshot.json
+ */
+ /**
+ * Sample code: Revoke access to a snapshot.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void revokeAccessToASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.snapshots().revokeAccess("myResourceGroup", "mySnapshot", Context.NONE);
+ }
+}
+```
+
+### Snapshots_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.Snapshot;
+import com.azure.resourcemanager.compute.generated.models.SupportedCapabilities;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Snapshots Update. */
+public final class SnapshotsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateASnapshotWithAcceleratedNetwork.json
+ */
+ /**
+ * Sample code: Update a snapshot with accelerated networking.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateASnapshotWithAcceleratedNetworking(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ Snapshot resource =
+ manager
+ .snapshots()
+ .getByResourceGroupWithResponse("myResourceGroup", "mySnapshot", Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withTags(mapOf("department", "Development", "project", "UpdateSnapshots"))
+ .withDiskSizeGB(20)
+ .withSupportedCapabilities(new SupportedCapabilities().withAcceleratedNetwork(false))
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-08-01/examples/UpdateASnapshot.json
+ */
+ /**
+ * Sample code: Update a snapshot.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateASnapshot(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ Snapshot resource =
+ manager
+ .snapshots()
+ .getByResourceGroupWithResponse("myResourceGroup", "mySnapshot", Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withTags(mapOf("department", "Development", "project", "UpdateSnapshots"))
+ .withDiskSizeGB(20)
+ .apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### SshPublicKeys_Create
+
+```java
+/** Samples for SshPublicKeys Create. */
+public final class SshPublicKeysCreateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAnSshPublicKey.json
+ */
+ /**
+ * Sample code: Create a new SSH public key resource.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createANewSSHPublicKeyResource(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .sshPublicKeys()
+ .define("mySshPublicKeyName")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withPublicKey("{ssh-rsa public key}")
+ .create();
+ }
+}
+```
+
+### SshPublicKeys_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SshPublicKeys Delete. */
+public final class SshPublicKeysDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: SshPublicKeys_Delete_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void sshPublicKeysDeleteMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.sshPublicKeys().deleteWithResponse("rgcompute", "aaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Delete_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: SshPublicKeys_Delete_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void sshPublicKeysDeleteMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.sshPublicKeys().deleteWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### SshPublicKeys_GenerateKeyPair
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SshPublicKeys GenerateKeyPair. */
+public final class SshPublicKeysGenerateKeyPairSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GenerateSshKeyPair.json
+ */
+ /**
+ * Sample code: Generate an SSH key pair.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void generateAnSSHKeyPair(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.sshPublicKeys().generateKeyPairWithResponse("myResourceGroup", "mySshPublicKeyName", Context.NONE);
+ }
+}
+```
+
+### SshPublicKeys_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SshPublicKeys GetByResourceGroup. */
+public final class SshPublicKeysGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetAnSshPublicKey.json
+ */
+ /**
+ * Sample code: Get an ssh public key.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAnSshPublicKey(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.sshPublicKeys().getByResourceGroupWithResponse("myResourceGroup", "mySshPublicKeyName", Context.NONE);
+ }
+}
+```
+
+### SshPublicKeys_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SshPublicKeys List. */
+public final class SshPublicKeysListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: SshPublicKeys_ListBySubscription_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void sshPublicKeysListBySubscriptionMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.sshPublicKeys().list(Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListBySubscription_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: SshPublicKeys_ListBySubscription_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void sshPublicKeysListBySubscriptionMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.sshPublicKeys().list(Context.NONE);
+ }
+}
+```
+
+### SshPublicKeys_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for SshPublicKeys ListByResourceGroup. */
+public final class SshPublicKeysListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: SshPublicKeys_ListByResourceGroup_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void sshPublicKeysListByResourceGroupMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.sshPublicKeys().listByResourceGroup("rgcompute", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_ListByResourceGroup_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: SshPublicKeys_ListByResourceGroup_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void sshPublicKeysListByResourceGroupMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.sshPublicKeys().listByResourceGroup("rgcompute", Context.NONE);
+ }
+}
+```
+
+### SshPublicKeys_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.SshPublicKeyResource;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for SshPublicKeys Update. */
+public final class SshPublicKeysUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: SshPublicKeys_Update_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void sshPublicKeysUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ SshPublicKeyResource resource =
+ manager
+ .sshPublicKeys()
+ .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaa", Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("key2854", "a")).withPublicKey("{ssh-rsa public key}").apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SshPublicKeys_Update_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: SshPublicKeys_Update_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void sshPublicKeysUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ SshPublicKeyResource resource =
+ manager.sshPublicKeys().getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaa", Context.NONE).getValue();
+ resource.update().apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### Usage_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for Usage List. */
+public final class UsageListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: Usage_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void usageListMinimumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.usages().list("_--", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/Usage_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: Usage_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void usageListMaximumSetGen(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.usages().list("4_.", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineExtensionImages_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineExtensionImages Get. */
+public final class VirtualMachineExtensionImagesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensionImages_Get_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionImagesGetMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineExtensionImages()
+ .getWithResponse(
+ "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_Get_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensionImages_Get_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionImagesGetMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineExtensionImages()
+ .getWithResponse("aaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aa", "aaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineExtensionImages_ListTypes
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineExtensionImages ListTypes. */
+public final class VirtualMachineExtensionImagesListTypesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensionImages_ListTypes_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionImagesListTypesMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineExtensionImages()
+ .listTypesWithResponse("aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListTypes_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensionImages_ListTypes_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionImagesListTypesMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineExtensionImages().listTypesWithResponse("aaaa", "aa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineExtensionImages_ListVersions
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineExtensionImages ListVersions. */
+public final class VirtualMachineExtensionImagesListVersionsSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensionImages_ListVersions_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionImagesListVersionsMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineExtensionImages()
+ .listVersionsWithResponse(
+ "aaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaa",
+ 22,
+ "a",
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensionImages_ListVersions_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensionImages_ListVersions_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionImagesListVersionsMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineExtensionImages()
+ .listVersionsWithResponse(
+ "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaa", null, null, null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineExtensions_CreateOrUpdate
+
+```java
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.compute.generated.models.InstanceViewStatus;
+import com.azure.resourcemanager.compute.generated.models.StatusLevelTypes;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionInstanceView;
+import java.io.IOException;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualMachineExtensions CreateOrUpdate. */
+public final class VirtualMachineExtensionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensions_CreateOrUpdate_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionsCreateOrUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineExtensions()
+ .define("aaaaaaaaaaaaaaaaaaaaaaaa")
+ .withRegion("westus")
+ .withExistingVirtualMachine("rgcompute", "aaaa")
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_CreateOrUpdate_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensions_CreateOrUpdate_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionsCreateOrUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException {
+ manager
+ .virtualMachineExtensions()
+ .define("aaaaaaaaaaaaa")
+ .withRegion("westus")
+ .withExistingVirtualMachine("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa")
+ .withTags(mapOf("key9183", "aa"))
+ .withForceUpdateTag("a")
+ .withPublisher("extPublisher")
+ .withTypePropertiesType("extType")
+ .withTypeHandlerVersion("1.2")
+ .withAutoUpgradeMinorVersion(true)
+ .withEnableAutomaticUpgrade(true)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))
+ .withProtectedSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))
+ .withInstanceView(
+ new VirtualMachineExtensionInstanceView()
+ .withName("aaaaaaaaaaaaaaaaa")
+ .withType("aaaaaaaaa")
+ .withTypeHandlerVersion("aaaaaaaaaaaaaaaaaaaaaaaaaa")
+ .withSubstatuses(
+ Arrays
+ .asList(
+ new InstanceViewStatus()
+ .withCode("aaaaaaaaaaaaaaaaaaaaaaa")
+ .withLevel(StatusLevelTypes.INFO)
+ .withDisplayStatus("aaaaaa")
+ .withMessage("a")
+ .withTime(OffsetDateTime.parse("2021-11-30T12:58:26.522Z"))))
+ .withStatuses(
+ Arrays
+ .asList(
+ new InstanceViewStatus()
+ .withCode("aaaaaaaaaaaaaaaaaaaaaaa")
+ .withLevel(StatusLevelTypes.INFO)
+ .withDisplayStatus("aaaaaa")
+ .withMessage("a")
+ .withTime(OffsetDateTime.parse("2021-11-30T12:58:26.522Z")))))
+ .withSuppressFailures(true)
+ .create();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualMachineExtensions_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineExtensions Delete. */
+public final class VirtualMachineExtensionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensions_Delete_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionsDeleteMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineExtensions()
+ .delete("rgcompute", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Delete_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensions_Delete_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionsDeleteMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineExtensions().delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineExtensions_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineExtensions Get. */
+public final class VirtualMachineExtensionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensions_Get_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionsGetMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineExtensions()
+ .getWithResponse("rgcompute", "a", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_Get_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensions_Get_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionsGetMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineExtensions()
+ .getWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", "aaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineExtensions_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineExtensions List. */
+public final class VirtualMachineExtensionsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensions_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionsListMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineExtensions()
+ .listWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineExtensions_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineExtensions_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineExtensionsListMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineExtensions()
+ .listWithResponse("rgcompute", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineExtensions_Update
+
+```java
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtension;
+import java.io.IOException;
+
+/** Samples for VirtualMachineExtensions Update. */
+public final class VirtualMachineExtensionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMExtension.json
+ */
+ /**
+ * Sample code: Update VM extension.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateVMExtension(com.azure.resourcemanager.compute.generated.ComputeManager manager)
+ throws IOException {
+ VirtualMachineExtension resource =
+ manager
+ .virtualMachineExtensions()
+ .getWithResponse("myResourceGroup", "myVM", "myVMExtension", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withPublisher("extPublisher")
+ .withType("extType")
+ .withTypeHandlerVersion("1.2")
+ .withAutoUpgradeMinorVersion(true)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON))
+ .withSuppressFailures(true)
+ .withProtectedSettingsFromKeyVault(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize(
+ "{\"secretUrl\":\"https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e\",\"sourceVault\":{\"id\":\"/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName\"}}",
+ Object.class,
+ SerializerEncoding.JSON))
+ .apply();
+ }
+}
+```
+
+### VirtualMachineImages_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineImages Get. */
+public final class VirtualMachineImagesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImages_Get_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesGetMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImages()
+ .getWithResponse(
+ "aaaaaaaaaaaa", "aaaaaaaaaaa", "aa", "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_Get_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImages_Get_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesGetMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImages()
+ .getWithResponse(
+ "aaaaaa",
+ "aaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaa",
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineImages_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineImages List. */
+public final class VirtualMachineImagesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImages_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesListMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImages()
+ .listWithResponse("aaaaaaa", "aaaaaaaaaaa", "aaaaaaaaaa", "aaaaaa", null, null, null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImages_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesListMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImages()
+ .listWithResponse(
+ "aaaaaaaaaaaaaaa",
+ "aaaaaa",
+ "aaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaa",
+ 18,
+ "aa",
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineImages_ListOffers
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineImages ListOffers. */
+public final class VirtualMachineImagesListOffersSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImages_ListOffers_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesListOffersMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineImages().listOffersWithResponse("aaaaaaa", "aaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListOffers_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImages_ListOffers_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesListOffersMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImages()
+ .listOffersWithResponse("aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineImages_ListPublishers
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineImages ListPublishers. */
+public final class VirtualMachineImagesListPublishersSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImages_ListPublishers_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesListPublishersMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineImages().listPublishersWithResponse("aaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListPublishers_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImages_ListPublishers_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesListPublishersMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineImages().listPublishersWithResponse("aaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineImages_ListSkus
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineImages ListSkus. */
+public final class VirtualMachineImagesListSkusSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImages_ListSkus_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesListSkusMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineImages().listSkusWithResponse("aaaa", "aaaaaaaaaaaaa", "aaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImages_ListSkus_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImages_ListSkus_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesListSkusMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImages()
+ .listSkusWithResponse("aaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineImagesEdgeZone_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineImagesEdgeZone Get. */
+public final class VirtualMachineImagesEdgeZoneGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesEdgeZoneGetMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImagesEdgeZones()
+ .getWithResponse(
+ "aaaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesEdgeZoneGetMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImagesEdgeZones()
+ .getWithResponse(
+ "aaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaa",
+ "aa",
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineImagesEdgeZone_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineImagesEdgeZone List. */
+public final class VirtualMachineImagesEdgeZoneListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesEdgeZoneListMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImagesEdgeZones()
+ .listWithResponse(
+ "aaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaa",
+ 12,
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesEdgeZoneListMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImagesEdgeZones()
+ .listWithResponse(
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaa",
+ "aaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ null,
+ null,
+ null,
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineImagesEdgeZone_ListOffers
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineImagesEdgeZone ListOffers. */
+public final class VirtualMachineImagesEdgeZoneListOffersSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesEdgeZoneListOffersMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImagesEdgeZones()
+ .listOffersWithResponse("aaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesEdgeZoneListOffersMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImagesEdgeZones()
+ .listOffersWithResponse(
+ "aaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineImagesEdgeZone_ListPublishers
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineImagesEdgeZone ListPublishers. */
+public final class VirtualMachineImagesEdgeZoneListPublishersSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesEdgeZoneListPublishersMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImagesEdgeZones()
+ .listPublishersWithResponse("aaaa", "aaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesEdgeZoneListPublishersMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImagesEdgeZones()
+ .listPublishersWithResponse("aaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineImagesEdgeZone_ListSkus
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineImagesEdgeZone ListSkus. */
+public final class VirtualMachineImagesEdgeZoneListSkusSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesEdgeZoneListSkusMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImagesEdgeZones()
+ .listSkusWithResponse("aaaaaaaaaaaa", "aaaaa", "aaaaaaaaaaaa", "aaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineImagesEdgeZoneListSkusMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineImagesEdgeZones()
+ .listSkusWithResponse(
+ "aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaa", "aaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineRunCommands_CreateOrUpdate
+
+```java
+import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineRunCommands CreateOrUpdate. */
+public final class VirtualMachineRunCommandsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateRunCommand.json
+ */
+ /**
+ * Sample code: Create or update a run command.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineRunCommands()
+ .define("myRunCommand")
+ .withRegion("West US")
+ .withExistingVirtualMachine("myResourceGroup", "myVM")
+ .withSource(new VirtualMachineRunCommandScriptSource().withScript("Write-Host Hello World!"))
+ .withParameters(
+ Arrays
+ .asList(
+ new RunCommandInputParameter().withName("param1").withValue("value1"),
+ new RunCommandInputParameter().withName("param2").withValue("value2")))
+ .withAsyncExecution(false)
+ .withRunAsUser("user1")
+ .withRunAsPassword("")
+ .withTimeoutInSeconds(3600)
+ .create();
+ }
+}
+```
+
+### VirtualMachineRunCommands_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineRunCommands Delete. */
+public final class VirtualMachineRunCommandsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteRunCommand.json
+ */
+ /**
+ * Sample code: Delete a run command.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineRunCommands().delete("myResourceGroup", "myVM", "myRunCommand", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineRunCommands_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineRunCommands Get. */
+public final class VirtualMachineRunCommandsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandGet.json
+ */
+ /**
+ * Sample code: VirtualMachineRunCommandGet.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineRunCommandGet(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineRunCommands().getWithResponse("SoutheastAsia", "RunPowerShellScript", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineRunCommands_GetByVirtualMachine
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineRunCommands GetByVirtualMachine. */
+public final class VirtualMachineRunCommandsGetByVirtualMachineSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetRunCommand.json
+ */
+ /**
+ * Sample code: Get a run command.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineRunCommands()
+ .getByVirtualMachineWithResponse("myResourceGroup", "myVM", "myRunCommand", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineRunCommands_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineRunCommands List. */
+public final class VirtualMachineRunCommandsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommandList.json
+ */
+ /**
+ * Sample code: VirtualMachineRunCommandList.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineRunCommandList(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineRunCommands().list("SoutheastAsia", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineRunCommands_ListByVirtualMachine
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineRunCommands ListByVirtualMachine. */
+public final class VirtualMachineRunCommandsListByVirtualMachineSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListRunCommandsInVM.json
+ */
+ /**
+ * Sample code: List run commands in a Virtual Machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listRunCommandsInAVirtualMachine(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineRunCommands().listByVirtualMachine("myResourceGroup", "myVM", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineRunCommands_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommand;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource;
+
+/** Samples for VirtualMachineRunCommands Update. */
+public final class VirtualMachineRunCommandsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateRunCommand.json
+ */
+ /**
+ * Sample code: Update a run command.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateARunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ VirtualMachineRunCommand resource =
+ manager
+ .virtualMachineRunCommands()
+ .getByVirtualMachineWithResponse("myResourceGroup", "myVM", "myRunCommand", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withSource(new VirtualMachineRunCommandScriptSource().withScript("Write-Host Script Source Updated!"))
+ .apply();
+ }
+}
+```
+
+### VirtualMachineScaleSetExtensions_CreateOrUpdate
+
+```java
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerEncoding;
+import java.io.IOException;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSetExtensions CreateOrUpdate. */
+public final class VirtualMachineScaleSetExtensionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetExtensions_CreateOrUpdate_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetExtensionsCreateOrUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException {
+ manager
+ .virtualMachineScaleSetExtensions()
+ .define("aaaaaaaaaaaaaaaaaaaaa")
+ .withExistingVirtualMachineScaleSet("rgcompute", "aaaaaaa")
+ .withName("{extension-name}")
+ .withForceUpdateTag("aaaaaaaaa")
+ .withPublisher("{extension-Publisher}")
+ .withTypePropertiesType("{extension-Type}")
+ .withTypeHandlerVersion("{handler-version}")
+ .withAutoUpgradeMinorVersion(true)
+ .withEnableAutomaticUpgrade(true)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))
+ .withProtectedSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))
+ .withProvisionAfterExtensions(Arrays.asList("aa"))
+ .withSuppressFailures(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_CreateOrUpdate_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetExtensions_CreateOrUpdate_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetExtensionsCreateOrUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetExtensions()
+ .define("aaaaaaaaaaa")
+ .withExistingVirtualMachineScaleSet("rgcompute", "aaaaaaaaaaa")
+ .create();
+ }
+}
+```
+
+### VirtualMachineScaleSetExtensions_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetExtensions Delete. */
+public final class VirtualMachineScaleSetExtensionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetExtensions_Delete_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetExtensionsDeleteMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetExtensions()
+ .delete("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Delete_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetExtensions_Delete_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetExtensionsDeleteMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetExtensions().delete("rgcompute", "aaaa", "aaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetExtensions_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetExtensions Get. */
+public final class VirtualMachineScaleSetExtensionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetExtensions_Get_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetExtensionsGetMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetExtensions()
+ .getWithResponse("rgcompute", "a", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Get_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetExtensions_Get_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetExtensionsGetMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetExtensions()
+ .getWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaa", "aaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetExtensions_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetExtensions List. */
+public final class VirtualMachineScaleSetExtensionsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetExtensions_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetExtensionsListMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetExtensions().list("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetExtensions_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetExtensionsListMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetExtensions().list("rgcompute", "aaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetExtensions_Update
+
+```java
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtension;
+import java.io.IOException;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSetExtensions Update. */
+public final class VirtualMachineScaleSetExtensionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetExtensions_Update_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetExtensionsUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException {
+ VirtualMachineScaleSetExtension resource =
+ manager
+ .virtualMachineScaleSetExtensions()
+ .getWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaa", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withForceUpdateTag("aaaaaaaaa")
+ .withPublisher("{extension-Publisher}")
+ .withTypePropertiesType("{extension-Type}")
+ .withTypeHandlerVersion("{handler-version}")
+ .withAutoUpgradeMinorVersion(true)
+ .withEnableAutomaticUpgrade(true)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))
+ .withProtectedSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))
+ .withProvisionAfterExtensions(Arrays.asList("aa"))
+ .withSuppressFailures(true)
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetExtensions_Update_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetExtensions_Update_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetExtensionsUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ VirtualMachineScaleSetExtension resource =
+ manager
+ .virtualMachineScaleSetExtensions()
+ .getWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aa", null, Context.NONE)
+ .getValue();
+ resource.update().apply();
+ }
+}
+```
+
+### VirtualMachineScaleSetRollingUpgrades_Cancel
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetRollingUpgrades Cancel. */
+public final class VirtualMachineScaleSetRollingUpgradesCancelSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetRollingUpgrades_Cancel_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetRollingUpgradesCancelMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetRollingUpgrades().cancel("rgcompute", "aaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_Cancel_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetRollingUpgrades_Cancel_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetRollingUpgradesCancelMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetRollingUpgrades().cancel("rgcompute", "aaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetRollingUpgrades_GetLatest
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetRollingUpgrades GetLatest. */
+public final class VirtualMachineScaleSetRollingUpgradesGetLatestSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetRollingUpgrades_GetLatest_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetRollingUpgradesGetLatestMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetRollingUpgrades()
+ .getLatestWithResponse("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_GetLatest_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetRollingUpgrades_GetLatest_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetRollingUpgradesGetLatestMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetRollingUpgrades()
+ .getLatestWithResponse("rgcompute", "aaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetRollingUpgrades_StartExtensionUpgrade
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetRollingUpgrades StartExtensionUpgrade. */
+public final class VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VMScaleSetExtensionRollingUpgrade.json
+ */
+ /**
+ * Sample code: Start an extension rolling upgrade.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void startAnExtensionRollingUpgrade(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetRollingUpgrades()
+ .startExtensionUpgrade("myResourceGroup", "{vmss-name}", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetRollingUpgrades StartOSUpgrade. */
+public final class VirtualMachineScaleSetRollingUpgradesStartOSUpgradeSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetRollingUpgradesStartOSUpgradeMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetRollingUpgrades().startOSUpgrade("rgcompute", "aaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetRollingUpgradesStartOSUpgradeMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetRollingUpgrades().startOSUpgrade("rgcompute", "aaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMExtensions_CreateOrUpdate
+
+```java
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerEncoding;
+import java.io.IOException;
+
+/** Samples for VirtualMachineScaleSetVMExtensions CreateOrUpdate. */
+public final class VirtualMachineScaleSetVMExtensionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateVirtualMachineScaleSetVMExtensions.json
+ */
+ /**
+ * Sample code: Create VirtualMachineScaleSet VM extension.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createVirtualMachineScaleSetVMExtension(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException {
+ manager
+ .virtualMachineScaleSetVMExtensions()
+ .define("myVMExtension")
+ .withExistingVirtualMachine("myResourceGroup", "myvmScaleSet", "0")
+ .withPublisher("extPublisher")
+ .withTypePropertiesType("extType")
+ .withTypeHandlerVersion("1.2")
+ .withAutoUpgradeMinorVersion(true)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON))
+ .create();
+ }
+}
+```
+
+### VirtualMachineScaleSetVMExtensions_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMExtensions Delete. */
+public final class VirtualMachineScaleSetVMExtensionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/DeleteVirtualMachineScaleSetVMExtensions.json
+ */
+ /**
+ * Sample code: Delete VirtualMachineScaleSet VM extension.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteVirtualMachineScaleSetVMExtension(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMExtensions()
+ .delete("myResourceGroup", "myvmScaleSet", "0", "myVMExtension", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMExtensions_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMExtensions Get. */
+public final class VirtualMachineScaleSetVMExtensionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMExtensions.json
+ */
+ /**
+ * Sample code: Get VirtualMachineScaleSet VM extension.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getVirtualMachineScaleSetVMExtension(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMExtensions()
+ .getWithResponse("myResourceGroup", "myvmScaleSet", "0", "myVMExtension", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMExtensions_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMExtensions List. */
+public final class VirtualMachineScaleSetVMExtensionsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetVMExtensions.json
+ */
+ /**
+ * Sample code: List extensions in Vmss instance.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listExtensionsInVmssInstance(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMExtensions()
+ .listWithResponse("myResourceGroup", "myvmScaleSet", "0", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMExtensions_Update
+
+```java
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtension;
+import java.io.IOException;
+
+/** Samples for VirtualMachineScaleSetVMExtensions Update. */
+public final class VirtualMachineScaleSetVMExtensionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVirtualMachineScaleSetVMExtensions.json
+ */
+ /**
+ * Sample code: Update VirtualMachineScaleSet VM extension.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateVirtualMachineScaleSetVMExtension(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException {
+ VirtualMachineScaleSetVMExtension resource =
+ manager
+ .virtualMachineScaleSetVMExtensions()
+ .getWithResponse("myResourceGroup", "myvmScaleSet", "0", "myVMExtension", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withPublisher("extPublisher")
+ .withTypePropertiesType("extType")
+ .withTypeHandlerVersion("1.2")
+ .withAutoUpgradeMinorVersion(true)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON))
+ .apply();
+ }
+}
+```
+
+### VirtualMachineScaleSetVMRunCommands_CreateOrUpdate
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineRunCommandInner;
+import com.azure.resourcemanager.compute.generated.models.RunCommandInputParameter;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSetVMRunCommands CreateOrUpdate. */
+public final class VirtualMachineScaleSetVMRunCommandsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/CreateOrUpdateVirtualMachineScaleSetVMRunCommands.json
+ */
+ /**
+ * Sample code: Create VirtualMachineScaleSet VM run command.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createVirtualMachineScaleSetVMRunCommand(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMRunCommands()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myvmScaleSet",
+ "0",
+ "myRunCommand",
+ new VirtualMachineRunCommandInner()
+ .withLocation("West US")
+ .withSource(new VirtualMachineRunCommandScriptSource().withScript("Write-Host Hello World!"))
+ .withParameters(
+ Arrays
+ .asList(
+ new RunCommandInputParameter().withName("param1").withValue("value1"),
+ new RunCommandInputParameter().withName("param2").withValue("value2")))
+ .withAsyncExecution(false)
+ .withRunAsUser("user1")
+ .withRunAsPassword("")
+ .withTimeoutInSeconds(3600),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMRunCommands_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMRunCommands Delete. */
+public final class VirtualMachineScaleSetVMRunCommandsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/DeleteVirtualMachineScaleSetVMRunCommands.json
+ */
+ /**
+ * Sample code: Delete VirtualMachineScaleSet VM run command.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void deleteVirtualMachineScaleSetVMRunCommand(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMRunCommands()
+ .delete("myResourceGroup", "myvmScaleSet", "0", "myRunCommand", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMRunCommands_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMRunCommands Get. */
+public final class VirtualMachineScaleSetVMRunCommandsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/GetVirtualMachineScaleSetVMRunCommands.json
+ */
+ /**
+ * Sample code: Get VirtualMachineScaleSet VM run commands.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getVirtualMachineScaleSetVMRunCommands(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMRunCommands()
+ .getWithResponse("myResourceGroup", "myvmScaleSet", "0", "myRunCommand", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMRunCommands_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMRunCommands List. */
+public final class VirtualMachineScaleSetVMRunCommandsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/ListVirtualMachineScaleSetVMRunCommands.json
+ */
+ /**
+ * Sample code: List run commands in Vmss instance.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listRunCommandsInVmssInstance(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetVMRunCommands().list("myResourceGroup", "myvmScaleSet", "0", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMRunCommands_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandScriptSource;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommandUpdate;
+
+/** Samples for VirtualMachineScaleSetVMRunCommands Update. */
+public final class VirtualMachineScaleSetVMRunCommandsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/UpdateVirtualMachineScaleSetVMRunCommands.json
+ */
+ /**
+ * Sample code: Update VirtualMachineScaleSet VM run command.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateVirtualMachineScaleSetVMRunCommand(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMRunCommands()
+ .update(
+ "myResourceGroup",
+ "myvmScaleSet",
+ "0",
+ "myRunCommand",
+ new VirtualMachineRunCommandUpdate()
+ .withSource(
+ new VirtualMachineRunCommandScriptSource().withScript("Write-Host Script Source Updated!")),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_Deallocate
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs Deallocate. */
+public final class VirtualMachineScaleSetVMsDeallocateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Deallocate_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsDeallocateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetVMs().deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Deallocate_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Deallocate_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsDeallocateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs Delete. */
+public final class VirtualMachineScaleSetVMsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSetVM.json
+ */
+ /**
+ * Sample code: Force Delete a virtual machine from a VM scale set.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void forceDeleteAVirtualMachineFromAVMScaleSet(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetVMs().delete("myResourceGroup", "myvmScaleSet", "0", true, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_Get
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs Get. */
+public final class VirtualMachineScaleSetVMsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithVMSizeProperties.json
+ */
+ /**
+ * Sample code: Get VM scale set VM with VMSizeProperties.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getVMScaleSetVMWithVMSizeProperties(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetVMs().getWithResponse("myResourceGroup", "{vmss-name}", "0", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMWithUserData.json
+ */
+ /**
+ * Sample code: Get VM scale set VM with UserData.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getVMScaleSetVMWithUserData(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetVMs().getWithResponse("myResourceGroup", "{vmss-name}", "0", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_GetInstanceView
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs GetInstanceView. */
+public final class VirtualMachineScaleSetVMsGetInstanceViewSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetVMInstanceViewAutoPlacedOnDedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Get instance view of a virtual machine from a VM scale set placed on a dedicated host group through
+ * automatic placement.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void
+ getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .getInstanceViewWithResponse("myResourceGroup", "myVirtualMachineScaleSet", "0", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs List. */
+public final class VirtualMachineScaleSetVMsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsListMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .list("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, null, null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsListMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .list(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaa",
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_PerformMaintenance
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs PerformMaintenance. */
+public final class VirtualMachineScaleSetVMsPerformMaintenanceSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_PerformMaintenance_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsPerformMaintenanceMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetVMs().performMaintenance("rgcompute", "aaaaaaaaaa", "aaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PerformMaintenance_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_PerformMaintenance_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsPerformMaintenanceMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .performMaintenance("rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_PowerOff
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs PowerOff. */
+public final class VirtualMachineScaleSetVMsPowerOffSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_PowerOff_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsPowerOffMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetVMs().powerOff("rgcompute", "aaaaaa", "aaaaaaaaa", true, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_PowerOff_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_PowerOff_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsPowerOffMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .powerOff("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaa", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_Redeploy
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs Redeploy. */
+public final class VirtualMachineScaleSetVMsRedeploySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Redeploy_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsRedeployMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .redeploy("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Redeploy_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Redeploy_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsRedeployMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .redeploy("rgcompute", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_Reimage
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMReimageParameters;
+
+/** Samples for VirtualMachineScaleSetVMs Reimage. */
+public final class VirtualMachineScaleSetVMsReimageSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Reimage_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsReimageMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .reimage(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMReimageParameters().withTempDisk(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Reimage_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Reimage_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsReimageMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetVMs().reimage("rgcompute", "aaaaaaa", "aaaaaaaaaaaaa", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_ReimageAll
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs ReimageAll. */
+public final class VirtualMachineScaleSetVMsReimageAllSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_ReimageAll_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsReimageAllMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .reimageAll("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsReimageAllMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .reimageAll("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_Restart
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs Restart. */
+public final class VirtualMachineScaleSetVMsRestartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Restart_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsRestartMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetVMs().restart("rgcompute", "aaaaaaaaaaaa", "aaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Restart_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Restart_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsRestartMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetVMs().restart("rgcompute", "aa", "aaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_RetrieveBootDiagnosticsData
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs RetrieveBootDiagnosticsData. */
+public final class VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVMScaleSetVM.json
+ */
+ /**
+ * Sample code: RetrieveBootDiagnosticsData of a virtual machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void retrieveBootDiagnosticsDataOfAVirtualMachine(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .retrieveBootDiagnosticsDataWithResponse("ResourceGroup", "myvmScaleSet", "0", 60, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_RunCommand
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.RunCommandInput;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSetVMs RunCommand. */
+public final class VirtualMachineScaleSetVMsRunCommandSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VMScaleSetRunCommand.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_RunCommand.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsRunCommand(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .runCommand(
+ "myResourceGroup",
+ "myVirtualMachineScaleSet",
+ "0",
+ new RunCommandInput()
+ .withCommandId("RunPowerShellScript")
+ .withScript(Arrays.asList("Write-Host Hello World!")),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_SimulateEviction
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs SimulateEviction. */
+public final class VirtualMachineScaleSetVMsSimulateEvictionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVmssVM.json
+ */
+ /**
+ * Sample code: Simulate Eviction a virtual machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void simulateEvictionAVirtualMachine(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .simulateEvictionWithResponse("ResourceGroup", "VmScaleSetName", "InstanceId", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_Start
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs Start. */
+public final class VirtualMachineScaleSetVMsStartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Start_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsStartMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .start("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Start_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Start_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsStartMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSetVMs().start("rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSetVMs_Update
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetVMInner;
+import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities;
+import com.azure.resourcemanager.compute.generated.models.AdditionalUnattendContent;
+import com.azure.resourcemanager.compute.generated.models.ApiEntityReference;
+import com.azure.resourcemanager.compute.generated.models.BootDiagnostics;
+import com.azure.resourcemanager.compute.generated.models.CachingTypes;
+import com.azure.resourcemanager.compute.generated.models.ComponentNames;
+import com.azure.resourcemanager.compute.generated.models.DataDisk;
+import com.azure.resourcemanager.compute.generated.models.DeleteOptions;
+import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile;
+import com.azure.resourcemanager.compute.generated.models.DiffDiskOptions;
+import com.azure.resourcemanager.compute.generated.models.DiffDiskPlacement;
+import com.azure.resourcemanager.compute.generated.models.DiffDiskSettings;
+import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes;
+import com.azure.resourcemanager.compute.generated.models.DiskDeleteOptionTypes;
+import com.azure.resourcemanager.compute.generated.models.DiskDetachOptionTypes;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSettings;
+import com.azure.resourcemanager.compute.generated.models.HardwareProfile;
+import com.azure.resourcemanager.compute.generated.models.ImageReference;
+import com.azure.resourcemanager.compute.generated.models.IpVersion;
+import com.azure.resourcemanager.compute.generated.models.IpVersions;
+import com.azure.resourcemanager.compute.generated.models.KeyVaultKeyReference;
+import com.azure.resourcemanager.compute.generated.models.KeyVaultSecretReference;
+import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration;
+import com.azure.resourcemanager.compute.generated.models.LinuxPatchAssessmentMode;
+import com.azure.resourcemanager.compute.generated.models.LinuxPatchSettings;
+import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchMode;
+import com.azure.resourcemanager.compute.generated.models.ManagedDiskParameters;
+import com.azure.resourcemanager.compute.generated.models.NetworkApiVersion;
+import com.azure.resourcemanager.compute.generated.models.NetworkInterfaceReference;
+import com.azure.resourcemanager.compute.generated.models.NetworkProfile;
+import com.azure.resourcemanager.compute.generated.models.OSDisk;
+import com.azure.resourcemanager.compute.generated.models.OSProfile;
+import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes;
+import com.azure.resourcemanager.compute.generated.models.PassNames;
+import com.azure.resourcemanager.compute.generated.models.PatchSettings;
+import com.azure.resourcemanager.compute.generated.models.Plan;
+import com.azure.resourcemanager.compute.generated.models.ProtocolTypes;
+import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSku;
+import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuName;
+import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuTier;
+import com.azure.resourcemanager.compute.generated.models.PublicIpAllocationMethod;
+import com.azure.resourcemanager.compute.generated.models.SecurityProfile;
+import com.azure.resourcemanager.compute.generated.models.SecurityTypes;
+import com.azure.resourcemanager.compute.generated.models.SettingNames;
+import com.azure.resourcemanager.compute.generated.models.SshConfiguration;
+import com.azure.resourcemanager.compute.generated.models.SshPublicKey;
+import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes;
+import com.azure.resourcemanager.compute.generated.models.StorageProfile;
+import com.azure.resourcemanager.compute.generated.models.UefiSettings;
+import com.azure.resourcemanager.compute.generated.models.VMSizeProperties;
+import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineIpTag;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceDnsSettingsConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceIpConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachinePublicIpAddressConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachinePublicIpAddressDnsSettingsConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIpConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIpTag;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMNetworkProfileConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProtectionPolicy;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeTypes;
+import com.azure.resourcemanager.compute.generated.models.WinRMConfiguration;
+import com.azure.resourcemanager.compute.generated.models.WinRMListener;
+import com.azure.resourcemanager.compute.generated.models.WindowsConfiguration;
+import com.azure.resourcemanager.compute.generated.models.WindowsPatchAssessmentMode;
+import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchMode;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualMachineScaleSetVMs Update. */
+public final class VirtualMachineScaleSetVMsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Update_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .update(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInner().withLocation("westus"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSetVMs_Update_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_Update_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetVMsUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSetVMs()
+ .update(
+ "rgcompute",
+ "aaaaaaaaaaaaaa",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInner()
+ .withLocation("westus")
+ .withTags(mapOf())
+ .withPlan(
+ new Plan()
+ .withName("aaaaaaaaaa")
+ .withPublisher("aaaaaaaaaaaaaaaaaaaaaa")
+ .withProduct("aaaaaaaaaaaaaaaaaaaa")
+ .withPromotionCode("aaaaaaaaaaaaaaaaaaaa"))
+ .withHardwareProfile(
+ new HardwareProfile()
+ .withVmSize(VirtualMachineSizeTypes.BASIC_A0)
+ .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(9).withVCpusPerCore(12)))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId("a")
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2012-R2-Datacenter")
+ .withVersion("4.127.20180315")
+ .withSharedGalleryImageId("aaaaaaaaaaaaaaaaaaaa"))
+ .withOsDisk(
+ new OSDisk()
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withEncryptionSettings(
+ new DiskEncryptionSettings()
+ .withDiskEncryptionKey(
+ new KeyVaultSecretReference()
+ .withSecretUrl("aaaaaaaa")
+ .withSourceVault(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")))
+ .withKeyEncryptionKey(
+ new KeyVaultKeyReference()
+ .withKeyUrl("aaaaaaaaaaaaaa")
+ .withSourceVault(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")))
+ .withEnabled(true))
+ .withName("vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc")
+ .withVhd(
+ new VirtualHardDisk()
+ .withUri(
+ "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"))
+ .withImage(
+ new VirtualHardDisk()
+ .withUri(
+ "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"))
+ .withCaching(CachingTypes.NONE)
+ .withWriteAcceleratorEnabled(true)
+ .withDiffDiskSettings(
+ new DiffDiskSettings()
+ .withOption(DiffDiskOptions.LOCAL)
+ .withPlacement(DiffDiskPlacement.CACHE_DISK))
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withDiskSizeGB(127)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc")
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa")))
+ .withDeleteOption(DiskDeleteOptionTypes.DELETE))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new DataDisk()
+ .withLun(1)
+ .withName("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d")
+ .withVhd(
+ new VirtualHardDisk()
+ .withUri(
+ "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"))
+ .withImage(
+ new VirtualHardDisk()
+ .withUri(
+ "https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"))
+ .withCaching(CachingTypes.NONE)
+ .withWriteAcceleratorEnabled(true)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(128)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d")
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa")))
+ .withToBeDetached(true)
+ .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH)
+ .withDeleteOption(DiskDeleteOptionTypes.DELETE))))
+ .withAdditionalCapabilities(
+ new AdditionalCapabilities().withUltraSsdEnabled(true).withHibernationEnabled(true))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("test000000")
+ .withAdminUsername("Foo12")
+ .withAdminPassword("aaaaaaaaaaaaaaaa")
+ .withCustomData("aaaa")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withTimeZone("aaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ .withAdditionalUnattendContent(
+ Arrays
+ .asList(
+ new AdditionalUnattendContent()
+ .withPassName(PassNames.OOBE_SYSTEM)
+ .withComponentName(ComponentNames.MICROSOFT_WINDOWS_SHELL_SETUP)
+ .withSettingName(SettingNames.AUTO_LOGON)
+ .withContent("aaaaaaaaaaaaaaaaaaaa")))
+ .withPatchSettings(
+ new PatchSettings()
+ .withPatchMode(WindowsVMGuestPatchMode.MANUAL)
+ .withEnableHotpatching(true)
+ .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT))
+ .withWinRM(
+ new WinRMConfiguration()
+ .withListeners(
+ Arrays
+ .asList(
+ new WinRMListener()
+ .withProtocol(ProtocolTypes.HTTP)
+ .withCertificateUrl("aaaaaaaaaaaaaaaaaaaaaa")))))
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withDisablePasswordAuthentication(true)
+ .withSsh(
+ new SshConfiguration()
+ .withPublicKeys(
+ Arrays
+ .asList(new SshPublicKey().withPath("aaa").withKeyData("aaaaaa"))))
+ .withProvisionVMAgent(true)
+ .withPatchSettings(
+ new LinuxPatchSettings()
+ .withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT)
+ .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT)))
+ .withSecrets(Arrays.asList())
+ .withAllowExtensionOperations(true)
+ .withRequireGuestProvisionSignal(true))
+ .withSecurityProfile(
+ new SecurityProfile()
+ .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true))
+ .withEncryptionAtHost(true)
+ .withSecurityType(SecurityTypes.TRUSTED_LAUNCH))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415")
+ .withPrimary(true)
+ .withDeleteOption(DeleteOptions.DELETE)))
+ .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE)
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineNetworkInterfaceConfiguration()
+ .withName("aaaaaaaaaaa")
+ .withPrimary(true)
+ .withDeleteOption(DeleteOptions.DELETE)
+ .withEnableAcceleratedNetworking(true)
+ .withEnableFpga(true)
+ .withEnableIpForwarding(true)
+ .withNetworkSecurityGroup(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))
+ .withDnsSettings(
+ new VirtualMachineNetworkInterfaceDnsSettingsConfiguration()
+ .withDnsServers(Arrays.asList("aaaaaa")))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineNetworkInterfaceIpConfiguration()
+ .withName("aa")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))
+ .withPrimary(true)
+ .withPublicIpAddressConfiguration(
+ new VirtualMachinePublicIpAddressConfiguration()
+ .withName("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ .withSku(
+ new PublicIpAddressSku()
+ .withName(PublicIpAddressSkuName.BASIC)
+ .withTier(PublicIpAddressSkuTier.REGIONAL))
+ .withIdleTimeoutInMinutes(2)
+ .withDeleteOption(DeleteOptions.DELETE)
+ .withDnsSettings(
+ new VirtualMachinePublicIpAddressDnsSettingsConfiguration()
+ .withDomainNameLabel(
+ "aaaaaaaaaaaaaaaaaaaaaaaaa"))
+ .withIpTags(
+ Arrays
+ .asList(
+ new VirtualMachineIpTag()
+ .withIpTagType(
+ "aaaaaaaaaaaaaaaaaaaaaaaaa")
+ .withTag("aaaaaaaaaaaaaaaaaaaa")))
+ .withPublicIpPrefix(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))
+ .withPublicIpAddressVersion(IpVersions.IPV4)
+ .withPublicIpAllocationMethod(
+ PublicIpAllocationMethod.DYNAMIC))
+ .withPrivateIpAddressVersion(IpVersions.IPV4)
+ .withApplicationSecurityGroups(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")))
+ .withApplicationGatewayBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")))
+ .withLoadBalancerBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")))))
+ .withDscpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")))))
+ .withNetworkProfileConfiguration(
+ new VirtualMachineScaleSetVMNetworkProfileConfiguration()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withId("aaaaaaaa")
+ .withName("vmsstestnetconfig5415")
+ .withPrimary(true)
+ .withEnableAcceleratedNetworking(true)
+ .withEnableFpga(true)
+ .withNetworkSecurityGroup(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))
+ .withDnsSettings(
+ new VirtualMachineScaleSetNetworkConfigurationDnsSettings()
+ .withDnsServers(Arrays.asList()))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withId("aaaaaaaaa")
+ .withName("vmsstestnetconfig9693")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503"))
+ .withPrimary(true)
+ .withPublicIpAddressConfiguration(
+ new VirtualMachineScaleSetPublicIpAddressConfiguration()
+ .withName("aaaaaaaaaaaaaaaaaa")
+ .withSku(
+ new PublicIpAddressSku()
+ .withName(PublicIpAddressSkuName.BASIC)
+ .withTier(PublicIpAddressSkuTier.REGIONAL))
+ .withIdleTimeoutInMinutes(18)
+ .withDnsSettings(
+ new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings()
+ .withDomainNameLabel("aaaaaaaaaaaaaaaaaa"))
+ .withIpTags(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpTag()
+ .withIpTagType("aaaaaaa")
+ .withTag(
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaa")))
+ .withPublicIpPrefix(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))
+ .withPublicIpAddressVersion(IpVersion.IPV4)
+ .withDeleteOption(DeleteOptions.DELETE))
+ .withPrivateIpAddressVersion(IpVersion.IPV4)
+ .withApplicationGatewayBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")))
+ .withApplicationSecurityGroups(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")))
+ .withLoadBalancerBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")))
+ .withLoadBalancerInboundNatPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}")))))
+ .withEnableIpForwarding(true)
+ .withDeleteOption(DeleteOptions.DELETE))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics().withEnabled(true).withStorageUri("aaaaaaaaaaaaa")))
+ .withAvailabilitySet(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))
+ .withLicenseType("aaaaaaaaaa")
+ .withProtectionPolicy(
+ new VirtualMachineScaleSetVMProtectionPolicy()
+ .withProtectFromScaleIn(true)
+ .withProtectFromScaleSetActions(true))
+ .withUserData("RXhhbXBsZSBVc2VyRGF0YQ=="),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualMachineScaleSets_ConvertToSinglePlacementGroup
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VMScaleSetConvertToSinglePlacementGroupInput;
+
+/** Samples for VirtualMachineScaleSets ConvertToSinglePlacementGroup. */
+public final class VirtualMachineScaleSetsConvertToSinglePlacementGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsConvertToSinglePlacementGroupMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .convertToSinglePlacementGroupWithResponse(
+ "rgcompute", "aaaaaaaaaaaaa", new VMScaleSetConvertToSinglePlacementGroupInput(), Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsConvertToSinglePlacementGroupMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .convertToSinglePlacementGroupWithResponse(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ new VMScaleSetConvertToSinglePlacementGroupInput()
+ .withActivePlacementGroupId("aaaaaaaaaaaaaaaaaaaaaaaaaaa"),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner;
+import com.azure.resourcemanager.compute.generated.models.ApiEntityReference;
+import com.azure.resourcemanager.compute.generated.models.ApplicationProfile;
+import com.azure.resourcemanager.compute.generated.models.AutomaticRepairsPolicy;
+import com.azure.resourcemanager.compute.generated.models.BillingProfile;
+import com.azure.resourcemanager.compute.generated.models.BootDiagnostics;
+import com.azure.resourcemanager.compute.generated.models.CachingTypes;
+import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile;
+import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile;
+import com.azure.resourcemanager.compute.generated.models.DiffDiskOptions;
+import com.azure.resourcemanager.compute.generated.models.DiffDiskPlacement;
+import com.azure.resourcemanager.compute.generated.models.DiffDiskSettings;
+import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters;
+import com.azure.resourcemanager.compute.generated.models.ImageReference;
+import com.azure.resourcemanager.compute.generated.models.IpVersion;
+import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration;
+import com.azure.resourcemanager.compute.generated.models.Plan;
+import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy;
+import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile;
+import com.azure.resourcemanager.compute.generated.models.SecurityEncryptionTypes;
+import com.azure.resourcemanager.compute.generated.models.SecurityProfile;
+import com.azure.resourcemanager.compute.generated.models.SecurityTypes;
+import com.azure.resourcemanager.compute.generated.models.Sku;
+import com.azure.resourcemanager.compute.generated.models.SpotRestorePolicy;
+import com.azure.resourcemanager.compute.generated.models.SshConfiguration;
+import com.azure.resourcemanager.compute.generated.models.SshPublicKey;
+import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes;
+import com.azure.resourcemanager.compute.generated.models.TerminateNotificationProfile;
+import com.azure.resourcemanager.compute.generated.models.UefiSettings;
+import com.azure.resourcemanager.compute.generated.models.UpgradeMode;
+import com.azure.resourcemanager.compute.generated.models.UpgradePolicy;
+import com.azure.resourcemanager.compute.generated.models.VMDiskSecurityProfile;
+import com.azure.resourcemanager.compute.generated.models.VMGalleryApplication;
+import com.azure.resourcemanager.compute.generated.models.VMSizeProperties;
+import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineEvictionPolicyTypes;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachinePriorityTypes;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetDataDisk;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensionProfile;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetHardwareProfile;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIpConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetManagedDiskParameters;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkProfile;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetOSDisk;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetOSProfile;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetScaleInRules;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetStorageProfile;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMProfile;
+import java.io.IOException;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets CreateOrUpdate. */
+public final class VirtualMachineScaleSetsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithEmptyDataDisksOnEachVm.json
+ */
+ /**
+ * Sample code: Create a scale set with empty data disks on each vm.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithEmptyDataDisksOnEachVm(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D2_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withDiskSizeGB(512)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetDataDisk()
+ .withLun(0)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023),
+ new VirtualMachineScaleSetDataDisk()
+ .withLun(1)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithUserData.json
+ */
+ /**
+ * Sample code: Create a scale set with userData.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithUserData(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withUserData("RXhhbXBsZSBVc2VyRGF0YQ=="))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromWithFpgaNetworkInterface.json
+ */
+ /**
+ * Sample code: Create a scale set with Fpga Network Interfaces.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithFpgaNetworkInterfaces(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true),
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{fpgaNic-Name}")
+ .withPrimary(false)
+ .withEnableAcceleratedNetworking(false)
+ .withEnableFpga(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{fpgaNic-Name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}"))
+ .withPrimary(true)
+ .withPrivateIpAddressVersion(IpVersion.IPV4)))
+ .withEnableIpForwarding(false)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromACustomImage.json
+ */
+ /**
+ * Sample code: Create a scale set from a custom image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetFromACustomImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithDiffOsDiskUsingDiffDiskPlacement.json
+ */
+ /**
+ * Sample code: Create a scale set with ephemeral os disks using placement property.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithEphemeralOsDisksUsingPlacementProperty(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L))
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withDiffDiskSettings(
+ new DiffDiskSettings()
+ .withOption(DiffDiskOptions.LOCAL)
+ .withPlacement(DiffDiskPlacement.RESOURCE_DISK))
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithScaleInPolicy.json
+ */
+ /**
+ * Sample code: Create a scale set with scaleInPolicy.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithScaleInPolicy(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .withScaleInPolicy(
+ new ScaleInPolicy()
+ .withRules(Arrays.asList(VirtualMachineScaleSetScaleInRules.OLDEST_VM))
+ .withForceDeletion(true))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithEncryptionAtHost.json
+ */
+ /**
+ * Sample code: Create a scale set with Host Encryption using encryptionAtHost property.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L))
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withSecurityProfile(new SecurityProfile().withEncryptionAtHost(true)))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithProtectedSettingsFromKeyVault.json
+ */
+ /**
+ * Sample code: Create a VMSS with an extension with protectedSettingsFromKeyVault.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVMSSWithAnExtensionWithProtectedSettingsFromKeyVault(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withExtensionProfile(
+ new VirtualMachineScaleSetExtensionProfile()
+ .withExtensions(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetExtensionInner()
+ .withName("{extension-name}")
+ .withPublisher("{extension-Publisher}")
+ .withTypePropertiesType("{extension-Type}")
+ .withTypeHandlerVersion("{handler-version}")
+ .withAutoUpgradeMinorVersion(false)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))
+ .withProtectedSettingsFromKeyVault(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize(
+ "{\"secretUrl\":\"https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e\",\"sourceVault\":{\"id\":\"/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName\"}}",
+ Object.class,
+ SerializerEncoding.JSON))))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAnAzureLoadBalancer.json
+ */
+ /**
+ * Sample code: Create a scale set with an azure load balancer.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithAnAzureLoadBalancer(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))
+ .withPublicIpAddressConfiguration(
+ new VirtualMachineScaleSetPublicIpAddressConfiguration()
+ .withName("{vmss-name}")
+ .withPublicIpAddressVersion(IpVersion.IPV4))
+ .withLoadBalancerBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}")))
+ .withLoadBalancerInboundNatPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}")))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithManagedBootDiagnostics.json
+ */
+ /**
+ * Sample code: Create a scale set with managed boot diagnostics.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithManagedBootDiagnostics(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile().withBootDiagnostics(new BootDiagnostics().withEnabled(true))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAMarketplaceImagePlan.json
+ */
+ /**
+ * Sample code: Create a scale set with a marketplace image plan.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithAMarketplaceImagePlan(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithDiffOsDisk.json
+ */
+ /**
+ * Sample code: Create a scale set with ephemeral os disks.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithEphemeralOsDisks(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L))
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL))
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithVMsInDifferentZones.json
+ */
+ /**
+ * Sample code: Create a scale set with virtual machines in different zones.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithVirtualMachinesInDifferentZones(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("centralus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_A1_v2").withTier("Standard").withCapacity(2L))
+ .withZones(Arrays.asList("1", "3"))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.AUTOMATIC))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withDiskSizeGB(512)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetDataDisk()
+ .withLun(0)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023),
+ new VirtualMachineScaleSetDataDisk()
+ .withLun(1)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithCapacityReservation.json
+ */
+ /**
+ * Sample code: Create or update a scale set with capacity reservation.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateAScaleSetWithCapacityReservation(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withCapacityReservation(
+ new CapacityReservationProfile()
+ .withCapacityReservationGroup(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSecurityTypeConfidentialVM.json
+ */
+ /**
+ * Sample code: Create a scale set with SecurityType as ConfidentialVM.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithSecurityTypeAsConfidentialVM(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_DC2as_v5").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("2019-datacenter-cvm")
+ .withSku("windows-cvm")
+ .withVersion("17763.2183.2109130127"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS)
+ .withSecurityProfile(
+ new VMDiskSecurityProfile()
+ .withSecurityEncryptionType(
+ SecurityEncryptionTypes.VMGUEST_STATE_ONLY)))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withSecurityProfile(
+ new SecurityProfile()
+ .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true))
+ .withSecurityType(SecurityTypes.CONFIDENTIAL_VM)))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSshAuthentication.json
+ */
+ /**
+ * Sample code: Create a scale set with ssh authentication.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithSshAuthentication(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withDisablePasswordAuthentication(true)
+ .withSsh(
+ new SshConfiguration()
+ .withPublicKeys(
+ Arrays
+ .asList(
+ new SshPublicKey()
+ .withPath("/home/{your-username}/.ssh/authorized_keys")
+ .withKeyData(
+ "ssh-rsa"
+ + " AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"))))))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAnAzureApplicationGateway.json
+ */
+ /**
+ * Sample code: Create a scale set with an azure application gateway.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithAnAzureApplicationGateway(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))
+ .withApplicationGatewayBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}")))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage.json
+ */
+ /**
+ * Sample code: Create a custom-image scale set from an unmanaged generalized os image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withName("osDisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withImage(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd"))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithExtensionsTimeBudget.json
+ */
+ /**
+ * Sample code: Create a scale set with extension time budget.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithExtensionTimeBudget(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withExtensionProfile(
+ new VirtualMachineScaleSetExtensionProfile()
+ .withExtensions(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetExtensionInner()
+ .withName("{extension-name}")
+ .withPublisher("{extension-Publisher}")
+ .withTypePropertiesType("{extension-Type}")
+ .withTypeHandlerVersion("{handler-version}")
+ .withAutoUpgradeMinorVersion(false)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))))
+ .withExtensionsTimeBudget("PT1H20M")))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithApplicationProfile.json
+ */
+ /**
+ * Sample code: Create a scale set with Application Profile.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithApplicationProfile(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withApplicationProfile(
+ new ApplicationProfile()
+ .withGalleryApplications(
+ Arrays
+ .asList(
+ new VMGalleryApplication()
+ .withTags("myTag1")
+ .withOrder(1)
+ .withPackageReferenceId(
+ "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0")
+ .withConfigurationReference(
+ "https://mystorageaccount.blob.core.windows.net/configurations/settings.config"),
+ new VMGalleryApplication()
+ .withPackageReferenceId(
+ "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1")))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScalesetWithDiskEncryptionSetResource.json
+ */
+ /**
+ * Sample code: Create a scale set with DiskEncryptionSet resource in os disk and data disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetDataDisk()
+ .withLun(0)
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithPremiumStorage.json
+ */
+ /**
+ * Sample code: Create a scale set with premium storage.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithPremiumStorage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAScaleSetWithVMSizeProperties.json
+ */
+ /**
+ * Sample code: Create a scale set with vm size properties.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithVmSizeProperties(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withUserData("RXhhbXBsZSBVc2VyRGF0YQ==")
+ .withHardwareProfile(
+ new VirtualMachineScaleSetHardwareProfile()
+ .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(1).withVCpusPerCore(1))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithTerminateScheduledEventEnabled.json
+ */
+ /**
+ * Sample code: Create a scale set with terminate scheduled events enabled.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithTerminateScheduledEventsEnabled(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withScheduledEventsProfile(
+ new ScheduledEventsProfile()
+ .withTerminateNotificationProfile(
+ new TerminateNotificationProfile().withNotBeforeTimeout("PT5M").withEnable(true))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithExtensionsSuppressFailuresEnabled.json
+ */
+ /**
+ * Sample code: Create a VMSS with an extension that has suppressFailures enabled.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVMSSWithAnExtensionThatHasSuppressFailuresEnabled(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withExtensionProfile(
+ new VirtualMachineScaleSetExtensionProfile()
+ .withExtensions(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetExtensionInner()
+ .withName("{extension-name}")
+ .withPublisher("{extension-Publisher}")
+ .withTypePropertiesType("{extension-Type}")
+ .withTypeHandlerVersion("{handler-version}")
+ .withAutoUpgradeMinorVersion(false)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))
+ .withSuppressFailures(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAPlatformImageScaleSetWithUnmanagedOsDisks.json
+ */
+ /**
+ * Sample code: Create a platform-image scale set with unmanaged os disks.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAPlatformImageScaleSetWithUnmanagedOsDisks(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withName("osDisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withVhdContainers(
+ Arrays
+ .asList(
+ "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"))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithUefiSettings.json
+ */
+ /**
+ * Sample code: Create a scale set with Uefi Settings of secureBoot and vTPM.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithUefiSettingsOfSecureBootAndVTPM(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D2s_v3").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("windowsserver-gen2preview-preview")
+ .withSku("windows10-tvm")
+ .withVersion("18363.592.2001092016"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withSecurityProfile(
+ new SecurityProfile()
+ .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true))
+ .withSecurityType(SecurityTypes.TRUSTED_LAUNCH)))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithPasswordAuthentication.json
+ */
+ /**
+ * Sample code: Create a scale set with password authentication.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithPasswordAuthentication(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithAutomaticRepairs.json
+ */
+ /**
+ * Sample code: Create a scale set with automatic repairs enabled.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithAutomaticRepairsEnabled(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withAutomaticRepairsPolicy(new AutomaticRepairsPolicy().withEnabled(true).withGracePeriod("PT10M"))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithSpotRestorePolicy.json
+ */
+ /**
+ * Sample code: Create a scale set with spot restore policy.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithSpotRestorePolicy(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_A8m_v2").withTier("Standard").withCapacity(2L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withPriority(VirtualMachinePriorityTypes.SPOT)
+ .withEvictionPolicy(VirtualMachineEvictionPolicyTypes.DEALLOCATE)
+ .withBillingProfile(new BillingProfile().withMaxPrice(-1.0)))
+ .withOverprovision(true)
+ .withSpotRestorePolicy(new SpotRestorePolicy().withEnabled(true).withRestoreTimeout("PT1H"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromAGeneralizedSharedImage.json
+ */
+ /**
+ * Sample code: Create a scale set from a generalized shared image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetFromAGeneralizedSharedImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetWithBootDiagnostics.json
+ */
+ /**
+ * Sample code: Create a scale set with boot diagnostics.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetWithBootDiagnostics(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))))
+ .withOverprovision(true)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAScaleSetFromASpecializedSharedImage.json
+ */
+ /**
+ * Sample code: Create a scale set from a specialized shared image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAScaleSetFromASpecializedSharedImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .define("{vmss-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .create();
+ }
+}
+```
+
+### VirtualMachineScaleSets_Deallocate
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets Deallocate. */
+public final class VirtualMachineScaleSetsDeallocateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Deallocate_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsDeallocateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().deallocate("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Deallocate_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Deallocate_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsDeallocateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .deallocate(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets Delete. */
+public final class VirtualMachineScaleSetsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachineScaleSets.json
+ */
+ /**
+ * Sample code: Force Delete a VM scale set.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void forceDeleteAVMScaleSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().delete("myResourceGroup", "myvmScaleSet", true, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_DeleteInstances
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets DeleteInstances. */
+public final class VirtualMachineScaleSetsDeleteInstancesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_DeleteInstances_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsDeleteInstancesMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .deleteInstances(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInstanceRequiredIDs()
+ .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")),
+ true,
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_DeleteInstances_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_DeleteInstances_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsDeleteInstancesMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .deleteInstances(
+ "rgcompute",
+ "aaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInstanceRequiredIDs()
+ .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")),
+ null,
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets ForceRecoveryServiceFabricPlatformUpdateDomainWalk. */
+public final class VirtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse(
+ "rgcompute", "aaaaaaaaaaaa", 9, null, null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .forceRecoveryServiceFabricPlatformUpdateDomainWalkWithResponse(
+ "rgcompute", "aaaaaaaaaaaaaaaa", 30, null, null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets GetByResourceGroup. */
+public final class VirtualMachineScaleSetsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetAutoPlacedOnDedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Get a virtual machine scale set placed on a dedicated host group through automatic placement.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myVirtualMachineScaleSet", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSet.json
+ */
+ /**
+ * Sample code: Get a virtual machine scale set.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAVirtualMachineScaleSet(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myVirtualMachineScaleSet", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineScaleSetWithUserData.json
+ */
+ /**
+ * Sample code: Get a virtual machine scale set with UserData.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAVirtualMachineScaleSetWithUserData(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myVirtualMachineScaleSet", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_GetInstanceView
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets GetInstanceView. */
+public final class VirtualMachineScaleSetsGetInstanceViewSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_GetInstanceView_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsGetInstanceViewMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().getInstanceViewWithResponse("rgcompute", "aaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetInstanceView_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_GetInstanceView_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsGetInstanceViewMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().getInstanceViewWithResponse("rgcompute", "aaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_GetOSUpgradeHistory
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets GetOSUpgradeHistory. */
+public final class VirtualMachineScaleSetsGetOSUpgradeHistorySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_GetOSUpgradeHistory_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsGetOSUpgradeHistoryMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().getOSUpgradeHistory("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_GetOSUpgradeHistory_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_GetOSUpgradeHistory_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsGetOSUpgradeHistoryMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().getOSUpgradeHistory("rgcompute", "aaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets List. */
+public final class VirtualMachineScaleSetsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_ListAll_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsListAllMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().list(Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListAll_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_ListAll_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsListAllMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().list(Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_ListByLocation
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets ListByLocation. */
+public final class VirtualMachineScaleSetsListByLocationSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachineScaleSetsInASubscriptionByLocation.json
+ */
+ /**
+ * Sample code: Lists all the VM scale sets under the specified subscription for the specified location.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().listByLocation("eastus", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets ListByResourceGroup. */
+public final class VirtualMachineScaleSetsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsListMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().listByResourceGroup("rgcompute", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsListMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().listByResourceGroup("rgcompute", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_ListSkus
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets ListSkus. */
+public final class VirtualMachineScaleSetsListSkusSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_ListSkus_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsListSkusMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().listSkus("rgcompute", "aaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ListSkus_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_ListSkus_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsListSkusMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().listSkus("rgcompute", "aaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_PerformMaintenance
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets PerformMaintenance. */
+public final class VirtualMachineScaleSetsPerformMaintenanceSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_PerformMaintenance_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsPerformMaintenanceMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .performMaintenance(
+ "rgcompute",
+ "aaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PerformMaintenance_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_PerformMaintenance_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsPerformMaintenanceMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().performMaintenance("rgcompute", "aa", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_PowerOff
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets PowerOff. */
+public final class VirtualMachineScaleSetsPowerOffSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_PowerOff_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsPowerOffMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().powerOff("rgcompute", "a", null, null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_PowerOff_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_PowerOff_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsPowerOffMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .powerOff(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaa",
+ true,
+ new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_Redeploy
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets Redeploy. */
+public final class VirtualMachineScaleSetsRedeploySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Redeploy_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsRedeployMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().redeploy("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Redeploy_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Redeploy_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsRedeployMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .redeploy(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_Reimage
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetReimageParameters;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets Reimage. */
+public final class VirtualMachineScaleSetsReimageSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Reimage_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsReimageMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().reimage("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Reimage_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Reimage_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsReimageMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .reimage(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetReimageParameters()
+ .withTempDisk(true)
+ .withInstanceIds(Arrays.asList("aaaaaaaaaa")),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_ReimageAll
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets ReimageAll. */
+public final class VirtualMachineScaleSetsReimageAllSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_ReimageAll_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsReimageAllMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .reimageAll(
+ "rgcompute",
+ "aaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_ReimageAll_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_ReimageAll_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsReimageAllMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().reimageAll("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_Restart
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets Restart. */
+public final class VirtualMachineScaleSetsRestartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Restart_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsRestartMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .restart(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Restart_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Restart_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsRestartMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().restart("rgcompute", "aaaa", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_SetOrchestrationServiceState
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceNames;
+import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateAction;
+import com.azure.resourcemanager.compute.generated.models.OrchestrationServiceStateInput;
+
+/** Samples for VirtualMachineScaleSets SetOrchestrationServiceState. */
+public final class VirtualMachineScaleSetsSetOrchestrationServiceStateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_SetOrchestrationServiceState_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsSetOrchestrationServiceStateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .setOrchestrationServiceState(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaaaaaaa",
+ new OrchestrationServiceStateInput()
+ .withServiceName(OrchestrationServiceNames.AUTOMATIC_REPAIRS)
+ .withAction(OrchestrationServiceStateAction.RESUME),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_SetOrchestrationServiceState_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_SetOrchestrationServiceState_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsSetOrchestrationServiceStateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .setOrchestrationServiceState(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaa",
+ new OrchestrationServiceStateInput()
+ .withServiceName(OrchestrationServiceNames.AUTOMATIC_REPAIRS)
+ .withAction(OrchestrationServiceStateAction.RESUME),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_Start
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceIDs;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets Start. */
+public final class VirtualMachineScaleSetsStartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Start_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsStartMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .start(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInstanceIDs().withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaa")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Start_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Start_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsStartMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineScaleSets().start("rgcompute", "aaaaaaaaaaaaaaaaaaa", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachineScaleSets_Update
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineScaleSetExtensionInner;
+import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities;
+import com.azure.resourcemanager.compute.generated.models.AdditionalUnattendContent;
+import com.azure.resourcemanager.compute.generated.models.ApiEntityReference;
+import com.azure.resourcemanager.compute.generated.models.AutomaticOSUpgradePolicy;
+import com.azure.resourcemanager.compute.generated.models.AutomaticRepairsPolicy;
+import com.azure.resourcemanager.compute.generated.models.BillingProfile;
+import com.azure.resourcemanager.compute.generated.models.BootDiagnostics;
+import com.azure.resourcemanager.compute.generated.models.CachingTypes;
+import com.azure.resourcemanager.compute.generated.models.ComponentNames;
+import com.azure.resourcemanager.compute.generated.models.DeleteOptions;
+import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile;
+import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters;
+import com.azure.resourcemanager.compute.generated.models.ImageReference;
+import com.azure.resourcemanager.compute.generated.models.IpVersion;
+import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration;
+import com.azure.resourcemanager.compute.generated.models.LinuxPatchAssessmentMode;
+import com.azure.resourcemanager.compute.generated.models.LinuxPatchSettings;
+import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchMode;
+import com.azure.resourcemanager.compute.generated.models.NetworkApiVersion;
+import com.azure.resourcemanager.compute.generated.models.PassNames;
+import com.azure.resourcemanager.compute.generated.models.PatchSettings;
+import com.azure.resourcemanager.compute.generated.models.Plan;
+import com.azure.resourcemanager.compute.generated.models.ProtocolTypes;
+import com.azure.resourcemanager.compute.generated.models.ResourceIdentityType;
+import com.azure.resourcemanager.compute.generated.models.RollingUpgradePolicy;
+import com.azure.resourcemanager.compute.generated.models.ScaleInPolicy;
+import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile;
+import com.azure.resourcemanager.compute.generated.models.SecurityProfile;
+import com.azure.resourcemanager.compute.generated.models.SecurityTypes;
+import com.azure.resourcemanager.compute.generated.models.SettingNames;
+import com.azure.resourcemanager.compute.generated.models.Sku;
+import com.azure.resourcemanager.compute.generated.models.SshConfiguration;
+import com.azure.resourcemanager.compute.generated.models.SshPublicKey;
+import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes;
+import com.azure.resourcemanager.compute.generated.models.TerminateNotificationProfile;
+import com.azure.resourcemanager.compute.generated.models.UefiSettings;
+import com.azure.resourcemanager.compute.generated.models.UpgradeMode;
+import com.azure.resourcemanager.compute.generated.models.UpgradePolicy;
+import com.azure.resourcemanager.compute.generated.models.VaultCertificate;
+import com.azure.resourcemanager.compute.generated.models.VaultSecretGroup;
+import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSet;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetDataDisk;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensionProfile;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIdentity;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetManagedDiskParameters;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetScaleInRules;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateIpConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateNetworkConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateNetworkProfile;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateOSDisk;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateOSProfile;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdatePublicIpAddressConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateStorageProfile;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetUpdateVMProfile;
+import com.azure.resourcemanager.compute.generated.models.WinRMConfiguration;
+import com.azure.resourcemanager.compute.generated.models.WinRMListener;
+import com.azure.resourcemanager.compute.generated.models.WindowsConfiguration;
+import com.azure.resourcemanager.compute.generated.models.WindowsPatchAssessmentMode;
+import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchMode;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for VirtualMachineScaleSets Update. */
+public final class VirtualMachineScaleSetsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Update_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsUpdateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ VirtualMachineScaleSet resource =
+ manager
+ .virtualMachineScaleSets()
+ .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaaa", null, Context.NONE)
+ .getValue();
+ resource.update().apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_Update_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_Update_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsUpdateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) throws IOException {
+ VirtualMachineScaleSet resource =
+ manager
+ .virtualMachineScaleSets()
+ .getByResourceGroupWithResponse("rgcompute", "aaaaaaaaaaaaa", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withTags(mapOf("key246", "aaaaaaaaaaaaaaaaaaaaaaaa"))
+ .withSku(new Sku().withName("DSv3-Type1").withTier("aaa").withCapacity(7L))
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm")
+ .withPromotionCode("aaaaaaaaaa"))
+ .withIdentity(
+ new VirtualMachineScaleSetIdentity()
+ .withType(ResourceIdentityType.SYSTEM_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf("key3951", new VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue())))
+ .withUpgradePolicy(
+ new UpgradePolicy()
+ .withMode(UpgradeMode.MANUAL)
+ .withRollingUpgradePolicy(
+ new RollingUpgradePolicy()
+ .withMaxBatchInstancePercent(49)
+ .withMaxUnhealthyInstancePercent(81)
+ .withMaxUnhealthyUpgradedInstancePercent(98)
+ .withPauseTimeBetweenBatches("aaaaaaaaaaaaaaa")
+ .withEnableCrossZoneUpgrade(true)
+ .withPrioritizeUnhealthyInstances(true))
+ .withAutomaticOSUpgradePolicy(
+ new AutomaticOSUpgradePolicy()
+ .withEnableAutomaticOSUpgrade(true)
+ .withDisableAutomaticRollback(true)))
+ .withAutomaticRepairsPolicy(new AutomaticRepairsPolicy().withEnabled(true).withGracePeriod("PT30M"))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetUpdateVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetUpdateOSProfile()
+ .withCustomData("aaaaaaaaaaaaaaaaaaaaaaaaaa")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withTimeZone("aaaaaaaaaaaaaaaa")
+ .withAdditionalUnattendContent(
+ Arrays
+ .asList(
+ new AdditionalUnattendContent()
+ .withPassName(PassNames.OOBE_SYSTEM)
+ .withComponentName(ComponentNames.MICROSOFT_WINDOWS_SHELL_SETUP)
+ .withSettingName(SettingNames.AUTO_LOGON)
+ .withContent("aaaaaaaaaaaaaaaaaaaa")))
+ .withPatchSettings(
+ new PatchSettings()
+ .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_OS)
+ .withEnableHotpatching(true)
+ .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT))
+ .withWinRM(
+ new WinRMConfiguration()
+ .withListeners(
+ Arrays
+ .asList(
+ new WinRMListener()
+ .withProtocol(ProtocolTypes.HTTP)
+ .withCertificateUrl("aaaaaaaaaaaaaaaaaaaaaa")))))
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withDisablePasswordAuthentication(true)
+ .withSsh(
+ new SshConfiguration()
+ .withPublicKeys(
+ Arrays
+ .asList(
+ new SshPublicKey()
+ .withPath("/home/{your-username}/.ssh/authorized_keys")
+ .withKeyData(
+ "ssh-rsa"
+ + " AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"))))
+ .withProvisionVMAgent(true)
+ .withPatchSettings(
+ new LinuxPatchSettings()
+ .withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT)
+ .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT)))
+ .withSecrets(
+ Arrays
+ .asList(
+ new VaultSecretGroup()
+ .withSourceVault(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"))
+ .withVaultCertificates(
+ Arrays
+ .asList(
+ new VaultCertificate()
+ .withCertificateUrl("aaaaaaa")
+ .withCertificateStore("aaaaaaaaaaaaaaaaaaaaaaaaa"))))))
+ .withStorageProfile(
+ new VirtualMachineScaleSetUpdateStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId("aaaaaaaaaaaaaaaaaaa")
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest")
+ .withSharedGalleryImageId("aaaaaa"))
+ .withOsDisk(
+ new VirtualMachineScaleSetUpdateOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withWriteAcceleratorEnabled(true)
+ .withDiskSizeGB(6)
+ .withImage(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"))
+ .withVhdContainers(Arrays.asList("aa"))
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa"))))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetDataDisk()
+ .withName("aaaaaaaaaaaaaaaaaaaaaaaaaa")
+ .withLun(26)
+ .withCaching(CachingTypes.NONE)
+ .withWriteAcceleratorEnabled(true)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters().withId("aaaaaaaaaaaa")))
+ .withDiskIopsReadWrite(28L)
+ .withDiskMBpsReadWrite(15L))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetUpdateNetworkProfile()
+ .withHealthProbe(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"))
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetUpdateNetworkConfiguration()
+ .withId("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ .withName("aaaaaaaa")
+ .withPrimary(true)
+ .withEnableAcceleratedNetworking(true)
+ .withEnableFpga(true)
+ .withNetworkSecurityGroup(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))
+ .withDnsSettings(
+ new VirtualMachineScaleSetNetworkConfigurationDnsSettings()
+ .withDnsServers(Arrays.asList()))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetUpdateIpConfiguration()
+ .withId("aaaaaaaaaaaaaaaa")
+ .withName("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"))
+ .withPrimary(true)
+ .withPublicIpAddressConfiguration(
+ new VirtualMachineScaleSetUpdatePublicIpAddressConfiguration()
+ .withName("a")
+ .withIdleTimeoutInMinutes(3)
+ .withDnsSettings(
+ new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings()
+ .withDomainNameLabel("aaaaaaaaaaaaaaaaaa"))
+ .withDeleteOption(DeleteOptions.DELETE))
+ .withPrivateIpAddressVersion(IpVersion.IPV4)
+ .withApplicationGatewayBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")))
+ .withApplicationSecurityGroups(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")))
+ .withLoadBalancerBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")))
+ .withLoadBalancerInboundNatPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")))))
+ .withEnableIpForwarding(true)
+ .withDeleteOption(DeleteOptions.DELETE)))
+ .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE))
+ .withSecurityProfile(
+ new SecurityProfile()
+ .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true))
+ .withEncryptionAtHost(true)
+ .withSecurityType(SecurityTypes.TRUSTED_LAUNCH))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withExtensionProfile(
+ new VirtualMachineScaleSetExtensionProfile()
+ .withExtensions(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetExtensionInner()
+ .withName("{extension-name}")
+ .withForceUpdateTag("aaaaaaaaa")
+ .withPublisher("{extension-Publisher}")
+ .withTypePropertiesType("{extension-Type}")
+ .withTypeHandlerVersion("{handler-version}")
+ .withAutoUpgradeMinorVersion(true)
+ .withEnableAutomaticUpgrade(true)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))
+ .withProtectedSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))
+ .withProvisionAfterExtensions(Arrays.asList("aa"))
+ .withSuppressFailures(true)))
+ .withExtensionsTimeBudget("PT1H20M"))
+ .withLicenseType("aaaaaaaaaaaa")
+ .withBillingProfile(new BillingProfile().withMaxPrice(-1.0))
+ .withScheduledEventsProfile(
+ new ScheduledEventsProfile()
+ .withTerminateNotificationProfile(
+ new TerminateNotificationProfile().withNotBeforeTimeout("PT10M").withEnable(true)))
+ .withUserData("aaaaaaaaaaaaa"))
+ .withOverprovision(true)
+ .withDoNotRunExtensionsOnOverprovisionedVMs(true)
+ .withSinglePlacementGroup(true)
+ .withAdditionalCapabilities(
+ new AdditionalCapabilities().withUltraSsdEnabled(true).withHibernationEnabled(true))
+ .withScaleInPolicy(
+ new ScaleInPolicy()
+ .withRules(Arrays.asList(VirtualMachineScaleSetScaleInRules.OLDEST_VM))
+ .withForceDeletion(true))
+ .withProximityPlacementGroup(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))
+ .apply();
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
+```
+
+### VirtualMachineScaleSets_UpdateInstances
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMInstanceRequiredIDs;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets UpdateInstances. */
+public final class VirtualMachineScaleSetsUpdateInstancesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_UpdateInstances_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsUpdateInstancesMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .updateInstances(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInstanceRequiredIDs()
+ .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineScaleSets_UpdateInstances_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSets_UpdateInstances_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineScaleSetsUpdateInstancesMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachineScaleSets()
+ .updateInstances(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineScaleSetVMInstanceRequiredIDs()
+ .withInstanceIds(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachineSizes_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineSizes List. */
+public final class VirtualMachineSizesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineSizes_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineSizesListMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineSizes().list("._..", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineSizes_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachineSizes_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineSizesListMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachineSizes().list("-e", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_AssessPatches
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines AssessPatches. */
+public final class VirtualMachinesAssessPatchesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineAssessPatches.json
+ */
+ /**
+ * Sample code: Assess patch state of a virtual machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void assessPatchStateOfAVirtualMachine(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().assessPatches("myResourceGroupName", "myVMName", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_Capture
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineCaptureParameters;
+
+/** Samples for VirtualMachines Capture. */
+public final class VirtualMachinesCaptureSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_Capture_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesCaptureMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .capture(
+ "rgcompute",
+ "aaaaaaaaaaaaaaaaaaaa",
+ new VirtualMachineCaptureParameters()
+ .withVhdPrefix("aaaaaaaaa")
+ .withDestinationContainerName("aaaaaaa")
+ .withOverwriteVhds(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Capture_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_Capture_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesCaptureMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .capture(
+ "rgcompute",
+ "aaaaaaaaaaaaa",
+ new VirtualMachineCaptureParameters()
+ .withVhdPrefix("aaaaaaaaa")
+ .withDestinationContainerName("aaaaaaa")
+ .withOverwriteVhds(true),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_ConvertToManagedDisks
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines ConvertToManagedDisks. */
+public final class VirtualMachinesConvertToManagedDisksSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_ConvertToManagedDisks_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesConvertToManagedDisksMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().convertToManagedDisks("rgcompute", "aaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ConvertToManagedDisks_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_ConvertToManagedDisks_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesConvertToManagedDisksMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().convertToManagedDisks("rgcompute", "aaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_CreateOrUpdate
+
+```java
+import com.azure.core.management.SubResource;
+import com.azure.resourcemanager.compute.generated.models.AdditionalCapabilities;
+import com.azure.resourcemanager.compute.generated.models.ApplicationProfile;
+import com.azure.resourcemanager.compute.generated.models.BootDiagnostics;
+import com.azure.resourcemanager.compute.generated.models.CachingTypes;
+import com.azure.resourcemanager.compute.generated.models.CapacityReservationProfile;
+import com.azure.resourcemanager.compute.generated.models.DataDisk;
+import com.azure.resourcemanager.compute.generated.models.DeleteOptions;
+import com.azure.resourcemanager.compute.generated.models.DiagnosticsProfile;
+import com.azure.resourcemanager.compute.generated.models.DiffDiskOptions;
+import com.azure.resourcemanager.compute.generated.models.DiffDiskPlacement;
+import com.azure.resourcemanager.compute.generated.models.DiffDiskSettings;
+import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetParameters;
+import com.azure.resourcemanager.compute.generated.models.HardwareProfile;
+import com.azure.resourcemanager.compute.generated.models.ImageReference;
+import com.azure.resourcemanager.compute.generated.models.LinuxConfiguration;
+import com.azure.resourcemanager.compute.generated.models.LinuxPatchAssessmentMode;
+import com.azure.resourcemanager.compute.generated.models.LinuxPatchSettings;
+import com.azure.resourcemanager.compute.generated.models.LinuxVMGuestPatchMode;
+import com.azure.resourcemanager.compute.generated.models.ManagedDiskParameters;
+import com.azure.resourcemanager.compute.generated.models.NetworkApiVersion;
+import com.azure.resourcemanager.compute.generated.models.NetworkInterfaceReference;
+import com.azure.resourcemanager.compute.generated.models.NetworkProfile;
+import com.azure.resourcemanager.compute.generated.models.OSDisk;
+import com.azure.resourcemanager.compute.generated.models.OSProfile;
+import com.azure.resourcemanager.compute.generated.models.OperatingSystemTypes;
+import com.azure.resourcemanager.compute.generated.models.PatchSettings;
+import com.azure.resourcemanager.compute.generated.models.Plan;
+import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSku;
+import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuName;
+import com.azure.resourcemanager.compute.generated.models.PublicIpAddressSkuTier;
+import com.azure.resourcemanager.compute.generated.models.PublicIpAllocationMethod;
+import com.azure.resourcemanager.compute.generated.models.ScheduledEventsProfile;
+import com.azure.resourcemanager.compute.generated.models.SecurityEncryptionTypes;
+import com.azure.resourcemanager.compute.generated.models.SecurityProfile;
+import com.azure.resourcemanager.compute.generated.models.SecurityTypes;
+import com.azure.resourcemanager.compute.generated.models.SshConfiguration;
+import com.azure.resourcemanager.compute.generated.models.SshPublicKey;
+import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes;
+import com.azure.resourcemanager.compute.generated.models.StorageProfile;
+import com.azure.resourcemanager.compute.generated.models.TerminateNotificationProfile;
+import com.azure.resourcemanager.compute.generated.models.UefiSettings;
+import com.azure.resourcemanager.compute.generated.models.VMDiskSecurityProfile;
+import com.azure.resourcemanager.compute.generated.models.VMGalleryApplication;
+import com.azure.resourcemanager.compute.generated.models.VMSizeProperties;
+import com.azure.resourcemanager.compute.generated.models.VirtualHardDisk;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineNetworkInterfaceIpConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachinePublicIpAddressConfiguration;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeTypes;
+import com.azure.resourcemanager.compute.generated.models.WindowsConfiguration;
+import com.azure.resourcemanager.compute.generated.models.WindowsPatchAssessmentMode;
+import com.azure.resourcemanager.compute.generated.models.WindowsVMGuestPatchMode;
+import java.util.Arrays;
+
+/** Samples for VirtualMachines CreateOrUpdate. */
+public final class VirtualMachinesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromASharedGalleryImage.json
+ */
+ /**
+ * Sample code: Create a VM from a shared gallery image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVMFromASharedGalleryImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withSharedGalleryImageId(
+ "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithVMSizeProperties.json
+ */
+ /**
+ * Sample code: Create a VM with VM Size Properties.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVMWithVMSizeProperties(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(
+ new HardwareProfile()
+ .withVmSize(VirtualMachineSizeTypes.STANDARD_D4_V3)
+ .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(1).withVCpusPerCore(1)))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withUserData("U29tZSBDdXN0b20gRGF0YQ==")
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAPlatformImageVmWithUnmanagedOsAndDataDisks.json
+ */
+ /**
+ * Sample code: Create a platform-image vm with unmanaged os and data disks.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAPlatformImageVmWithUnmanagedOsAndDataDisks(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("{vm-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withVhd(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"))
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new DataDisk()
+ .withLun(0)
+ .withVhd(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd"))
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023),
+ new DataDisk()
+ .withLun(1)
+ .withVhd(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd"))
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingModesOfAutomaticByPlatform.json
+ */
+ /**
+ * Sample code: Create a Linux vm with a patch settings patchMode and assessmentMode set to AutomaticByPlatform.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("Canonical")
+ .withOffer("UbuntuServer")
+ .withSku("16.04-LTS")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withProvisionVMAgent(true)
+ .withPatchSettings(
+ new LinuxPatchSettings()
+ .withPatchMode(LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM)
+ .withAssessmentMode(LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json
+ */
+ /**
+ * Sample code: Create a vm with ephemeral os disk provisioning in Cache disk using placement property.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withDiffDiskSettings(
+ new DiffDiskSettings()
+ .withOption(DiffDiskOptions.LOCAL)
+ .withPlacement(DiffDiskPlacement.CACHE_DISK))
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithAMarketplaceImagePlan.json
+ */
+ /**
+ * Sample code: Create a vm with a marketplace image plan.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithAMarketplaceImagePlan(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfAutomaticByOS.json
+ */
+ /**
+ * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByOS.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withPatchSettings(
+ new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_OS))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModesOfAutomaticByPlatform.json
+ */
+ /**
+ * Sample code: Create a Windows vm with patch settings patchMode and assessmentMode set to AutomaticByPlatform.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withPatchSettings(
+ new PatchSettings()
+ .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM)
+ .withAssessmentMode(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingAssessmentModeOfImageDefault.json
+ */
+ /**
+ * Sample code: Create a Windows vm with a patch setting assessmentMode of ImageDefault.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withPatchSettings(
+ new PatchSettings().withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithPremiumStorage.json
+ */
+ /**
+ * Sample code: Create a vm with premium storage.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithPremiumStorage(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithCapacityReservation.json
+ */
+ /**
+ * Sample code: Create or update a VM with capacity reservation.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createOrUpdateAVMWithCapacityReservation(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withCapacityReservation(
+ new CapacityReservationProfile()
+ .withCapacityReservationGroup(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingAssessmentModeOfImageDefault.json
+ */
+ /**
+ * Sample code: Create a Linux vm with a patch setting assessmentMode of ImageDefault.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createALinuxVmWithAPatchSettingAssessmentModeOfImageDefault(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("Canonical")
+ .withOffer("UbuntuServer")
+ .withSku("16.04-LTS")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withProvisionVMAgent(true)
+ .withPatchSettings(
+ new LinuxPatchSettings().withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json
+ */
+ /**
+ * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and enableHotpatching set
+ * to true.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withPatchSettings(
+ new PatchSettings()
+ .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM)
+ .withEnableHotpatching(true))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithExtensionsTimeBudget.json
+ */
+ /**
+ * Sample code: Create a vm with an extensions time budget.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithAnExtensionsTimeBudget(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withExtensionsTimeBudget("PT30M")
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateACustomImageVmFromAnUnmanagedGeneralizedOsImage.json
+ */
+ /**
+ * Sample code: Create a custom-image vm from an unmanaged generalized os image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createACustomImageVmFromAnUnmanagedGeneralizedOsImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("{vm-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withOsDisk(
+ new OSDisk()
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withName("myVMosdisk")
+ .withVhd(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"))
+ .withImage(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd"))
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithEncryptionAtHost.json
+ */
+ /**
+ * Sample code: Create a vm with Host Encryption using encryptionAtHost property.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithHostEncryptionUsingEncryptionAtHostProperty(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withSecurityProfile(new SecurityProfile().withEncryptionAtHost(true))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmInAnAvailabilitySet.json
+ */
+ /**
+ * Sample code: Create a vm in an availability set.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmInAnAvailabilitySet(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withAvailabilitySet(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}"))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithEmptyDataDisks.json
+ */
+ /**
+ * Sample code: Create a vm with empty data disks.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithEmptyDataDisks(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new DataDisk()
+ .withLun(0)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023),
+ new DataDisk()
+ .withLun(1)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSecurityTypeConfidentialVM.json
+ */
+ /**
+ * Sample code: Create a VM with securityType ConfidentialVM with Platform Managed Keys.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(
+ new HardwareProfile().withVmSize(VirtualMachineSizeTypes.fromString("Standard_DC2as_v5")))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("2019-datacenter-cvm")
+ .withSku("windows-cvm")
+ .withVersion("17763.2183.2109130127"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS)
+ .withSecurityProfile(
+ new VMDiskSecurityProfile()
+ .withSecurityEncryptionType(
+ SecurityEncryptionTypes.DISK_WITH_VMGUEST_STATE)))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withSecurityProfile(
+ new SecurityProfile()
+ .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true))
+ .withSecurityType(SecurityTypes.CONFIDENTIAL_VM))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithNetworkInterfaceConfiguration.json
+ */
+ /**
+ * Sample code: Create a VM with network interface configuration.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVMWithNetworkInterfaceConfiguration(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE)
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineNetworkInterfaceConfiguration()
+ .withName("{nic-config-name}")
+ .withPrimary(true)
+ .withDeleteOption(DeleteOptions.DELETE)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineNetworkInterfaceIpConfiguration()
+ .withName("{ip-config-name}")
+ .withPrimary(true)
+ .withPublicIpAddressConfiguration(
+ new VirtualMachinePublicIpAddressConfiguration()
+ .withName("{publicIP-config-name}")
+ .withSku(
+ new PublicIpAddressSku()
+ .withName(PublicIpAddressSkuName.BASIC)
+ .withTier(PublicIpAddressSkuTier.GLOBAL))
+ .withDeleteOption(DeleteOptions.DETACH)
+ .withPublicIpAllocationMethod(
+ PublicIpAllocationMethod.STATIC)))))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACustomImage.json
+ */
+ /**
+ * Sample code: Create a vm from a custom image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmFromACustomImage(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithHibernationEnabled.json
+ */
+ /**
+ * Sample code: Create a VM with HibernationEnabled.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVMWithHibernationEnabled(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("{vm-name}")
+ .withRegion("eastus2euap")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2019-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("vmOSdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withAdditionalCapabilities(new AdditionalCapabilities().withHibernationEnabled(true))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("{vm-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithUefiSettings.json
+ */
+ /**
+ * Sample code: Create a VM with Uefi Settings of secureBoot and vTPM.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVMWithUefiSettingsOfSecureBootAndVTPM(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("windowsserver-gen2preview-preview")
+ .withSku("windows10-tvm")
+ .withVersion("18363.592.2001092016"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withSecurityProfile(
+ new SecurityProfile()
+ .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true))
+ .withSecurityType(SecurityTypes.TRUSTED_LAUNCH))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithApplicationProfile.json
+ */
+ /**
+ * Sample code: Create a vm with Application Profile.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithApplicationProfile(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("{image_publisher}")
+ .withOffer("{image_offer}")
+ .withSku("{image_sku}")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withApplicationProfile(
+ new ApplicationProfile()
+ .withGalleryApplications(
+ Arrays
+ .asList(
+ new VMGalleryApplication()
+ .withTags("myTag1")
+ .withOrder(1)
+ .withPackageReferenceId(
+ "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0")
+ .withConfigurationReference(
+ "https://mystorageaccount.blob.core.windows.net/configurations/settings.config"),
+ new VMGalleryApplication()
+ .withPackageReferenceId(
+ "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromASpecializedSharedImage.json
+ */
+ /**
+ * Sample code: Create a vm from a specialized shared image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmFromASpecializedSharedImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithPasswordAuthentication.json
+ */
+ /**
+ * Sample code: Create a vm with password authentication.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithPasswordAuthentication(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain.json
+ */
+ /**
+ * Sample code: Create a vm in a Virtual Machine Scale Set with customer assigned platformFaultDomain.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withVirtualMachineScaleSet(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}"))
+ .withPlatformFaultDomain(1)
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithScheduledEventsProfile.json
+ */
+ /**
+ * Sample code: Create a vm with Scheduled Events Profile.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithScheduledEventsProfile(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withScheduledEventsProfile(
+ new ScheduledEventsProfile()
+ .withTerminateNotificationProfile(
+ new TerminateNotificationProfile().withNotBeforeTimeout("PT10M").withEnable(true)))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithBootDiagnostics.json
+ */
+ /**
+ * Sample code: Create a vm with boot diagnostics.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithBootDiagnostics(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSshAuthentication.json
+ */
+ /**
+ * Sample code: Create a vm with ssh authentication.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithSshAuthentication(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("{image_publisher}")
+ .withOffer("{image_offer}")
+ .withSku("{image_sku}")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withDisablePasswordAuthentication(true)
+ .withSsh(
+ new SshConfiguration()
+ .withPublicKeys(
+ Arrays
+ .asList(
+ new SshPublicKey()
+ .withPath("/home/{your-username}/.ssh/authorized_keys")
+ .withKeyData(
+ "ssh-rsa"
+ + " AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"))))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromACommunityGalleryImage.json
+ */
+ /**
+ * Sample code: Create a VM from a community gallery image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVMFromACommunityGalleryImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withCommunityGalleryImageId(
+ "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json
+ */
+ /**
+ * Sample code: Create a vm with ephemeral os disk provisioning in Resource disk using placement property.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withDiffDiskSettings(
+ new DiffDiskSettings()
+ .withOption(DiffDiskOptions.LOCAL)
+ .withPlacement(DiffDiskPlacement.RESOURCE_DISK))
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithADiffOsDisk.json
+ */
+ /**
+ * Sample code: Create a vm with ephemeral os disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithEphemeralOsDisk(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL))
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateOrUpdateAVmWithUserData.json
+ */
+ /**
+ * Sample code: Create a VM with UserData.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVMWithUserData(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("{vm-name}")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("vmOSdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("{vm-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withUserData("RXhhbXBsZSBVc2VyRGF0YQ==")
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmFromAGeneralizedSharedImage.json
+ */
+ /**
+ * Sample code: Create a vm from a generalized shared image.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmFromAGeneralizedSharedImage(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfManual.json
+ */
+ /**
+ * Sample code: Create a Windows vm with a patch setting patchMode of Manual.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAWindowsVmWithAPatchSettingPatchModeOfManual(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withPatchSettings(new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.MANUAL))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithSecurityTypeConfidentialVMWithCustomerManagedKeys.json
+ */
+ /**
+ * Sample code: Create a VM with securityType ConfidentialVM with Customer Managed Keys.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(
+ new HardwareProfile().withVmSize(VirtualMachineSizeTypes.fromString("Standard_DC2as_v5")))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("2019-datacenter-cvm")
+ .withSku("windows-cvm")
+ .withVersion("17763.2183.2109130127"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS)
+ .withSecurityProfile(
+ new VMDiskSecurityProfile()
+ .withSecurityEncryptionType(SecurityEncryptionTypes.DISK_WITH_VMGUEST_STATE)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withSecurityProfile(
+ new SecurityProfile()
+ .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true))
+ .withSecurityType(SecurityTypes.CONFIDENTIAL_VM))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateALinuxVmWithPatchSettingModeOfImageDefault.json
+ */
+ /**
+ * Sample code: Create a Linux vm with a patch setting patchMode of ImageDefault.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createALinuxVmWithAPatchSettingPatchModeOfImageDefault(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("Canonical")
+ .withOffer("UbuntuServer")
+ .withSku("16.04-LTS")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withProvisionVMAgent(true)
+ .withPatchSettings(
+ new LinuxPatchSettings().withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithManagedBootDiagnostics.json
+ */
+ /**
+ * Sample code: Create a vm with managed boot diagnostics.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithManagedBootDiagnostics(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile().withBootDiagnostics(new BootDiagnostics().withEnabled(true)))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/CreateAVmWithDiskEncryptionSetResource.json
+ */
+ /**
+ * Sample code: Create a vm with DiskEncryptionSet resource id in the os disk and data disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void createAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .define("myVM")
+ .withRegion("westus")
+ .withExistingResourceGroup("myResourceGroup")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new DataDisk()
+ .withLun(0)
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))),
+ new DataDisk()
+ .withLun(1)
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.ATTACH)
+ .withDiskSizeGB(1023)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}")
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .create();
+ }
+}
+```
+
+### VirtualMachines_Deallocate
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines Deallocate. */
+public final class VirtualMachinesDeallocateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_Deallocate_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesDeallocateMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().deallocate("rgcompute", "aaaaaaaaaaaaaaaa", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Deallocate_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_Deallocate_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesDeallocateMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().deallocate("rgcompute", "aaaaaaaaaa", true, Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_Delete
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines Delete. */
+public final class VirtualMachinesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ForceDeleteVirtualMachine.json
+ */
+ /**
+ * Sample code: Force delete a VM.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void forceDeleteAVM(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().delete("myResourceGroup", "myVM", true, Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_Generalize
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines Generalize. */
+public final class VirtualMachinesGeneralizeSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GeneralizeVirtualMachine.json
+ */
+ /**
+ * Sample code: Generalize a Virtual Machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void generalizeAVirtualMachine(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().generalizeWithResponse("myResourceGroup", "myVMName", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_GetByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines GetByResourceGroup. */
+public final class VirtualMachinesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineWithVMSizeProperties.json
+ */
+ /**
+ * Sample code: Get a virtual machine with VM Size Properties.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAVirtualMachineWithVMSizeProperties(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().getByResourceGroupWithResponse("myResourceGroup", "myVM", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineAutoPlacedOnDedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Get a virtual machine placed on a dedicated host group through automatic placement.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().getByResourceGroupWithResponse("myResourceGroup", "myVM", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachine.json
+ */
+ /**
+ * Sample code: Get a Virtual Machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getAVirtualMachine(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().getByResourceGroupWithResponse("myResourceGroup", "myVM", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_InstallPatches
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VMGuestPatchClassificationWindows;
+import com.azure.resourcemanager.compute.generated.models.VMGuestPatchRebootSetting;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineInstallPatchesParameters;
+import com.azure.resourcemanager.compute.generated.models.WindowsParameters;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+
+/** Samples for VirtualMachines InstallPatches. */
+public final class VirtualMachinesInstallPatchesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachineInstallPatches.json
+ */
+ /**
+ * Sample code: Install patch state of a virtual machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void installPatchStateOfAVirtualMachine(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .installPatches(
+ "myResourceGroupName",
+ "myVMName",
+ new VirtualMachineInstallPatchesParameters()
+ .withMaximumDuration("PT4H")
+ .withRebootSetting(VMGuestPatchRebootSetting.IF_REQUIRED)
+ .withWindowsParameters(
+ new WindowsParameters()
+ .withClassificationsToInclude(
+ Arrays
+ .asList(
+ VMGuestPatchClassificationWindows.CRITICAL,
+ VMGuestPatchClassificationWindows.SECURITY))
+ .withMaxPatchPublishDate(OffsetDateTime.parse("2020-11-19T02:36:43.0539904+00:00"))),
+ Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_InstanceView
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines InstanceView. */
+public final class VirtualMachinesInstanceViewSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineInstanceView.json
+ */
+ /**
+ * Sample code: Get Virtual Machine Instance View.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getVirtualMachineInstanceView(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().instanceViewWithResponse("myResourceGroup", "myVM", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/GetVirtualMachineInstanceViewAutoPlacedOnDedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Get instance view of a virtual machine placed on a dedicated host group through automatic placement.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().instanceViewWithResponse("myResourceGroup", "myVM", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_List
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines List. */
+public final class VirtualMachinesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_ListAll_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesListAllMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().list(null, null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_ListAll_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_ListAll_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesListAllMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().list("aaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_ListAvailableSizes
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines ListAvailableSizes. */
+public final class VirtualMachinesListAvailableSizesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListAvailableVmSizes_VirtualMachines.json
+ */
+ /**
+ * Sample code: Lists all available virtual machine sizes to which the specified virtual machine can be resized.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().listAvailableSizes("myResourceGroup", "myVmName", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_ListByLocation
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines ListByLocation. */
+public final class VirtualMachinesListByLocationSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ListVirtualMachinesInASubscriptionByLocation.json
+ */
+ /**
+ * Sample code: Lists all the virtual machines under the specified subscription for the specified location.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().listByLocation("eastus", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_ListByResourceGroup
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines ListByResourceGroup. */
+public final class VirtualMachinesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_List_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesListMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().listByResourceGroup("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_List_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_List_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesListMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().listByResourceGroup("rgcompute", null, Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_PerformMaintenance
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines PerformMaintenance. */
+public final class VirtualMachinesPerformMaintenanceSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_PerformMaintenance_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesPerformMaintenanceMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().performMaintenance("rgcompute", "aaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PerformMaintenance_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_PerformMaintenance_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesPerformMaintenanceMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().performMaintenance("rgcompute", "aaaaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_PowerOff
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines PowerOff. */
+public final class VirtualMachinesPowerOffSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_PowerOff_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesPowerOffMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().powerOff("rgcompute", "aaaaaaaaaaaaaaaaaa", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_PowerOff_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_PowerOff_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesPowerOffMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().powerOff("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", true, Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_Reapply
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines Reapply. */
+public final class VirtualMachinesReapplySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReapplyVirtualMachine.json
+ */
+ /**
+ * Sample code: Reapply the state of a virtual machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void reapplyTheStateOfAVirtualMachine(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().reapply("ResourceGroup", "VMName", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_Redeploy
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines Redeploy. */
+public final class VirtualMachinesRedeploySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_Redeploy_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesRedeployMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().redeploy("rgcompute", "aaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Redeploy_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_Redeploy_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesRedeployMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().redeploy("rgcompute", "a", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_Reimage
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineReimageParameters;
+
+/** Samples for VirtualMachines Reimage. */
+public final class VirtualMachinesReimageSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/ReimageVirtualMachine.json
+ */
+ /**
+ * Sample code: Reimage a Virtual Machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void reimageAVirtualMachine(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .reimage(
+ "myResourceGroup", "myVMName", new VirtualMachineReimageParameters().withTempDisk(true), Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_Restart
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines Restart. */
+public final class VirtualMachinesRestartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_Restart_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesRestartMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().restart("rgcompute", "aaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Restart_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_Restart_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesRestartMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().restart("rgcompute", "aaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_RetrieveBootDiagnosticsData
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines RetrieveBootDiagnosticsData. */
+public final class VirtualMachinesRetrieveBootDiagnosticsDataSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/RetrieveBootDiagnosticsDataVirtualMachine.json
+ */
+ /**
+ * Sample code: RetrieveBootDiagnosticsData of a virtual machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void retrieveBootDiagnosticsDataOfAVirtualMachine(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().retrieveBootDiagnosticsDataWithResponse("ResourceGroup", "VMName", 60, Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_RunCommand
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.RunCommandInput;
+
+/** Samples for VirtualMachines RunCommand. */
+public final class VirtualMachinesRunCommandSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/runCommands/VirtualMachineRunCommand.json
+ */
+ /**
+ * Sample code: VirtualMachineRunCommand.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachineRunCommand(com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager
+ .virtualMachines()
+ .runCommand(
+ "crptestar98131", "vm3036", new RunCommandInput().withCommandId("RunPowerShellScript"), Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_SimulateEviction
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines SimulateEviction. */
+public final class VirtualMachinesSimulateEvictionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/SimulateEvictionOfVM.json
+ */
+ /**
+ * Sample code: Simulate Eviction a virtual machine.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void simulateEvictionAVirtualMachine(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().simulateEvictionWithResponse("ResourceGroup", "VMName", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_Start
+
+```java
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines Start. */
+public final class VirtualMachinesStartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MaximumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_Start_MaximumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesStartMaximumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().start("rgcompute", "aaaaaaaaaaaaaaaaaaaa", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/VirtualMachines_Start_MinimumSet_Gen.json
+ */
+ /**
+ * Sample code: VirtualMachines_Start_MinimumSet_Gen.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void virtualMachinesStartMinimumSetGen(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ manager.virtualMachines().start("rgcompute", "aaaaa", Context.NONE);
+ }
+}
+```
+
+### VirtualMachines_Update
+
+```java
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.models.CachingTypes;
+import com.azure.resourcemanager.compute.generated.models.DataDisk;
+import com.azure.resourcemanager.compute.generated.models.DiskCreateOptionTypes;
+import com.azure.resourcemanager.compute.generated.models.DiskDetachOptionTypes;
+import com.azure.resourcemanager.compute.generated.models.HardwareProfile;
+import com.azure.resourcemanager.compute.generated.models.ImageReference;
+import com.azure.resourcemanager.compute.generated.models.ManagedDiskParameters;
+import com.azure.resourcemanager.compute.generated.models.NetworkInterfaceReference;
+import com.azure.resourcemanager.compute.generated.models.NetworkProfile;
+import com.azure.resourcemanager.compute.generated.models.OSDisk;
+import com.azure.resourcemanager.compute.generated.models.OSProfile;
+import com.azure.resourcemanager.compute.generated.models.StorageAccountTypes;
+import com.azure.resourcemanager.compute.generated.models.StorageProfile;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachine;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizeTypes;
+import java.util.Arrays;
+
+/** Samples for VirtualMachines Update. */
+public final class VirtualMachinesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMDetachDataDiskUsingToBeDetachedProperty.json
+ */
+ /**
+ * Sample code: Update a VM by detaching data disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateAVMByDetachingDataDisk(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ VirtualMachine resource =
+ manager
+ .virtualMachines()
+ .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new DataDisk()
+ .withLun(0)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withToBeDetached(true),
+ new DataDisk()
+ .withLun(1)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withToBeDetached(false))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-11-01/examples/compute/UpdateVMForceDetachDataDisk.json
+ */
+ /**
+ * Sample code: Update a VM by force-detaching data disk.
+ *
+ * @param manager Entry point to ComputeManager.
+ */
+ public static void updateAVMByForceDetachingDataDisk(
+ com.azure.resourcemanager.compute.generated.ComputeManager manager) {
+ VirtualMachine resource =
+ manager
+ .virtualMachines()
+ .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, Context.NONE)
+ .getValue();
+ resource
+ .update()
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters().withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new DataDisk()
+ .withLun(0)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withToBeDetached(true)
+ .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH),
+ new DataDisk()
+ .withLun(1)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withToBeDetached(false))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .apply();
+ }
+}
+```
+
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/pom.xml b/sdk/compute/azure-resourcemanager-compute-generated/pom.xml
new file mode 100644
index 0000000000000..609dfea597c9e
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/pom.xml
@@ -0,0 +1,55 @@
+
+ 4.0.0
+
+ com.azure
+ azure-client-sdk-parent
+ 1.7.0
+ ../../parents/azure-client-sdk-parent
+
+
+ com.azure.resourcemanager
+ azure-resourcemanager-compute-generated
+ 1.0.0-beta.1
+ jar
+
+ Microsoft Azure SDK for Compute Management
+ This package contains Microsoft Azure SDK for Compute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Compute Client. Package tag package-2021-11-01.
+ https://github.com/Azure/azure-sdk-for-java
+
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
+
+
+ https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+
+ microsoft
+ Microsoft
+
+
+
+ UTF-8
+ true
+
+
+
+ com.azure
+ azure-core
+ 1.24.1
+
+
+ com.azure
+ azure-core-management
+ 1.5.1
+
+
+
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/ComputeManager.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/ComputeManager.java
new file mode 100644
index 0000000000000..de225c1b45261
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/ComputeManager.java
@@ -0,0 +1,841 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.credential.TokenCredential;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.HttpPipelinePosition;
+import com.azure.core.http.policy.AddDatePolicy;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.core.http.policy.HttpLoggingPolicy;
+import com.azure.core.http.policy.HttpPipelinePolicy;
+import com.azure.core.http.policy.HttpPolicyProviders;
+import com.azure.core.http.policy.RequestIdPolicy;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.util.Configuration;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.compute.generated.fluent.ComputeManagementClient;
+import com.azure.resourcemanager.compute.generated.implementation.AvailabilitySetsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.CapacityReservationGroupsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.CapacityReservationsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.CloudServiceOperatingSystemsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.CloudServiceRoleInstancesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.CloudServiceRolesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.CloudServicesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.CloudServicesUpdateDomainsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.CommunityGalleriesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.CommunityGalleryImageVersionsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.CommunityGalleryImagesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.ComputeManagementClientBuilder;
+import com.azure.resourcemanager.compute.generated.implementation.DedicatedHostGroupsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.DedicatedHostsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.DiskAccessesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.DiskEncryptionSetsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.DiskRestorePointsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.DisksImpl;
+import com.azure.resourcemanager.compute.generated.implementation.GalleriesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.GalleryApplicationVersionsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.GalleryApplicationsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.GalleryImageVersionsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.GalleryImagesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.GallerySharingProfilesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.ImagesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.LogAnalyticsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.OperationsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.ProximityPlacementGroupsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.ResourceSkusImpl;
+import com.azure.resourcemanager.compute.generated.implementation.RestorePointCollectionsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.RestorePointsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.SharedGalleriesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.SharedGalleryImageVersionsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.SharedGalleryImagesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.SnapshotsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.SshPublicKeysImpl;
+import com.azure.resourcemanager.compute.generated.implementation.UsagesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineExtensionImagesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineExtensionsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineImagesEdgeZonesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineImagesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineRunCommandsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetExtensionsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetRollingUpgradesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetVMExtensionsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetVMRunCommandsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetVMsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineScaleSetsImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachineSizesImpl;
+import com.azure.resourcemanager.compute.generated.implementation.VirtualMachinesImpl;
+import com.azure.resourcemanager.compute.generated.models.AvailabilitySets;
+import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroups;
+import com.azure.resourcemanager.compute.generated.models.CapacityReservations;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceOperatingSystems;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceRoleInstances;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceRoles;
+import com.azure.resourcemanager.compute.generated.models.CloudServices;
+import com.azure.resourcemanager.compute.generated.models.CloudServicesUpdateDomains;
+import com.azure.resourcemanager.compute.generated.models.CommunityGalleries;
+import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImageVersions;
+import com.azure.resourcemanager.compute.generated.models.CommunityGalleryImages;
+import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroups;
+import com.azure.resourcemanager.compute.generated.models.DedicatedHosts;
+import com.azure.resourcemanager.compute.generated.models.DiskAccesses;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSets;
+import com.azure.resourcemanager.compute.generated.models.DiskRestorePoints;
+import com.azure.resourcemanager.compute.generated.models.Disks;
+import com.azure.resourcemanager.compute.generated.models.Galleries;
+import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersions;
+import com.azure.resourcemanager.compute.generated.models.GalleryApplications;
+import com.azure.resourcemanager.compute.generated.models.GalleryImageVersions;
+import com.azure.resourcemanager.compute.generated.models.GalleryImages;
+import com.azure.resourcemanager.compute.generated.models.GallerySharingProfiles;
+import com.azure.resourcemanager.compute.generated.models.Images;
+import com.azure.resourcemanager.compute.generated.models.LogAnalytics;
+import com.azure.resourcemanager.compute.generated.models.Operations;
+import com.azure.resourcemanager.compute.generated.models.ProximityPlacementGroups;
+import com.azure.resourcemanager.compute.generated.models.ResourceSkus;
+import com.azure.resourcemanager.compute.generated.models.RestorePointCollections;
+import com.azure.resourcemanager.compute.generated.models.RestorePoints;
+import com.azure.resourcemanager.compute.generated.models.SharedGalleries;
+import com.azure.resourcemanager.compute.generated.models.SharedGalleryImageVersions;
+import com.azure.resourcemanager.compute.generated.models.SharedGalleryImages;
+import com.azure.resourcemanager.compute.generated.models.Snapshots;
+import com.azure.resourcemanager.compute.generated.models.SshPublicKeys;
+import com.azure.resourcemanager.compute.generated.models.Usages;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensionImages;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineExtensions;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineImages;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineImagesEdgeZones;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineRunCommands;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetExtensions;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetRollingUpgrades;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMExtensions;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMRunCommands;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSetVMs;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineScaleSets;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachineSizes;
+import com.azure.resourcemanager.compute.generated.models.VirtualMachines;
+import java.time.Duration;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/** Entry point to ComputeManager. Compute Client. */
+public final class ComputeManager {
+ private Operations operations;
+
+ private AvailabilitySets availabilitySets;
+
+ private ProximityPlacementGroups proximityPlacementGroups;
+
+ private DedicatedHostGroups dedicatedHostGroups;
+
+ private DedicatedHosts dedicatedHosts;
+
+ private SshPublicKeys sshPublicKeys;
+
+ private VirtualMachineExtensionImages virtualMachineExtensionImages;
+
+ private VirtualMachineExtensions virtualMachineExtensions;
+
+ private VirtualMachineImages virtualMachineImages;
+
+ private VirtualMachineImagesEdgeZones virtualMachineImagesEdgeZones;
+
+ private Usages usages;
+
+ private VirtualMachines virtualMachines;
+
+ private VirtualMachineScaleSets virtualMachineScaleSets;
+
+ private VirtualMachineSizes virtualMachineSizes;
+
+ private Images images;
+
+ private RestorePointCollections restorePointCollections;
+
+ private RestorePoints restorePoints;
+
+ private CapacityReservationGroups capacityReservationGroups;
+
+ private CapacityReservations capacityReservations;
+
+ private VirtualMachineScaleSetExtensions virtualMachineScaleSetExtensions;
+
+ private VirtualMachineScaleSetRollingUpgrades virtualMachineScaleSetRollingUpgrades;
+
+ private VirtualMachineScaleSetVMExtensions virtualMachineScaleSetVMExtensions;
+
+ private VirtualMachineScaleSetVMs virtualMachineScaleSetVMs;
+
+ private LogAnalytics logAnalytics;
+
+ private VirtualMachineRunCommands virtualMachineRunCommands;
+
+ private VirtualMachineScaleSetVMRunCommands virtualMachineScaleSetVMRunCommands;
+
+ private ResourceSkus resourceSkus;
+
+ private Disks disks;
+
+ private Snapshots snapshots;
+
+ private DiskEncryptionSets diskEncryptionSets;
+
+ private DiskAccesses diskAccesses;
+
+ private DiskRestorePoints diskRestorePoints;
+
+ private Galleries galleries;
+
+ private GalleryImages galleryImages;
+
+ private GalleryImageVersions galleryImageVersions;
+
+ private GalleryApplications galleryApplications;
+
+ private GalleryApplicationVersions galleryApplicationVersions;
+
+ private GallerySharingProfiles gallerySharingProfiles;
+
+ private SharedGalleries sharedGalleries;
+
+ private SharedGalleryImages sharedGalleryImages;
+
+ private SharedGalleryImageVersions sharedGalleryImageVersions;
+
+ private CommunityGalleries communityGalleries;
+
+ private CommunityGalleryImages communityGalleryImages;
+
+ private CommunityGalleryImageVersions communityGalleryImageVersions;
+
+ private CloudServiceRoleInstances cloudServiceRoleInstances;
+
+ private CloudServiceRoles cloudServiceRoles;
+
+ private CloudServices cloudServices;
+
+ private CloudServicesUpdateDomains cloudServicesUpdateDomains;
+
+ private CloudServiceOperatingSystems cloudServiceOperatingSystems;
+
+ private final ComputeManagementClient clientObject;
+
+ private ComputeManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
+ Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ this.clientObject =
+ new ComputeManagementClientBuilder()
+ .pipeline(httpPipeline)
+ .endpoint(profile.getEnvironment().getResourceManagerEndpoint())
+ .subscriptionId(profile.getSubscriptionId())
+ .defaultPollInterval(defaultPollInterval)
+ .buildClient();
+ }
+
+ /**
+ * Creates an instance of Compute service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Compute service API instance.
+ */
+ public static ComputeManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ return configure().authenticate(credential, profile);
+ }
+
+ /**
+ * Gets a Configurable instance that can be used to create ComputeManager with optional configuration.
+ *
+ * @return the Configurable instance allowing configurations.
+ */
+ public static Configurable configure() {
+ return new ComputeManager.Configurable();
+ }
+
+ /** The Configurable allowing configurations to be set. */
+ public static final class Configurable {
+ private final ClientLogger logger = new ClientLogger(Configurable.class);
+
+ private HttpClient httpClient;
+ private HttpLogOptions httpLogOptions;
+ private final List policies = new ArrayList<>();
+ private final List scopes = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ private Duration defaultPollInterval;
+
+ private Configurable() {
+ }
+
+ /**
+ * Sets the http client.
+ *
+ * @param httpClient the HTTP client.
+ * @return the configurable object itself.
+ */
+ public Configurable withHttpClient(HttpClient httpClient) {
+ this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the logging options to the HTTP pipeline.
+ *
+ * @param httpLogOptions the HTTP log options.
+ * @return the configurable object itself.
+ */
+ public Configurable withLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Adds the pipeline policy to the HTTP pipeline.
+ *
+ * @param policy the HTTP pipeline policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withPolicy(HttpPipelinePolicy policy) {
+ this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Adds the scope to permission sets.
+ *
+ * @param scope the scope.
+ * @return the configurable object itself.
+ */
+ public Configurable withScope(String scope) {
+ this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Sets the retry policy to the HTTP pipeline.
+ *
+ * @param retryPolicy the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the default poll interval, used when service does not provide "Retry-After" header.
+ *
+ * @param defaultPollInterval the default poll interval.
+ * @return the configurable object itself.
+ */
+ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of Compute service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Compute service API instance.
+ */
+ public ComputeManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder
+ .append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.compute.generated")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder
+ .append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
+ if (retryPolicy == null) {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new RequestIdPolicy());
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline =
+ new HttpPipelineBuilder()
+ .httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new ComputeManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /** @return Resource collection API of Operations. */
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ }
+ return operations;
+ }
+
+ /** @return Resource collection API of AvailabilitySets. */
+ public AvailabilitySets availabilitySets() {
+ if (this.availabilitySets == null) {
+ this.availabilitySets = new AvailabilitySetsImpl(clientObject.getAvailabilitySets(), this);
+ }
+ return availabilitySets;
+ }
+
+ /** @return Resource collection API of ProximityPlacementGroups. */
+ public ProximityPlacementGroups proximityPlacementGroups() {
+ if (this.proximityPlacementGroups == null) {
+ this.proximityPlacementGroups =
+ new ProximityPlacementGroupsImpl(clientObject.getProximityPlacementGroups(), this);
+ }
+ return proximityPlacementGroups;
+ }
+
+ /** @return Resource collection API of DedicatedHostGroups. */
+ public DedicatedHostGroups dedicatedHostGroups() {
+ if (this.dedicatedHostGroups == null) {
+ this.dedicatedHostGroups = new DedicatedHostGroupsImpl(clientObject.getDedicatedHostGroups(), this);
+ }
+ return dedicatedHostGroups;
+ }
+
+ /** @return Resource collection API of DedicatedHosts. */
+ public DedicatedHosts dedicatedHosts() {
+ if (this.dedicatedHosts == null) {
+ this.dedicatedHosts = new DedicatedHostsImpl(clientObject.getDedicatedHosts(), this);
+ }
+ return dedicatedHosts;
+ }
+
+ /** @return Resource collection API of SshPublicKeys. */
+ public SshPublicKeys sshPublicKeys() {
+ if (this.sshPublicKeys == null) {
+ this.sshPublicKeys = new SshPublicKeysImpl(clientObject.getSshPublicKeys(), this);
+ }
+ return sshPublicKeys;
+ }
+
+ /** @return Resource collection API of VirtualMachineExtensionImages. */
+ public VirtualMachineExtensionImages virtualMachineExtensionImages() {
+ if (this.virtualMachineExtensionImages == null) {
+ this.virtualMachineExtensionImages =
+ new VirtualMachineExtensionImagesImpl(clientObject.getVirtualMachineExtensionImages(), this);
+ }
+ return virtualMachineExtensionImages;
+ }
+
+ /** @return Resource collection API of VirtualMachineExtensions. */
+ public VirtualMachineExtensions virtualMachineExtensions() {
+ if (this.virtualMachineExtensions == null) {
+ this.virtualMachineExtensions =
+ new VirtualMachineExtensionsImpl(clientObject.getVirtualMachineExtensions(), this);
+ }
+ return virtualMachineExtensions;
+ }
+
+ /** @return Resource collection API of VirtualMachineImages. */
+ public VirtualMachineImages virtualMachineImages() {
+ if (this.virtualMachineImages == null) {
+ this.virtualMachineImages = new VirtualMachineImagesImpl(clientObject.getVirtualMachineImages(), this);
+ }
+ return virtualMachineImages;
+ }
+
+ /** @return Resource collection API of VirtualMachineImagesEdgeZones. */
+ public VirtualMachineImagesEdgeZones virtualMachineImagesEdgeZones() {
+ if (this.virtualMachineImagesEdgeZones == null) {
+ this.virtualMachineImagesEdgeZones =
+ new VirtualMachineImagesEdgeZonesImpl(clientObject.getVirtualMachineImagesEdgeZones(), this);
+ }
+ return virtualMachineImagesEdgeZones;
+ }
+
+ /** @return Resource collection API of Usages. */
+ public Usages usages() {
+ if (this.usages == null) {
+ this.usages = new UsagesImpl(clientObject.getUsages(), this);
+ }
+ return usages;
+ }
+
+ /** @return Resource collection API of VirtualMachines. */
+ public VirtualMachines virtualMachines() {
+ if (this.virtualMachines == null) {
+ this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this);
+ }
+ return virtualMachines;
+ }
+
+ /** @return Resource collection API of VirtualMachineScaleSets. */
+ public VirtualMachineScaleSets virtualMachineScaleSets() {
+ if (this.virtualMachineScaleSets == null) {
+ this.virtualMachineScaleSets =
+ new VirtualMachineScaleSetsImpl(clientObject.getVirtualMachineScaleSets(), this);
+ }
+ return virtualMachineScaleSets;
+ }
+
+ /** @return Resource collection API of VirtualMachineSizes. */
+ public VirtualMachineSizes virtualMachineSizes() {
+ if (this.virtualMachineSizes == null) {
+ this.virtualMachineSizes = new VirtualMachineSizesImpl(clientObject.getVirtualMachineSizes(), this);
+ }
+ return virtualMachineSizes;
+ }
+
+ /** @return Resource collection API of Images. */
+ public Images images() {
+ if (this.images == null) {
+ this.images = new ImagesImpl(clientObject.getImages(), this);
+ }
+ return images;
+ }
+
+ /** @return Resource collection API of RestorePointCollections. */
+ public RestorePointCollections restorePointCollections() {
+ if (this.restorePointCollections == null) {
+ this.restorePointCollections =
+ new RestorePointCollectionsImpl(clientObject.getRestorePointCollections(), this);
+ }
+ return restorePointCollections;
+ }
+
+ /** @return Resource collection API of RestorePoints. */
+ public RestorePoints restorePoints() {
+ if (this.restorePoints == null) {
+ this.restorePoints = new RestorePointsImpl(clientObject.getRestorePoints(), this);
+ }
+ return restorePoints;
+ }
+
+ /** @return Resource collection API of CapacityReservationGroups. */
+ public CapacityReservationGroups capacityReservationGroups() {
+ if (this.capacityReservationGroups == null) {
+ this.capacityReservationGroups =
+ new CapacityReservationGroupsImpl(clientObject.getCapacityReservationGroups(), this);
+ }
+ return capacityReservationGroups;
+ }
+
+ /** @return Resource collection API of CapacityReservations. */
+ public CapacityReservations capacityReservations() {
+ if (this.capacityReservations == null) {
+ this.capacityReservations = new CapacityReservationsImpl(clientObject.getCapacityReservations(), this);
+ }
+ return capacityReservations;
+ }
+
+ /** @return Resource collection API of VirtualMachineScaleSetExtensions. */
+ public VirtualMachineScaleSetExtensions virtualMachineScaleSetExtensions() {
+ if (this.virtualMachineScaleSetExtensions == null) {
+ this.virtualMachineScaleSetExtensions =
+ new VirtualMachineScaleSetExtensionsImpl(clientObject.getVirtualMachineScaleSetExtensions(), this);
+ }
+ return virtualMachineScaleSetExtensions;
+ }
+
+ /** @return Resource collection API of VirtualMachineScaleSetRollingUpgrades. */
+ public VirtualMachineScaleSetRollingUpgrades virtualMachineScaleSetRollingUpgrades() {
+ if (this.virtualMachineScaleSetRollingUpgrades == null) {
+ this.virtualMachineScaleSetRollingUpgrades =
+ new VirtualMachineScaleSetRollingUpgradesImpl(
+ clientObject.getVirtualMachineScaleSetRollingUpgrades(), this);
+ }
+ return virtualMachineScaleSetRollingUpgrades;
+ }
+
+ /** @return Resource collection API of VirtualMachineScaleSetVMExtensions. */
+ public VirtualMachineScaleSetVMExtensions virtualMachineScaleSetVMExtensions() {
+ if (this.virtualMachineScaleSetVMExtensions == null) {
+ this.virtualMachineScaleSetVMExtensions =
+ new VirtualMachineScaleSetVMExtensionsImpl(clientObject.getVirtualMachineScaleSetVMExtensions(), this);
+ }
+ return virtualMachineScaleSetVMExtensions;
+ }
+
+ /** @return Resource collection API of VirtualMachineScaleSetVMs. */
+ public VirtualMachineScaleSetVMs virtualMachineScaleSetVMs() {
+ if (this.virtualMachineScaleSetVMs == null) {
+ this.virtualMachineScaleSetVMs =
+ new VirtualMachineScaleSetVMsImpl(clientObject.getVirtualMachineScaleSetVMs(), this);
+ }
+ return virtualMachineScaleSetVMs;
+ }
+
+ /** @return Resource collection API of LogAnalytics. */
+ public LogAnalytics logAnalytics() {
+ if (this.logAnalytics == null) {
+ this.logAnalytics = new LogAnalyticsImpl(clientObject.getLogAnalytics(), this);
+ }
+ return logAnalytics;
+ }
+
+ /** @return Resource collection API of VirtualMachineRunCommands. */
+ public VirtualMachineRunCommands virtualMachineRunCommands() {
+ if (this.virtualMachineRunCommands == null) {
+ this.virtualMachineRunCommands =
+ new VirtualMachineRunCommandsImpl(clientObject.getVirtualMachineRunCommands(), this);
+ }
+ return virtualMachineRunCommands;
+ }
+
+ /** @return Resource collection API of VirtualMachineScaleSetVMRunCommands. */
+ public VirtualMachineScaleSetVMRunCommands virtualMachineScaleSetVMRunCommands() {
+ if (this.virtualMachineScaleSetVMRunCommands == null) {
+ this.virtualMachineScaleSetVMRunCommands =
+ new VirtualMachineScaleSetVMRunCommandsImpl(
+ clientObject.getVirtualMachineScaleSetVMRunCommands(), this);
+ }
+ return virtualMachineScaleSetVMRunCommands;
+ }
+
+ /** @return Resource collection API of ResourceSkus. */
+ public ResourceSkus resourceSkus() {
+ if (this.resourceSkus == null) {
+ this.resourceSkus = new ResourceSkusImpl(clientObject.getResourceSkus(), this);
+ }
+ return resourceSkus;
+ }
+
+ /** @return Resource collection API of Disks. */
+ public Disks disks() {
+ if (this.disks == null) {
+ this.disks = new DisksImpl(clientObject.getDisks(), this);
+ }
+ return disks;
+ }
+
+ /** @return Resource collection API of Snapshots. */
+ public Snapshots snapshots() {
+ if (this.snapshots == null) {
+ this.snapshots = new SnapshotsImpl(clientObject.getSnapshots(), this);
+ }
+ return snapshots;
+ }
+
+ /** @return Resource collection API of DiskEncryptionSets. */
+ public DiskEncryptionSets diskEncryptionSets() {
+ if (this.diskEncryptionSets == null) {
+ this.diskEncryptionSets = new DiskEncryptionSetsImpl(clientObject.getDiskEncryptionSets(), this);
+ }
+ return diskEncryptionSets;
+ }
+
+ /** @return Resource collection API of DiskAccesses. */
+ public DiskAccesses diskAccesses() {
+ if (this.diskAccesses == null) {
+ this.diskAccesses = new DiskAccessesImpl(clientObject.getDiskAccesses(), this);
+ }
+ return diskAccesses;
+ }
+
+ /** @return Resource collection API of DiskRestorePoints. */
+ public DiskRestorePoints diskRestorePoints() {
+ if (this.diskRestorePoints == null) {
+ this.diskRestorePoints = new DiskRestorePointsImpl(clientObject.getDiskRestorePoints(), this);
+ }
+ return diskRestorePoints;
+ }
+
+ /** @return Resource collection API of Galleries. */
+ public Galleries galleries() {
+ if (this.galleries == null) {
+ this.galleries = new GalleriesImpl(clientObject.getGalleries(), this);
+ }
+ return galleries;
+ }
+
+ /** @return Resource collection API of GalleryImages. */
+ public GalleryImages galleryImages() {
+ if (this.galleryImages == null) {
+ this.galleryImages = new GalleryImagesImpl(clientObject.getGalleryImages(), this);
+ }
+ return galleryImages;
+ }
+
+ /** @return Resource collection API of GalleryImageVersions. */
+ public GalleryImageVersions galleryImageVersions() {
+ if (this.galleryImageVersions == null) {
+ this.galleryImageVersions = new GalleryImageVersionsImpl(clientObject.getGalleryImageVersions(), this);
+ }
+ return galleryImageVersions;
+ }
+
+ /** @return Resource collection API of GalleryApplications. */
+ public GalleryApplications galleryApplications() {
+ if (this.galleryApplications == null) {
+ this.galleryApplications = new GalleryApplicationsImpl(clientObject.getGalleryApplications(), this);
+ }
+ return galleryApplications;
+ }
+
+ /** @return Resource collection API of GalleryApplicationVersions. */
+ public GalleryApplicationVersions galleryApplicationVersions() {
+ if (this.galleryApplicationVersions == null) {
+ this.galleryApplicationVersions =
+ new GalleryApplicationVersionsImpl(clientObject.getGalleryApplicationVersions(), this);
+ }
+ return galleryApplicationVersions;
+ }
+
+ /** @return Resource collection API of GallerySharingProfiles. */
+ public GallerySharingProfiles gallerySharingProfiles() {
+ if (this.gallerySharingProfiles == null) {
+ this.gallerySharingProfiles =
+ new GallerySharingProfilesImpl(clientObject.getGallerySharingProfiles(), this);
+ }
+ return gallerySharingProfiles;
+ }
+
+ /** @return Resource collection API of SharedGalleries. */
+ public SharedGalleries sharedGalleries() {
+ if (this.sharedGalleries == null) {
+ this.sharedGalleries = new SharedGalleriesImpl(clientObject.getSharedGalleries(), this);
+ }
+ return sharedGalleries;
+ }
+
+ /** @return Resource collection API of SharedGalleryImages. */
+ public SharedGalleryImages sharedGalleryImages() {
+ if (this.sharedGalleryImages == null) {
+ this.sharedGalleryImages = new SharedGalleryImagesImpl(clientObject.getSharedGalleryImages(), this);
+ }
+ return sharedGalleryImages;
+ }
+
+ /** @return Resource collection API of SharedGalleryImageVersions. */
+ public SharedGalleryImageVersions sharedGalleryImageVersions() {
+ if (this.sharedGalleryImageVersions == null) {
+ this.sharedGalleryImageVersions =
+ new SharedGalleryImageVersionsImpl(clientObject.getSharedGalleryImageVersions(), this);
+ }
+ return sharedGalleryImageVersions;
+ }
+
+ /** @return Resource collection API of CommunityGalleries. */
+ public CommunityGalleries communityGalleries() {
+ if (this.communityGalleries == null) {
+ this.communityGalleries = new CommunityGalleriesImpl(clientObject.getCommunityGalleries(), this);
+ }
+ return communityGalleries;
+ }
+
+ /** @return Resource collection API of CommunityGalleryImages. */
+ public CommunityGalleryImages communityGalleryImages() {
+ if (this.communityGalleryImages == null) {
+ this.communityGalleryImages =
+ new CommunityGalleryImagesImpl(clientObject.getCommunityGalleryImages(), this);
+ }
+ return communityGalleryImages;
+ }
+
+ /** @return Resource collection API of CommunityGalleryImageVersions. */
+ public CommunityGalleryImageVersions communityGalleryImageVersions() {
+ if (this.communityGalleryImageVersions == null) {
+ this.communityGalleryImageVersions =
+ new CommunityGalleryImageVersionsImpl(clientObject.getCommunityGalleryImageVersions(), this);
+ }
+ return communityGalleryImageVersions;
+ }
+
+ /** @return Resource collection API of CloudServiceRoleInstances. */
+ public CloudServiceRoleInstances cloudServiceRoleInstances() {
+ if (this.cloudServiceRoleInstances == null) {
+ this.cloudServiceRoleInstances =
+ new CloudServiceRoleInstancesImpl(clientObject.getCloudServiceRoleInstances(), this);
+ }
+ return cloudServiceRoleInstances;
+ }
+
+ /** @return Resource collection API of CloudServiceRoles. */
+ public CloudServiceRoles cloudServiceRoles() {
+ if (this.cloudServiceRoles == null) {
+ this.cloudServiceRoles = new CloudServiceRolesImpl(clientObject.getCloudServiceRoles(), this);
+ }
+ return cloudServiceRoles;
+ }
+
+ /** @return Resource collection API of CloudServices. */
+ public CloudServices cloudServices() {
+ if (this.cloudServices == null) {
+ this.cloudServices = new CloudServicesImpl(clientObject.getCloudServices(), this);
+ }
+ return cloudServices;
+ }
+
+ /** @return Resource collection API of CloudServicesUpdateDomains. */
+ public CloudServicesUpdateDomains cloudServicesUpdateDomains() {
+ if (this.cloudServicesUpdateDomains == null) {
+ this.cloudServicesUpdateDomains =
+ new CloudServicesUpdateDomainsImpl(clientObject.getCloudServicesUpdateDomains(), this);
+ }
+ return cloudServicesUpdateDomains;
+ }
+
+ /** @return Resource collection API of CloudServiceOperatingSystems. */
+ public CloudServiceOperatingSystems cloudServiceOperatingSystems() {
+ if (this.cloudServiceOperatingSystems == null) {
+ this.cloudServiceOperatingSystems =
+ new CloudServiceOperatingSystemsImpl(clientObject.getCloudServiceOperatingSystems(), this);
+ }
+ return cloudServiceOperatingSystems;
+ }
+
+ /**
+ * @return Wrapped service client ComputeManagementClient providing direct access to the underlying auto-generated
+ * API implementation, based on Azure REST API.
+ */
+ public ComputeManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/AvailabilitySetsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/AvailabilitySetsClient.java
new file mode 100644
index 0000000000000..01ffb2e607597
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/AvailabilitySetsClient.java
@@ -0,0 +1,227 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.AvailabilitySetInner;
+import com.azure.resourcemanager.compute.generated.fluent.models.VirtualMachineSizeInner;
+import com.azure.resourcemanager.compute.generated.models.AvailabilitySetUpdate;
+
+/** An instance of this class provides access to all the operations defined in AvailabilitySetsClient. */
+public interface AvailabilitySetsClient {
+ /**
+ * Create or update an availability set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param availabilitySetName The name of the availability set.
+ * @param parameters Parameters supplied to the Create Availability Set operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the availability set that the virtual machine should be assigned to.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AvailabilitySetInner createOrUpdate(
+ String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters);
+
+ /**
+ * Create or update an availability set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param availabilitySetName The name of the availability set.
+ * @param parameters Parameters supplied to the Create Availability Set operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the availability set that the virtual machine should be assigned to along
+ * with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response createOrUpdateWithResponse(
+ String resourceGroupName, String availabilitySetName, AvailabilitySetInner parameters, Context context);
+
+ /**
+ * Update an availability set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param availabilitySetName The name of the availability set.
+ * @param parameters Parameters supplied to the Update Availability Set operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the availability set that the virtual machine should be assigned to.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AvailabilitySetInner update(String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters);
+
+ /**
+ * Update an availability set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param availabilitySetName The name of the availability set.
+ * @param parameters Parameters supplied to the Update Availability Set operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the availability set that the virtual machine should be assigned to along
+ * with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(
+ String resourceGroupName, String availabilitySetName, AvailabilitySetUpdate parameters, Context context);
+
+ /**
+ * Delete an availability set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param availabilitySetName The name of the availability set.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String availabilitySetName);
+
+ /**
+ * Delete an availability set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param availabilitySetName The name of the availability set.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String availabilitySetName, Context context);
+
+ /**
+ * Retrieves information about an availability set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param availabilitySetName The name of the availability set.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the availability set that the virtual machine should be assigned to.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AvailabilitySetInner getByResourceGroup(String resourceGroupName, String availabilitySetName);
+
+ /**
+ * Retrieves information about an availability set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param availabilitySetName The name of the availability set.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the availability set that the virtual machine should be assigned to along
+ * with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String availabilitySetName, Context context);
+
+ /**
+ * Lists all availability sets in a subscription.
+ *
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Availability Set operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Lists all availability sets in a subscription.
+ *
+ * @param expand The expand expression to apply to the operation. Allowed values are 'instanceView'.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Availability Set operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String expand, Context context);
+
+ /**
+ * Lists all availability sets in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Availability Set operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Lists all availability sets in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Availability Set operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * 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.
+ * @param availabilitySetName The name of the availability set.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Virtual Machine operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listAvailableSizes(String resourceGroupName, String availabilitySetName);
+
+ /**
+ * 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.
+ * @param availabilitySetName The name of the availability set.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Virtual Machine operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listAvailableSizes(
+ String resourceGroupName, String availabilitySetName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationGroupsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationGroupsClient.java
new file mode 100644
index 0000000000000..c79ea9706f51b
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationGroupsClient.java
@@ -0,0 +1,232 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationGroupInner;
+import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupInstanceViewTypes;
+import com.azure.resourcemanager.compute.generated.models.CapacityReservationGroupUpdate;
+import com.azure.resourcemanager.compute.generated.models.ExpandTypesForGetCapacityReservationGroups;
+
+/** An instance of this class provides access to all the operations defined in CapacityReservationGroupsClient. */
+public interface CapacityReservationGroupsClient {
+ /**
+ * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only
+ * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param parameters Parameters supplied to the Create capacity reservation Group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation group that the capacity reservations should be
+ * assigned to.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CapacityReservationGroupInner createOrUpdate(
+ String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupInner parameters);
+
+ /**
+ * The operation to create or update a capacity reservation group. When updating a capacity reservation group, only
+ * tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param parameters Parameters supplied to the Create capacity reservation Group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation group that the capacity reservations should be
+ * assigned to along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response createOrUpdateWithResponse(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ CapacityReservationGroupInner parameters,
+ Context context);
+
+ /**
+ * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may
+ * be modified.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param parameters Parameters supplied to the Update capacity reservation Group operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation group that the capacity reservations should be
+ * assigned to.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CapacityReservationGroupInner update(
+ String resourceGroupName, String capacityReservationGroupName, CapacityReservationGroupUpdate parameters);
+
+ /**
+ * The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may
+ * be modified.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param parameters Parameters supplied to the Update capacity reservation Group operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation group that the capacity reservations should be
+ * assigned to along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ CapacityReservationGroupUpdate parameters,
+ Context context);
+
+ /**
+ * 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.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String capacityReservationGroupName);
+
+ /**
+ * 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.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String capacityReservationGroupName, Context context);
+
+ /**
+ * The operation that retrieves information about a capacity reservation group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation group that the capacity reservations should be
+ * assigned to.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CapacityReservationGroupInner getByResourceGroup(String resourceGroupName, String capacityReservationGroupName);
+
+ /**
+ * The operation that retrieves information about a capacity reservation group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param expand 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation group that the capacity reservations should be
+ * assigned to along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ CapacityReservationGroupInstanceViewTypes expand,
+ Context context);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List capacity reservation group with resource group response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * 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.
+ * @param expand 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List capacity reservation group with resource group response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(
+ String resourceGroupName, ExpandTypesForGetCapacityReservationGroups expand, Context context);
+
+ /**
+ * 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.
+ *
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List capacity reservation group with resource group response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * 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 expand 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List capacity reservation group with resource group response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ ExpandTypesForGetCapacityReservationGroups expand, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationsClient.java
new file mode 100644
index 0000000000000..62bfab485e236
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CapacityReservationsClient.java
@@ -0,0 +1,340 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.CapacityReservationInner;
+import com.azure.resourcemanager.compute.generated.models.CapacityReservationInstanceViewTypes;
+import com.azure.resourcemanager.compute.generated.models.CapacityReservationUpdate;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in CapacityReservationsClient. */
+public interface CapacityReservationsClient {
+ /**
+ * 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.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CapacityReservationInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ String capacityReservationName,
+ CapacityReservationInner parameters);
+
+ /**
+ * 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.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CapacityReservationInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ String capacityReservationName,
+ CapacityReservationInner parameters,
+ Context context);
+
+ /**
+ * 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.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CapacityReservationInner createOrUpdate(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ String capacityReservationName,
+ CapacityReservationInner parameters);
+
+ /**
+ * 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.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CapacityReservationInner createOrUpdate(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ String capacityReservationName,
+ CapacityReservationInner parameters,
+ Context context);
+
+ /**
+ * The operation to update a capacity reservation.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CapacityReservationInner> beginUpdate(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ String capacityReservationName,
+ CapacityReservationUpdate parameters);
+
+ /**
+ * The operation to update a capacity reservation.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CapacityReservationInner> beginUpdate(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ String capacityReservationName,
+ CapacityReservationUpdate parameters,
+ Context context);
+
+ /**
+ * The operation to update a capacity reservation.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CapacityReservationInner update(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ String capacityReservationName,
+ CapacityReservationUpdate parameters);
+
+ /**
+ * The operation to update a capacity reservation.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CapacityReservationInner update(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ String capacityReservationName,
+ CapacityReservationUpdate parameters,
+ Context context);
+
+ /**
+ * 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.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param capacityReservationName The name of the capacity reservation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String capacityReservationGroupName, String capacityReservationName);
+
+ /**
+ * 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.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param capacityReservationName The name of the capacity reservation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String capacityReservationGroupName, String capacityReservationName, Context context);
+
+ /**
+ * 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.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param capacityReservationName The name of the capacity reservation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String capacityReservationGroupName, String capacityReservationName);
+
+ /**
+ * 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.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param capacityReservationName The name of the capacity reservation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(
+ String resourceGroupName, String capacityReservationGroupName, String capacityReservationName, Context context);
+
+ /**
+ * The operation that retrieves information about the capacity reservation.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param capacityReservationName The name of the capacity reservation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CapacityReservationInner get(
+ String resourceGroupName, String capacityReservationGroupName, String capacityReservationName);
+
+ /**
+ * The operation that retrieves information about the capacity reservation.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param capacityReservationName The name of the capacity reservation.
+ * @param expand 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the capacity reservation along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName,
+ String capacityReservationGroupName,
+ String capacityReservationName,
+ CapacityReservationInstanceViewTypes expand,
+ Context context);
+
+ /**
+ * 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.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list capacity reservation operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByCapacityReservationGroup(
+ String resourceGroupName, String capacityReservationGroupName);
+
+ /**
+ * 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.
+ * @param capacityReservationGroupName The name of the capacity reservation group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list capacity reservation operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByCapacityReservationGroup(
+ String resourceGroupName, String capacityReservationGroupName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceOperatingSystemsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceOperatingSystemsClient.java
new file mode 100644
index 0000000000000..e693802c57f15
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceOperatingSystemsClient.java
@@ -0,0 +1,148 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.OSFamilyInner;
+import com.azure.resourcemanager.compute.generated.fluent.models.OSVersionInner;
+
+/** An instance of this class provides access to all the operations defined in CloudServiceOperatingSystemsClient. */
+public interface CloudServiceOperatingSystemsClient {
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return properties of a guest operating system version that can be specified in the XML service configuration
+ * (.cscfg) for a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ OSVersionInner getOSVersion(String location, String osVersionName);
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return properties of a guest operating system version that can be specified in the XML service configuration
+ * (.cscfg) for a cloud service along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getOSVersionWithResponse(String location, String osVersionName, Context context);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all guest operating system versions available to be specified in the XML service configuration
+ * (.cscfg) for a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listOSVersions(String location);
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all guest operating system versions available to be specified in the XML service configuration
+ * (.cscfg) for a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listOSVersions(String location, Context context);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return properties of a guest operating system family that can be specified in the XML service configuration
+ * (.cscfg) for a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ OSFamilyInner getOSFamily(String location, String osFamilyName);
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return properties of a guest operating system family that can be specified in the XML service configuration
+ * (.cscfg) for a cloud service along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getOSFamilyWithResponse(String location, String osFamilyName, Context context);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all guest operating system families available to be specified in the XML service configuration
+ * (.cscfg) for a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listOSFamilies(String location);
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all guest operating system families available to be specified in the XML service configuration
+ * (.cscfg) for a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listOSFamilies(String location, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRoleInstancesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRoleInstancesClient.java
new file mode 100644
index 0000000000000..d15301ea70019
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRoleInstancesClient.java
@@ -0,0 +1,414 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.StreamResponse;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceInner;
+import com.azure.resourcemanager.compute.generated.fluent.models.RoleInstanceViewInner;
+import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes;
+import java.io.InputStream;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in CloudServiceRoleInstancesClient. */
+public interface CloudServiceRoleInstancesClient {
+ /**
+ * Deletes a role instance from a cloud service.
+ *
+ * @param roleInstanceName Name of the role instance.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String roleInstanceName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Deletes a role instance from a cloud service.
+ *
+ * @param roleInstanceName Name of the role instance.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * Deletes a role instance from a cloud service.
+ *
+ * @param roleInstanceName Name of the role instance.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String roleInstanceName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Deletes a role instance from a cloud service.
+ *
+ * @param roleInstanceName Name of the role instance.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * Gets a role instance from a cloud service.
+ *
+ * @param roleInstanceName Name of the role instance.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a role instance from a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RoleInstanceInner get(String roleInstanceName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Gets a role instance from a cloud service.
+ *
+ * @param roleInstanceName Name of the role instance.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a role instance from a cloud service along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String roleInstanceName,
+ String resourceGroupName,
+ String cloudServiceName,
+ InstanceViewTypes expand,
+ Context context);
+
+ /**
+ * Retrieves information about the run-time state of a role instance in a cloud service.
+ *
+ * @param roleInstanceName Name of the role instance.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the instance view of the role instance.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RoleInstanceViewInner getInstanceView(String roleInstanceName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Retrieves information about the run-time state of a role instance in a cloud service.
+ *
+ * @param roleInstanceName Name of the role instance.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the instance view of the role instance along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getInstanceViewWithResponse(
+ String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list of all role instances in a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param expand The expand expression to apply to the operation. 'UserData' is not supported for cloud services.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list of all role instances in a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String resourceGroupName, String cloudServiceName, InstanceViewTypes expand, Context context);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRestart(
+ String roleInstanceName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRestart(
+ String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void restart(String roleInstanceName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void restart(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginReimage(
+ String roleInstanceName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginReimage(
+ String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void reimage(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRebuild(
+ String roleInstanceName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRebuild(
+ String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void rebuild(String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * Gets a remote desktop file for a role instance in a cloud service.
+ *
+ * @param roleInstanceName Name of the role instance.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a remote desktop file for a role instance in a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ InputStream getRemoteDesktopFile(String roleInstanceName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Gets a remote desktop file for a role instance in a cloud service.
+ *
+ * @param roleInstanceName Name of the role instance.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a remote desktop file for a role instance in a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ StreamResponse getRemoteDesktopFileWithResponse(
+ String roleInstanceName, String resourceGroupName, String cloudServiceName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRolesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRolesClient.java
new file mode 100644
index 0000000000000..18b2106e3d5d7
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServiceRolesClient.java
@@ -0,0 +1,78 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceRoleInner;
+
+/** An instance of this class provides access to all the operations defined in CloudServiceRolesClient. */
+public interface CloudServiceRolesClient {
+ /**
+ * Gets a role from a cloud service.
+ *
+ * @param roleName Name of the role.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a role from a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CloudServiceRoleInner get(String roleName, String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Gets a role from a cloud service.
+ *
+ * @param roleName Name of the role.
+ * @param resourceGroupName The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a role from a cloud service along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String roleName, String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all roles in a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 The resourceGroupName parameter.
+ * @param cloudServiceName The cloudServiceName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all roles in a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String cloudServiceName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesClient.java
new file mode 100644
index 0000000000000..29994381254a9
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesClient.java
@@ -0,0 +1,779 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInner;
+import com.azure.resourcemanager.compute.generated.fluent.models.CloudServiceInstanceViewInner;
+import com.azure.resourcemanager.compute.generated.models.CloudServiceUpdate;
+import com.azure.resourcemanager.compute.generated.models.RoleInstances;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in CloudServicesClient. */
+public interface CloudServicesClient {
+ /**
+ * 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 parameters The cloud service object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CloudServiceInner> beginCreateOrUpdate(
+ String resourceGroupName, String cloudServiceName, CloudServiceInner parameters);
+
+ /**
+ * 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 parameters The cloud service object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CloudServiceInner> beginCreateOrUpdate(
+ String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context);
+
+ /**
+ * 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 parameters The cloud service object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CloudServiceInner createOrUpdate(String resourceGroupName, String cloudServiceName, CloudServiceInner parameters);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CloudServiceInner createOrUpdate(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 parameters The cloud service object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CloudServiceInner createOrUpdate(
+ String resourceGroupName, String cloudServiceName, CloudServiceInner parameters, Context context);
+
+ /**
+ * Update a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param parameters The cloud service object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CloudServiceInner> beginUpdate(
+ String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters);
+
+ /**
+ * Update a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param parameters The cloud service object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CloudServiceInner> beginUpdate(
+ String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context);
+
+ /**
+ * Update a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param parameters The cloud service object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CloudServiceInner update(String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters);
+
+ /**
+ * Update a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CloudServiceInner update(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Update a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param parameters The cloud service object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CloudServiceInner update(
+ String resourceGroupName, String cloudServiceName, CloudServiceUpdate parameters, Context context);
+
+ /**
+ * Deletes a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Deletes a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * Deletes a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Deletes a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * Display information about a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CloudServiceInner getByResourceGroup(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Display information about a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return describes the cloud service along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * Gets the status of a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the status of a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CloudServiceInstanceViewInner getInstanceView(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Gets the status of a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the status of a cloud service along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getInstanceViewWithResponse(
+ String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * 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.
+ *
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all cloud services in the subscription, regardless of the associated resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all cloud services in the subscription, regardless of the associated resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all cloud services under a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all cloud services under a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Starts the cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginStart(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Starts the cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginStart(String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * Starts the cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void start(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Starts the cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void start(String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginPowerOff(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginPowerOff(
+ String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void powerOff(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void powerOff(String resourceGroupName, String cloudServiceName, Context context);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRestart(
+ String resourceGroupName, String cloudServiceName, RoleInstances parameters);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRestart(
+ String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void restart(String resourceGroupName, String cloudServiceName, RoleInstances parameters);
+
+ /**
+ * Restarts one or more role instances in a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void restart(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void restart(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginReimage(
+ String resourceGroupName, String cloudServiceName, RoleInstances parameters);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginReimage(
+ String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void reimage(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void reimage(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRebuild(
+ String resourceGroupName, String cloudServiceName, RoleInstances parameters);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRebuild(
+ String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void rebuild(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 parameters List of cloud service role instance names.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void rebuild(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context);
+
+ /**
+ * Deletes role instances in a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param parameters List of cloud service role instance names.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDeleteInstances(
+ String resourceGroupName, String cloudServiceName, RoleInstances parameters);
+
+ /**
+ * Deletes role instances in a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param parameters List of cloud service role instance names.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDeleteInstances(
+ String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context);
+
+ /**
+ * Deletes role instances in a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param parameters List of cloud service role instance names.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void deleteInstances(String resourceGroupName, String cloudServiceName, RoleInstances parameters);
+
+ /**
+ * Deletes role instances in a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void deleteInstances(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * Deletes role instances in a cloud service.
+ *
+ * @param resourceGroupName Name of the resource group.
+ * @param cloudServiceName Name of the cloud service.
+ * @param parameters List of cloud service role instance names.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void deleteInstances(String resourceGroupName, String cloudServiceName, RoleInstances parameters, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesUpdateDomainsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesUpdateDomainsClient.java
new file mode 100644
index 0000000000000..a8a5b437c752a
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CloudServicesUpdateDomainsClient.java
@@ -0,0 +1,179 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.UpdateDomainInner;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in CloudServicesUpdateDomainsClient. */
+public interface CloudServicesUpdateDomainsClient {
+ /**
+ * 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 parameters The update domain object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginWalkUpdateDomain(
+ String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters);
+
+ /**
+ * 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 parameters The update domain object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginWalkUpdateDomain(
+ String resourceGroupName,
+ String cloudServiceName,
+ int updateDomain,
+ UpdateDomainInner parameters,
+ Context context);
+
+ /**
+ * 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 parameters The update domain object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void walkUpdateDomain(
+ String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void walkUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain);
+
+ /**
+ * 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 parameters The update domain object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void walkUpdateDomain(
+ String resourceGroupName,
+ String cloudServiceName,
+ int updateDomain,
+ UpdateDomainInner parameters,
+ Context context);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the specified update domain of a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ UpdateDomainInner getUpdateDomain(String resourceGroupName, String cloudServiceName, int updateDomain);
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the specified update domain of a cloud service along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getUpdateDomainWithResponse(
+ String resourceGroupName, String cloudServiceName, int updateDomain, Context context);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update domains in a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listUpdateDomains(String resourceGroupName, String cloudServiceName);
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update domains in a cloud service.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listUpdateDomains(
+ String resourceGroupName, String cloudServiceName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleriesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleriesClient.java
new file mode 100644
index 0000000000000..fef4ed14f6b5b
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleriesClient.java
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryInner;
+
+/** An instance of this class provides access to all the operations defined in CommunityGalleriesClient. */
+public interface CommunityGalleriesClient {
+ /**
+ * Get a community gallery by gallery public name.
+ *
+ * @param location Resource location.
+ * @param publicGalleryName The public name of the community gallery.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a community gallery by gallery public name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CommunityGalleryInner get(String location, String publicGalleryName);
+
+ /**
+ * Get a community gallery by gallery public name.
+ *
+ * @param location Resource location.
+ * @param publicGalleryName The public name of the community gallery.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a community gallery by gallery public name along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String location, String publicGalleryName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImageVersionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImageVersionsClient.java
new file mode 100644
index 0000000000000..d205826fca0cf
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImageVersionsClient.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageVersionInner;
+
+/** An instance of this class provides access to all the operations defined in CommunityGalleryImageVersionsClient. */
+public interface CommunityGalleryImageVersionsClient {
+ /**
+ * Get a community gallery image version.
+ *
+ * @param location Resource location.
+ * @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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a community gallery image version.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CommunityGalleryImageVersionInner get(
+ String location, String publicGalleryName, String galleryImageName, String galleryImageVersionName);
+
+ /**
+ * Get a community gallery image version.
+ *
+ * @param location Resource location.
+ * @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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a community gallery image version along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String location,
+ String publicGalleryName,
+ String galleryImageName,
+ String galleryImageVersionName,
+ Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImagesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImagesClient.java
new file mode 100644
index 0000000000000..daf4bdd4652f2
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/CommunityGalleryImagesClient.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.CommunityGalleryImageInner;
+
+/** An instance of this class provides access to all the operations defined in CommunityGalleryImagesClient. */
+public interface CommunityGalleryImagesClient {
+ /**
+ * Get a community gallery image.
+ *
+ * @param location Resource location.
+ * @param publicGalleryName The public name of the community gallery.
+ * @param galleryImageName The name of the community gallery image definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a community gallery image.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CommunityGalleryImageInner get(String location, String publicGalleryName, String galleryImageName);
+
+ /**
+ * Get a community gallery image.
+ *
+ * @param location Resource location.
+ * @param publicGalleryName The public name of the community gallery.
+ * @param galleryImageName The name of the community gallery image definition.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a community gallery image along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String location, String publicGalleryName, String galleryImageName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ComputeManagementClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ComputeManagementClient.java
new file mode 100644
index 0000000000000..b2da29dac9f6b
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/ComputeManagementClient.java
@@ -0,0 +1,383 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for ComputeManagementClient class. */
+public interface ComputeManagementClient {
+ /**
+ * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+ * part of the URI for every service call.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the AvailabilitySetsClient object to access its operations.
+ *
+ * @return the AvailabilitySetsClient object.
+ */
+ AvailabilitySetsClient getAvailabilitySets();
+
+ /**
+ * Gets the ProximityPlacementGroupsClient object to access its operations.
+ *
+ * @return the ProximityPlacementGroupsClient object.
+ */
+ ProximityPlacementGroupsClient getProximityPlacementGroups();
+
+ /**
+ * Gets the DedicatedHostGroupsClient object to access its operations.
+ *
+ * @return the DedicatedHostGroupsClient object.
+ */
+ DedicatedHostGroupsClient getDedicatedHostGroups();
+
+ /**
+ * Gets the DedicatedHostsClient object to access its operations.
+ *
+ * @return the DedicatedHostsClient object.
+ */
+ DedicatedHostsClient getDedicatedHosts();
+
+ /**
+ * Gets the SshPublicKeysClient object to access its operations.
+ *
+ * @return the SshPublicKeysClient object.
+ */
+ SshPublicKeysClient getSshPublicKeys();
+
+ /**
+ * Gets the VirtualMachineExtensionImagesClient object to access its operations.
+ *
+ * @return the VirtualMachineExtensionImagesClient object.
+ */
+ VirtualMachineExtensionImagesClient getVirtualMachineExtensionImages();
+
+ /**
+ * Gets the VirtualMachineExtensionsClient object to access its operations.
+ *
+ * @return the VirtualMachineExtensionsClient object.
+ */
+ VirtualMachineExtensionsClient getVirtualMachineExtensions();
+
+ /**
+ * Gets the VirtualMachineImagesClient object to access its operations.
+ *
+ * @return the VirtualMachineImagesClient object.
+ */
+ VirtualMachineImagesClient getVirtualMachineImages();
+
+ /**
+ * Gets the VirtualMachineImagesEdgeZonesClient object to access its operations.
+ *
+ * @return the VirtualMachineImagesEdgeZonesClient object.
+ */
+ VirtualMachineImagesEdgeZonesClient getVirtualMachineImagesEdgeZones();
+
+ /**
+ * Gets the UsagesClient object to access its operations.
+ *
+ * @return the UsagesClient object.
+ */
+ UsagesClient getUsages();
+
+ /**
+ * Gets the VirtualMachinesClient object to access its operations.
+ *
+ * @return the VirtualMachinesClient object.
+ */
+ VirtualMachinesClient getVirtualMachines();
+
+ /**
+ * Gets the VirtualMachineScaleSetsClient object to access its operations.
+ *
+ * @return the VirtualMachineScaleSetsClient object.
+ */
+ VirtualMachineScaleSetsClient getVirtualMachineScaleSets();
+
+ /**
+ * Gets the VirtualMachineSizesClient object to access its operations.
+ *
+ * @return the VirtualMachineSizesClient object.
+ */
+ VirtualMachineSizesClient getVirtualMachineSizes();
+
+ /**
+ * Gets the ImagesClient object to access its operations.
+ *
+ * @return the ImagesClient object.
+ */
+ ImagesClient getImages();
+
+ /**
+ * Gets the RestorePointCollectionsClient object to access its operations.
+ *
+ * @return the RestorePointCollectionsClient object.
+ */
+ RestorePointCollectionsClient getRestorePointCollections();
+
+ /**
+ * Gets the RestorePointsClient object to access its operations.
+ *
+ * @return the RestorePointsClient object.
+ */
+ RestorePointsClient getRestorePoints();
+
+ /**
+ * Gets the CapacityReservationGroupsClient object to access its operations.
+ *
+ * @return the CapacityReservationGroupsClient object.
+ */
+ CapacityReservationGroupsClient getCapacityReservationGroups();
+
+ /**
+ * Gets the CapacityReservationsClient object to access its operations.
+ *
+ * @return the CapacityReservationsClient object.
+ */
+ CapacityReservationsClient getCapacityReservations();
+
+ /**
+ * Gets the VirtualMachineScaleSetExtensionsClient object to access its operations.
+ *
+ * @return the VirtualMachineScaleSetExtensionsClient object.
+ */
+ VirtualMachineScaleSetExtensionsClient getVirtualMachineScaleSetExtensions();
+
+ /**
+ * Gets the VirtualMachineScaleSetRollingUpgradesClient object to access its operations.
+ *
+ * @return the VirtualMachineScaleSetRollingUpgradesClient object.
+ */
+ VirtualMachineScaleSetRollingUpgradesClient getVirtualMachineScaleSetRollingUpgrades();
+
+ /**
+ * Gets the VirtualMachineScaleSetVMExtensionsClient object to access its operations.
+ *
+ * @return the VirtualMachineScaleSetVMExtensionsClient object.
+ */
+ VirtualMachineScaleSetVMExtensionsClient getVirtualMachineScaleSetVMExtensions();
+
+ /**
+ * Gets the VirtualMachineScaleSetVMsClient object to access its operations.
+ *
+ * @return the VirtualMachineScaleSetVMsClient object.
+ */
+ VirtualMachineScaleSetVMsClient getVirtualMachineScaleSetVMs();
+
+ /**
+ * Gets the LogAnalyticsClient object to access its operations.
+ *
+ * @return the LogAnalyticsClient object.
+ */
+ LogAnalyticsClient getLogAnalytics();
+
+ /**
+ * Gets the VirtualMachineRunCommandsClient object to access its operations.
+ *
+ * @return the VirtualMachineRunCommandsClient object.
+ */
+ VirtualMachineRunCommandsClient getVirtualMachineRunCommands();
+
+ /**
+ * Gets the VirtualMachineScaleSetVMRunCommandsClient object to access its operations.
+ *
+ * @return the VirtualMachineScaleSetVMRunCommandsClient object.
+ */
+ VirtualMachineScaleSetVMRunCommandsClient getVirtualMachineScaleSetVMRunCommands();
+
+ /**
+ * Gets the ResourceSkusClient object to access its operations.
+ *
+ * @return the ResourceSkusClient object.
+ */
+ ResourceSkusClient getResourceSkus();
+
+ /**
+ * Gets the DisksClient object to access its operations.
+ *
+ * @return the DisksClient object.
+ */
+ DisksClient getDisks();
+
+ /**
+ * Gets the SnapshotsClient object to access its operations.
+ *
+ * @return the SnapshotsClient object.
+ */
+ SnapshotsClient getSnapshots();
+
+ /**
+ * Gets the DiskEncryptionSetsClient object to access its operations.
+ *
+ * @return the DiskEncryptionSetsClient object.
+ */
+ DiskEncryptionSetsClient getDiskEncryptionSets();
+
+ /**
+ * Gets the DiskAccessesClient object to access its operations.
+ *
+ * @return the DiskAccessesClient object.
+ */
+ DiskAccessesClient getDiskAccesses();
+
+ /**
+ * Gets the DiskRestorePointsClient object to access its operations.
+ *
+ * @return the DiskRestorePointsClient object.
+ */
+ DiskRestorePointsClient getDiskRestorePoints();
+
+ /**
+ * Gets the GalleriesClient object to access its operations.
+ *
+ * @return the GalleriesClient object.
+ */
+ GalleriesClient getGalleries();
+
+ /**
+ * Gets the GalleryImagesClient object to access its operations.
+ *
+ * @return the GalleryImagesClient object.
+ */
+ GalleryImagesClient getGalleryImages();
+
+ /**
+ * Gets the GalleryImageVersionsClient object to access its operations.
+ *
+ * @return the GalleryImageVersionsClient object.
+ */
+ GalleryImageVersionsClient getGalleryImageVersions();
+
+ /**
+ * Gets the GalleryApplicationsClient object to access its operations.
+ *
+ * @return the GalleryApplicationsClient object.
+ */
+ GalleryApplicationsClient getGalleryApplications();
+
+ /**
+ * Gets the GalleryApplicationVersionsClient object to access its operations.
+ *
+ * @return the GalleryApplicationVersionsClient object.
+ */
+ GalleryApplicationVersionsClient getGalleryApplicationVersions();
+
+ /**
+ * Gets the GallerySharingProfilesClient object to access its operations.
+ *
+ * @return the GallerySharingProfilesClient object.
+ */
+ GallerySharingProfilesClient getGallerySharingProfiles();
+
+ /**
+ * Gets the SharedGalleriesClient object to access its operations.
+ *
+ * @return the SharedGalleriesClient object.
+ */
+ SharedGalleriesClient getSharedGalleries();
+
+ /**
+ * Gets the SharedGalleryImagesClient object to access its operations.
+ *
+ * @return the SharedGalleryImagesClient object.
+ */
+ SharedGalleryImagesClient getSharedGalleryImages();
+
+ /**
+ * Gets the SharedGalleryImageVersionsClient object to access its operations.
+ *
+ * @return the SharedGalleryImageVersionsClient object.
+ */
+ SharedGalleryImageVersionsClient getSharedGalleryImageVersions();
+
+ /**
+ * Gets the CommunityGalleriesClient object to access its operations.
+ *
+ * @return the CommunityGalleriesClient object.
+ */
+ CommunityGalleriesClient getCommunityGalleries();
+
+ /**
+ * Gets the CommunityGalleryImagesClient object to access its operations.
+ *
+ * @return the CommunityGalleryImagesClient object.
+ */
+ CommunityGalleryImagesClient getCommunityGalleryImages();
+
+ /**
+ * Gets the CommunityGalleryImageVersionsClient object to access its operations.
+ *
+ * @return the CommunityGalleryImageVersionsClient object.
+ */
+ CommunityGalleryImageVersionsClient getCommunityGalleryImageVersions();
+
+ /**
+ * Gets the CloudServiceRoleInstancesClient object to access its operations.
+ *
+ * @return the CloudServiceRoleInstancesClient object.
+ */
+ CloudServiceRoleInstancesClient getCloudServiceRoleInstances();
+
+ /**
+ * Gets the CloudServiceRolesClient object to access its operations.
+ *
+ * @return the CloudServiceRolesClient object.
+ */
+ CloudServiceRolesClient getCloudServiceRoles();
+
+ /**
+ * Gets the CloudServicesClient object to access its operations.
+ *
+ * @return the CloudServicesClient object.
+ */
+ CloudServicesClient getCloudServices();
+
+ /**
+ * Gets the CloudServicesUpdateDomainsClient object to access its operations.
+ *
+ * @return the CloudServicesUpdateDomainsClient object.
+ */
+ CloudServicesUpdateDomainsClient getCloudServicesUpdateDomains();
+
+ /**
+ * Gets the CloudServiceOperatingSystemsClient object to access its operations.
+ *
+ * @return the CloudServiceOperatingSystemsClient object.
+ */
+ CloudServiceOperatingSystemsClient getCloudServiceOperatingSystems();
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.java
new file mode 100644
index 0000000000000..68a93a6d27bb3
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostGroupsClient.java
@@ -0,0 +1,203 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostGroupInner;
+import com.azure.resourcemanager.compute.generated.models.DedicatedHostGroupUpdate;
+import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes;
+
+/** An instance of this class provides access to all the operations defined in DedicatedHostGroupsClient. */
+public interface DedicatedHostGroupsClient {
+ /**
+ * 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.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param parameters Parameters supplied to the Create Dedicated Host Group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DedicatedHostGroupInner createOrUpdate(
+ String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters);
+
+ /**
+ * 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.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param parameters Parameters supplied to the Create Dedicated Host Group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to along
+ * with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response createOrUpdateWithResponse(
+ String resourceGroupName, String hostGroupName, DedicatedHostGroupInner parameters, Context context);
+
+ /**
+ * Update an dedicated host group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param parameters Parameters supplied to the Update Dedicated Host Group operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DedicatedHostGroupInner update(String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters);
+
+ /**
+ * Update an dedicated host group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param parameters Parameters supplied to the Update Dedicated Host Group operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to along
+ * with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(
+ String resourceGroupName, String hostGroupName, DedicatedHostGroupUpdate parameters, Context context);
+
+ /**
+ * Delete a dedicated host group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String hostGroupName);
+
+ /**
+ * Delete a dedicated host group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String hostGroupName, Context context);
+
+ /**
+ * Retrieves information about a dedicated host group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DedicatedHostGroupInner getByResourceGroup(String resourceGroupName, String hostGroupName);
+
+ /**
+ * Retrieves information about a dedicated host group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param expand 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the dedicated host group that the dedicated hosts should be assigned to along
+ * with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String hostGroupName, InstanceViewTypes expand, Context context);
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Dedicated Host Group with resource group response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Dedicated Host Group with resource group response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * 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.
+ *
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Dedicated Host Group with resource group response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Dedicated Host Group with resource group response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostsClient.java
new file mode 100644
index 0000000000000..ff08a384f4455
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DedicatedHostsClient.java
@@ -0,0 +1,379 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.DedicatedHostInner;
+import com.azure.resourcemanager.compute.generated.models.DedicatedHostUpdate;
+import com.azure.resourcemanager.compute.generated.models.InstanceViewTypes;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in DedicatedHostsClient. */
+public interface DedicatedHostsClient {
+ /**
+ * Create or update a dedicated host .
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Dedicated host along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DedicatedHostInner> beginCreateOrUpdate(
+ String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters);
+
+ /**
+ * Create or update a dedicated host .
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Dedicated host along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DedicatedHostInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String hostGroupName,
+ String hostname,
+ DedicatedHostInner parameters,
+ Context context);
+
+ /**
+ * Create or update a dedicated host .
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Dedicated host.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DedicatedHostInner createOrUpdate(
+ String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters);
+
+ /**
+ * Create or update a dedicated host .
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Dedicated host.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DedicatedHostInner createOrUpdate(
+ String resourceGroupName,
+ String hostGroupName,
+ String hostname,
+ DedicatedHostInner parameters,
+ Context context);
+
+ /**
+ * Update an dedicated host .
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Dedicated host along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DedicatedHostInner> beginUpdate(
+ String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters);
+
+ /**
+ * Update an dedicated host .
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Dedicated host along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DedicatedHostInner> beginUpdate(
+ String resourceGroupName,
+ String hostGroupName,
+ String hostname,
+ DedicatedHostUpdate parameters,
+ Context context);
+
+ /**
+ * Update an dedicated host .
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Dedicated host.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DedicatedHostInner update(
+ String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters);
+
+ /**
+ * Update an dedicated host .
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Dedicated host.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DedicatedHostInner update(
+ String resourceGroupName,
+ String hostGroupName,
+ String hostname,
+ DedicatedHostUpdate parameters,
+ Context context);
+
+ /**
+ * Delete a dedicated host.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param hostname The name of the dedicated host.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String hostGroupName, String hostname);
+
+ /**
+ * Delete a dedicated host.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param hostname The name of the dedicated host.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String hostGroupName, String hostname, Context context);
+
+ /**
+ * Delete a dedicated host.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param hostname The name of the dedicated host.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String hostGroupName, String hostname);
+
+ /**
+ * Delete a dedicated host.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param hostname The name of the dedicated host.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String hostGroupName, String hostname, Context context);
+
+ /**
+ * Retrieves information about a dedicated host.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param hostname The name of the dedicated host.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Dedicated host.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DedicatedHostInner get(String resourceGroupName, String hostGroupName, String hostname);
+
+ /**
+ * Retrieves information about a dedicated host.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param hostname The name of the dedicated host.
+ * @param expand 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Dedicated host along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String hostGroupName, String hostname, InstanceViewTypes expand, Context context);
+
+ /**
+ * 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.
+ * @param hostGroupName The name of the dedicated host group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list dedicated host operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName);
+
+ /**
+ * 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.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list dedicated host operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByHostGroup(String resourceGroupName, String hostGroupName, Context context);
+
+ /**
+ * 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/en-us/azure/service-health/resource-health-overview for more details.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param hostname The name of the dedicated host.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRestart(String resourceGroupName, String hostGroupName, String hostname);
+
+ /**
+ * 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/en-us/azure/service-health/resource-health-overview for more details.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param hostname The name of the dedicated host.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRestart(
+ String resourceGroupName, String hostGroupName, String hostname, Context context);
+
+ /**
+ * 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/en-us/azure/service-health/resource-health-overview for more details.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param hostname The name of the dedicated host.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void restart(String resourceGroupName, String hostGroupName, String hostname);
+
+ /**
+ * 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/en-us/azure/service-health/resource-health-overview for more details.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param hostGroupName The name of the dedicated host group.
+ * @param hostname The name of the dedicated host.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void restart(String resourceGroupName, String hostGroupName, String hostname, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskAccessesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskAccessesClient.java
new file mode 100644
index 0000000000000..ce5cdbfca700e
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskAccessesClient.java
@@ -0,0 +1,596 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.DiskAccessInner;
+import com.azure.resourcemanager.compute.generated.fluent.models.PrivateEndpointConnectionInner;
+import com.azure.resourcemanager.compute.generated.fluent.models.PrivateLinkResourceListResultInner;
+import com.azure.resourcemanager.compute.generated.models.DiskAccessUpdate;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in DiskAccessesClient. */
+public interface DiskAccessesClient {
+ /**
+ * Creates or updates a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk access resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskAccessInner> beginCreateOrUpdate(
+ String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess);
+
+ /**
+ * Creates or updates a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk access resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskAccessInner> beginCreateOrUpdate(
+ String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess, Context context);
+
+ /**
+ * Creates or updates a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk access resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskAccessInner createOrUpdate(String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess);
+
+ /**
+ * Creates or updates a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk access resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskAccessInner createOrUpdate(
+ String resourceGroupName, String diskAccessName, DiskAccessInner diskAccess, Context context);
+
+ /**
+ * Updates (patches) a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk access resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskAccessInner> beginUpdate(
+ String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess);
+
+ /**
+ * Updates (patches) a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk access resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskAccessInner> beginUpdate(
+ String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess, Context context);
+
+ /**
+ * Updates (patches) a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk access resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskAccessInner update(String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess);
+
+ /**
+ * Updates (patches) a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk access resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskAccessInner update(
+ String resourceGroupName, String diskAccessName, DiskAccessUpdate diskAccess, Context context);
+
+ /**
+ * Gets information about a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about a disk access resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskAccessInner getByResourceGroup(String resourceGroupName, String diskAccessName);
+
+ /**
+ * Gets information about a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about a disk access resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String diskAccessName, Context context);
+
+ /**
+ * Deletes a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String diskAccessName);
+
+ /**
+ * Deletes a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String diskAccessName, Context context);
+
+ /**
+ * Deletes a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String diskAccessName);
+
+ /**
+ * Deletes a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String diskAccessName, Context context);
+
+ /**
+ * Lists all the disk access resources under a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List disk access operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Lists all the disk access resources under a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List disk access operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Lists all the disk access resources under a subscription.
+ *
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List disk access operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Lists all the disk access resources under a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List disk access operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Gets the private link resources possible under disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the private link resources possible under disk access resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateLinkResourceListResultInner getPrivateLinkResources(String resourceGroupName, String diskAccessName);
+
+ /**
+ * Gets the private link resources possible under disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the private link resources possible under disk access resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getPrivateLinkResourcesWithResponse(
+ String resourceGroupName, String diskAccessName, Context context);
+
+ /**
+ * 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.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, PrivateEndpointConnectionInner>
+ beginUpdateAPrivateEndpointConnection(
+ String resourceGroupName,
+ String diskAccessName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner privateEndpointConnection);
+
+ /**
+ * 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.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, PrivateEndpointConnectionInner>
+ beginUpdateAPrivateEndpointConnection(
+ String resourceGroupName,
+ String diskAccessName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner privateEndpointConnection,
+ Context context);
+
+ /**
+ * 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.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the Private Endpoint Connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateEndpointConnectionInner updateAPrivateEndpointConnection(
+ String resourceGroupName,
+ String diskAccessName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner privateEndpointConnection);
+
+ /**
+ * 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.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the Private Endpoint Connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateEndpointConnectionInner updateAPrivateEndpointConnection(
+ String resourceGroupName,
+ String diskAccessName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner privateEndpointConnection,
+ Context context);
+
+ /**
+ * Gets information about a private endpoint connection under a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about a private endpoint connection under a disk access resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateEndpointConnectionInner getAPrivateEndpointConnection(
+ String resourceGroupName, String diskAccessName, String privateEndpointConnectionName);
+
+ /**
+ * Gets information about a private endpoint connection under a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about a private endpoint connection under a disk access resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getAPrivateEndpointConnectionWithResponse(
+ String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context);
+
+ /**
+ * Deletes a private endpoint connection under a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDeleteAPrivateEndpointConnection(
+ String resourceGroupName, String diskAccessName, String privateEndpointConnectionName);
+
+ /**
+ * Deletes a private endpoint connection under a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDeleteAPrivateEndpointConnection(
+ String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context);
+
+ /**
+ * Deletes a private endpoint connection under a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void deleteAPrivateEndpointConnection(
+ String resourceGroupName, String diskAccessName, String privateEndpointConnectionName);
+
+ /**
+ * Deletes a private endpoint connection under a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void deleteAPrivateEndpointConnection(
+ String resourceGroupName, String diskAccessName, String privateEndpointConnectionName, Context context);
+
+ /**
+ * List information about private endpoint connections under a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listPrivateEndpointConnections(
+ String resourceGroupName, String diskAccessName);
+
+ /**
+ * List information about private endpoint connections under a disk access resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listPrivateEndpointConnections(
+ String resourceGroupName, String diskAccessName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskEncryptionSetsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskEncryptionSetsClient.java
new file mode 100644
index 0000000000000..710a73e9c12cb
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskEncryptionSetsClient.java
@@ -0,0 +1,371 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.DiskEncryptionSetInner;
+import com.azure.resourcemanager.compute.generated.models.DiskEncryptionSetUpdate;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in DiskEncryptionSetsClient. */
+public interface DiskEncryptionSetsClient {
+ /**
+ * Creates or updates a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk encryption set resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate(
+ String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet);
+
+ /**
+ * Creates or updates a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk encryption set resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskEncryptionSetInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String diskEncryptionSetName,
+ DiskEncryptionSetInner diskEncryptionSet,
+ Context context);
+
+ /**
+ * Creates or updates a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk encryption set resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskEncryptionSetInner createOrUpdate(
+ String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet);
+
+ /**
+ * Creates or updates a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk encryption set resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskEncryptionSetInner createOrUpdate(
+ String resourceGroupName,
+ String diskEncryptionSetName,
+ DiskEncryptionSetInner diskEncryptionSet,
+ Context context);
+
+ /**
+ * Updates (patches) a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk encryption set resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskEncryptionSetInner> beginUpdate(
+ String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet);
+
+ /**
+ * Updates (patches) a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk encryption set resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskEncryptionSetInner> beginUpdate(
+ String resourceGroupName,
+ String diskEncryptionSetName,
+ DiskEncryptionSetUpdate diskEncryptionSet,
+ Context context);
+
+ /**
+ * Updates (patches) a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk encryption set resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskEncryptionSetInner update(
+ String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet);
+
+ /**
+ * Updates (patches) a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk encryption set resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskEncryptionSetInner update(
+ String resourceGroupName,
+ String diskEncryptionSetName,
+ DiskEncryptionSetUpdate diskEncryptionSet,
+ Context context);
+
+ /**
+ * Gets information about a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about a disk encryption set.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskEncryptionSetInner getByResourceGroup(String resourceGroupName, String diskEncryptionSetName);
+
+ /**
+ * Gets information about a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about a disk encryption set along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String diskEncryptionSetName, Context context);
+
+ /**
+ * Deletes a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String diskEncryptionSetName);
+
+ /**
+ * Deletes a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String diskEncryptionSetName, Context context);
+
+ /**
+ * Deletes a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String diskEncryptionSetName);
+
+ /**
+ * Deletes a disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String diskEncryptionSetName, Context context);
+
+ /**
+ * Lists all the disk encryption sets under a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List disk encryption set operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Lists all the disk encryption sets under a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List disk encryption set operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Lists all the disk encryption sets under a subscription.
+ *
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List disk encryption set operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Lists all the disk encryption sets under a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List disk encryption set operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Lists all resources that are encrypted with this disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List resources which are encrypted with the disk encryption set.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listAssociatedResources(String resourceGroupName, String diskEncryptionSetName);
+
+ /**
+ * Lists all resources that are encrypted with this disk encryption set.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List resources which are encrypted with the disk encryption set.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listAssociatedResources(
+ String resourceGroupName, String diskEncryptionSetName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskRestorePointsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskRestorePointsClient.java
new file mode 100644
index 0000000000000..b6b80b93a50ed
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DiskRestorePointsClient.java
@@ -0,0 +1,269 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner;
+import com.azure.resourcemanager.compute.generated.fluent.models.DiskRestorePointInner;
+import com.azure.resourcemanager.compute.generated.models.GrantAccessData;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in DiskRestorePointsClient. */
+public interface DiskRestorePointsClient {
+ /**
+ * Get disk restorePoint resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 disk restore point created.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk restorePoint resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskRestorePointInner get(
+ String resourceGroupName,
+ String restorePointCollectionName,
+ String vmRestorePointName,
+ String diskRestorePointName);
+
+ /**
+ * Get disk restorePoint resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 disk restore point created.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk restorePoint resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName,
+ String restorePointCollectionName,
+ String vmRestorePointName,
+ String diskRestorePointName,
+ Context context);
+
+ /**
+ * Lists diskRestorePoints under a vmRestorePoint.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Disk Restore Points operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByRestorePoint(
+ String resourceGroupName, String restorePointCollectionName, String vmRestorePointName);
+
+ /**
+ * Lists diskRestorePoints under a vmRestorePoint.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Disk Restore Points operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByRestorePoint(
+ String resourceGroupName, String restorePointCollectionName, String vmRestorePointName, Context context);
+
+ /**
+ * Grants access to a diskRestorePoint.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 disk restore point created.
+ * @param grantAccessData Access data object supplied in the body of the get disk access operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a disk access SAS uri along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AccessUriInner> beginGrantAccess(
+ String resourceGroupName,
+ String restorePointCollectionName,
+ String vmRestorePointName,
+ String diskRestorePointName,
+ GrantAccessData grantAccessData);
+
+ /**
+ * Grants access to a diskRestorePoint.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 disk restore point created.
+ * @param grantAccessData Access data object supplied in the body of the get disk access operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a disk access SAS uri along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AccessUriInner> beginGrantAccess(
+ String resourceGroupName,
+ String restorePointCollectionName,
+ String vmRestorePointName,
+ String diskRestorePointName,
+ GrantAccessData grantAccessData,
+ Context context);
+
+ /**
+ * Grants access to a diskRestorePoint.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 disk restore point created.
+ * @param grantAccessData Access data object supplied in the body of the get disk access operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a disk access SAS uri.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AccessUriInner grantAccess(
+ String resourceGroupName,
+ String restorePointCollectionName,
+ String vmRestorePointName,
+ String diskRestorePointName,
+ GrantAccessData grantAccessData);
+
+ /**
+ * Grants access to a diskRestorePoint.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 disk restore point created.
+ * @param grantAccessData Access data object supplied in the body of the get disk access operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a disk access SAS uri.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AccessUriInner grantAccess(
+ String resourceGroupName,
+ String restorePointCollectionName,
+ String vmRestorePointName,
+ String diskRestorePointName,
+ GrantAccessData grantAccessData,
+ Context context);
+
+ /**
+ * Revokes access to a diskRestorePoint.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 disk restore point created.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRevokeAccess(
+ String resourceGroupName,
+ String restorePointCollectionName,
+ String vmRestorePointName,
+ String diskRestorePointName);
+
+ /**
+ * Revokes access to a diskRestorePoint.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 disk restore point created.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRevokeAccess(
+ String resourceGroupName,
+ String restorePointCollectionName,
+ String vmRestorePointName,
+ String diskRestorePointName,
+ Context context);
+
+ /**
+ * Revokes access to a diskRestorePoint.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 disk restore point created.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void revokeAccess(
+ String resourceGroupName,
+ String restorePointCollectionName,
+ String vmRestorePointName,
+ String diskRestorePointName);
+
+ /**
+ * Revokes access to a diskRestorePoint.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 disk restore point created.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void revokeAccess(
+ String resourceGroupName,
+ String restorePointCollectionName,
+ String vmRestorePointName,
+ String diskRestorePointName,
+ Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DisksClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DisksClient.java
new file mode 100644
index 0000000000000..e06bc6448a2ec
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/DisksClient.java
@@ -0,0 +1,424 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.AccessUriInner;
+import com.azure.resourcemanager.compute.generated.fluent.models.DiskInner;
+import com.azure.resourcemanager.compute.generated.models.DiskUpdate;
+import com.azure.resourcemanager.compute.generated.models.GrantAccessData;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in DisksClient. */
+public interface DisksClient {
+ /**
+ * Creates or updates a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskInner> beginCreateOrUpdate(
+ String resourceGroupName, String diskName, DiskInner disk);
+
+ /**
+ * Creates or updates a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskInner> beginCreateOrUpdate(
+ String resourceGroupName, String diskName, DiskInner disk, Context context);
+
+ /**
+ * Creates or updates a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk);
+
+ /**
+ * Creates or updates a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskInner createOrUpdate(String resourceGroupName, String diskName, DiskInner disk, Context context);
+
+ /**
+ * Updates (patches) a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskInner> beginUpdate(
+ String resourceGroupName, String diskName, DiskUpdate disk);
+
+ /**
+ * Updates (patches) a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, DiskInner> beginUpdate(
+ String resourceGroupName, String diskName, DiskUpdate disk, Context context);
+
+ /**
+ * Updates (patches) a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk);
+
+ /**
+ * Updates (patches) a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return disk resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskInner update(String resourceGroupName, String diskName, DiskUpdate disk, Context context);
+
+ /**
+ * Gets information about a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about a disk.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskInner getByResourceGroup(String resourceGroupName, String diskName);
+
+ /**
+ * Gets information about a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about a disk along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(String resourceGroupName, String diskName, Context context);
+
+ /**
+ * Deletes a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String diskName);
+
+ /**
+ * Deletes a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String diskName, Context context);
+
+ /**
+ * Deletes a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String diskName);
+
+ /**
+ * Deletes a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String diskName, Context context);
+
+ /**
+ * Lists all the disks under a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Disks operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Lists all the disks under a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Disks operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Lists all the disks under a subscription.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Disks operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Lists all the disks under a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Disks operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Grants access to a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a disk access SAS uri along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AccessUriInner> beginGrantAccess(
+ String resourceGroupName, String diskName, GrantAccessData grantAccessData);
+
+ /**
+ * Grants access to a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a disk access SAS uri along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AccessUriInner> beginGrantAccess(
+ String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context);
+
+ /**
+ * Grants access to a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a disk access SAS uri.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AccessUriInner grantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData);
+
+ /**
+ * Grants access to a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a disk access SAS uri.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AccessUriInner grantAccess(
+ String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context);
+
+ /**
+ * Revokes access to a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String diskName);
+
+ /**
+ * Revokes access to a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginRevokeAccess(String resourceGroupName, String diskName, Context context);
+
+ /**
+ * Revokes access to a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void revokeAccess(String resourceGroupName, String diskName);
+
+ /**
+ * Revokes access to a disk.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void revokeAccess(String resourceGroupName, String diskName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleriesClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleriesClient.java
new file mode 100644
index 0000000000000..83f8742d238d9
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleriesClient.java
@@ -0,0 +1,299 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.GalleryInner;
+import com.azure.resourcemanager.compute.generated.models.GalleryUpdate;
+import com.azure.resourcemanager.compute.generated.models.SelectPermissions;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in GalleriesClient. */
+public interface GalleriesClient {
+ /**
+ * Create or update a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with
+ * dots and periods allowed in the middle. The maximum length is 80 characters.
+ * @param gallery Parameters supplied to the create or update Shared Image Gallery operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Shared Image Gallery that you want to create or update along with {@link
+ * Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryInner> beginCreateOrUpdate(
+ String resourceGroupName, String galleryName, GalleryInner gallery);
+
+ /**
+ * Create or update a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with
+ * dots and periods allowed in the middle. The maximum length is 80 characters.
+ * @param gallery Parameters supplied to the create or update Shared Image Gallery operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Shared Image Gallery that you want to create or update along with {@link
+ * Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryInner> beginCreateOrUpdate(
+ String resourceGroupName, String galleryName, GalleryInner gallery, Context context);
+
+ /**
+ * Create or update a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with
+ * dots and periods allowed in the middle. The maximum length is 80 characters.
+ * @param gallery Parameters supplied to the create or update Shared Image Gallery operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Shared Image Gallery that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryInner createOrUpdate(String resourceGroupName, String galleryName, GalleryInner gallery);
+
+ /**
+ * Create or update a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with
+ * dots and periods allowed in the middle. The maximum length is 80 characters.
+ * @param gallery Parameters supplied to the create or update Shared Image Gallery operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Shared Image Gallery that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryInner createOrUpdate(String resourceGroupName, String galleryName, GalleryInner gallery, Context context);
+
+ /**
+ * Update a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with
+ * dots and periods allowed in the middle. The maximum length is 80 characters.
+ * @param gallery Parameters supplied to the update Shared Image Gallery operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Shared Image Gallery that you want to create or update along with {@link
+ * Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryInner> beginUpdate(
+ String resourceGroupName, String galleryName, GalleryUpdate gallery);
+
+ /**
+ * Update a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with
+ * dots and periods allowed in the middle. The maximum length is 80 characters.
+ * @param gallery Parameters supplied to the update Shared Image Gallery operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Shared Image Gallery that you want to create or update along with {@link
+ * Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryInner> beginUpdate(
+ String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context);
+
+ /**
+ * Update a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with
+ * dots and periods allowed in the middle. The maximum length is 80 characters.
+ * @param gallery Parameters supplied to the update Shared Image Gallery operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Shared Image Gallery that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery);
+
+ /**
+ * Update a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with
+ * dots and periods allowed in the middle. The maximum length is 80 characters.
+ * @param gallery Parameters supplied to the update Shared Image Gallery operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Shared Image Gallery that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryInner update(String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context);
+
+ /**
+ * Retrieves information about a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Shared Image Gallery that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryInner getByResourceGroup(String resourceGroupName, String galleryName);
+
+ /**
+ * Retrieves information about a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery.
+ * @param select The select expression to apply on the operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the Shared Image Gallery that you want to create or update along with {@link
+ * Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String galleryName, SelectPermissions select, Context context);
+
+ /**
+ * Delete a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery to be deleted.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName);
+
+ /**
+ * Delete a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery to be deleted.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName, Context context);
+
+ /**
+ * Delete a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery to be deleted.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String galleryName);
+
+ /**
+ * Delete a Shared Image Gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery to be deleted.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String galleryName, Context context);
+
+ /**
+ * List galleries under a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Galleries operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List galleries under a resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Galleries operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * List galleries under a subscription.
+ *
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Galleries operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List galleries under a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Galleries operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationVersionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationVersionsClient.java
new file mode 100644
index 0000000000000..0c5743774fcdf
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationVersionsClient.java
@@ -0,0 +1,404 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationVersionInner;
+import com.azure.resourcemanager.compute.generated.models.GalleryApplicationVersionUpdate;
+import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in GalleryApplicationVersionsClient. */
+public interface GalleryApplicationVersionsClient {
+ /**
+ * Create or update a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is
+ * to be created.
+ * @param galleryApplicationVersionName The name of the gallery Application 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version
+ * operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Version that you want to create or update along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName,
+ GalleryApplicationVersionInner galleryApplicationVersion);
+
+ /**
+ * Create or update a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is
+ * to be created.
+ * @param galleryApplicationVersionName The name of the gallery Application 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version
+ * operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Version that you want to create or update along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryApplicationVersionInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName,
+ GalleryApplicationVersionInner galleryApplicationVersion,
+ Context context);
+
+ /**
+ * Create or update a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is
+ * to be created.
+ * @param galleryApplicationVersionName The name of the gallery Application 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version
+ * operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Version that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryApplicationVersionInner createOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName,
+ GalleryApplicationVersionInner galleryApplicationVersion);
+
+ /**
+ * Create or update a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is
+ * to be created.
+ * @param galleryApplicationVersionName The name of the gallery Application 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryApplicationVersion Parameters supplied to the create or update gallery Application Version
+ * operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Version that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryApplicationVersionInner createOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName,
+ GalleryApplicationVersionInner galleryApplicationVersion,
+ Context context);
+
+ /**
+ * Update a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is
+ * to be updated.
+ * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Version that you want to create or update along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryApplicationVersionInner> beginUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName,
+ GalleryApplicationVersionUpdate galleryApplicationVersion);
+
+ /**
+ * Update a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is
+ * to be updated.
+ * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Version that you want to create or update along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryApplicationVersionInner> beginUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName,
+ GalleryApplicationVersionUpdate galleryApplicationVersion,
+ Context context);
+
+ /**
+ * Update a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is
+ * to be updated.
+ * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Version that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryApplicationVersionInner update(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName,
+ GalleryApplicationVersionUpdate galleryApplicationVersion);
+
+ /**
+ * Update a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is
+ * to be updated.
+ * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryApplicationVersion Parameters supplied to the update gallery Application Version operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Version that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryApplicationVersionInner update(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName,
+ GalleryApplicationVersionUpdate galleryApplicationVersion,
+ Context context);
+
+ /**
+ * Retrieves information about a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version
+ * resides.
+ * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Version that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryApplicationVersionInner get(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName);
+
+ /**
+ * Retrieves information about a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version
+ * resides.
+ * @param galleryApplicationVersionName The name of the gallery Application Version to be retrieved.
+ * @param expand The expand expression to apply on the operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Version that you want to create or update along with
+ * {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName,
+ ReplicationStatusTypes expand,
+ Context context);
+
+ /**
+ * Delete a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version
+ * resides.
+ * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName);
+
+ /**
+ * Delete a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version
+ * resides.
+ * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName,
+ Context context);
+
+ /**
+ * Delete a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version
+ * resides.
+ * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName);
+
+ /**
+ * Delete a gallery Application Version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version
+ * resides.
+ * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ String galleryApplicationVersionName,
+ Context context);
+
+ /**
+ * List gallery Application Versions in a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the
+ * Application Versions are to be listed.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Gallery Application version operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByGalleryApplication(
+ String resourceGroupName, String galleryName, String galleryApplicationName);
+
+ /**
+ * List gallery Application Versions in a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides.
+ * @param galleryApplicationName The name of the Shared Application Gallery Application Definition from which the
+ * Application Versions are to be listed.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Gallery Application version operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByGalleryApplication(
+ String resourceGroupName, String galleryName, String galleryApplicationName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationsClient.java
new file mode 100644
index 0000000000000..068bd6cc2e635
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryApplicationsClient.java
@@ -0,0 +1,347 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.GalleryApplicationInner;
+import com.azure.resourcemanager.compute.generated.models.GalleryApplicationUpdate;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in GalleryApplicationsClient. */
+public interface GalleryApplicationsClient {
+ /**
+ * Create or update a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * created.
+ * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The
+ * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The
+ * maximum length is 80 characters.
+ * @param galleryApplication Parameters supplied to the create or update gallery Application operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Definition that you want to create or update along
+ * with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryApplicationInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ GalleryApplicationInner galleryApplication);
+
+ /**
+ * Create or update a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * created.
+ * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The
+ * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The
+ * maximum length is 80 characters.
+ * @param galleryApplication Parameters supplied to the create or update gallery Application operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Definition that you want to create or update along
+ * with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryApplicationInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ GalleryApplicationInner galleryApplication,
+ Context context);
+
+ /**
+ * Create or update a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * created.
+ * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The
+ * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The
+ * maximum length is 80 characters.
+ * @param galleryApplication Parameters supplied to the create or update gallery Application operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Definition that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryApplicationInner createOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ GalleryApplicationInner galleryApplication);
+
+ /**
+ * Create or update a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * created.
+ * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The
+ * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The
+ * maximum length is 80 characters.
+ * @param galleryApplication Parameters supplied to the create or update gallery Application operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Definition that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryApplicationInner createOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ GalleryApplicationInner galleryApplication,
+ Context context);
+
+ /**
+ * Update a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * updated.
+ * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed
+ * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length
+ * is 80 characters.
+ * @param galleryApplication Parameters supplied to the update gallery Application operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Definition that you want to create or update along
+ * with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryApplicationInner> beginUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ GalleryApplicationUpdate galleryApplication);
+
+ /**
+ * Update a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * updated.
+ * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed
+ * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length
+ * is 80 characters.
+ * @param galleryApplication Parameters supplied to the update gallery Application operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Definition that you want to create or update along
+ * with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryApplicationInner> beginUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ GalleryApplicationUpdate galleryApplication,
+ Context context);
+
+ /**
+ * Update a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * updated.
+ * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed
+ * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length
+ * is 80 characters.
+ * @param galleryApplication Parameters supplied to the update gallery Application operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Definition that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryApplicationInner update(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ GalleryApplicationUpdate galleryApplication);
+
+ /**
+ * Update a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * updated.
+ * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed
+ * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length
+ * is 80 characters.
+ * @param galleryApplication Parameters supplied to the update gallery Application operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Definition that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryApplicationInner update(
+ String resourceGroupName,
+ String galleryName,
+ String galleryApplicationName,
+ GalleryApplicationUpdate galleryApplication,
+ Context context);
+
+ /**
+ * Retrieves information about a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be
+ * retrieved.
+ * @param galleryApplicationName The name of the gallery Application Definition to be retrieved.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Definition that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryApplicationInner get(String resourceGroupName, String galleryName, String galleryApplicationName);
+
+ /**
+ * Retrieves information about a gallery Application Definition.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery from which the Application Definitions are to be
+ * retrieved.
+ * @param galleryApplicationName The name of the gallery Application Definition to be retrieved.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery Application Definition that you want to create or update along
+ * with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String galleryName, String galleryApplicationName, Context context);
+
+ /**
+ * Delete a gallery Application.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * deleted.
+ * @param galleryApplicationName The name of the gallery Application Definition to be deleted.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String galleryName, String galleryApplicationName);
+
+ /**
+ * Delete a gallery Application.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * deleted.
+ * @param galleryApplicationName The name of the gallery Application Definition to be deleted.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String galleryName, String galleryApplicationName, Context context);
+
+ /**
+ * Delete a gallery Application.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * deleted.
+ * @param galleryApplicationName The name of the gallery Application Definition to be deleted.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String galleryName, String galleryApplicationName);
+
+ /**
+ * Delete a gallery Application.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be
+ * deleted.
+ * @param galleryApplicationName The name of the gallery Application Definition to be deleted.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String galleryName, String galleryApplicationName, Context context);
+
+ /**
+ * List gallery Application Definitions in a gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be
+ * listed.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Gallery Applications operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByGallery(String resourceGroupName, String galleryName);
+
+ /**
+ * List gallery Application Definitions in a gallery.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be
+ * listed.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the List Gallery Applications operation response.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByGallery(String resourceGroupName, String galleryName, Context context);
+}
diff --git a/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImageVersionsClient.java b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImageVersionsClient.java
new file mode 100644
index 0000000000000..a4a5b6937f295
--- /dev/null
+++ b/sdk/compute/azure-resourcemanager-compute-generated/src/main/java/com/azure/resourcemanager/compute/generated/fluent/GalleryImageVersionsClient.java
@@ -0,0 +1,376 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.compute.generated.fluent.models.GalleryImageVersionInner;
+import com.azure.resourcemanager.compute.generated.models.GalleryImageVersionUpdate;
+import com.azure.resourcemanager.compute.generated.models.ReplicationStatusTypes;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in GalleryImageVersionsClient. */
+public interface GalleryImageVersionsClient {
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides.
+ * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created.
+ * @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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery image version that you want to create or update along with {@link
+ * Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryImageName,
+ String galleryImageVersionName,
+ GalleryImageVersionInner galleryImageVersion);
+
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides.
+ * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created.
+ * @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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery image version that you want to create or update along with {@link
+ * Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryImageVersionInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryImageName,
+ String galleryImageVersionName,
+ GalleryImageVersionInner galleryImageVersion,
+ Context context);
+
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides.
+ * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created.
+ * @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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery image version that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryImageVersionInner createOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryImageName,
+ String galleryImageVersionName,
+ GalleryImageVersionInner galleryImageVersion);
+
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides.
+ * @param galleryImageName The name of the gallery image definition in which the Image Version is to be created.
+ * @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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryImageVersion Parameters supplied to the create or update gallery image version operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery image version that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryImageVersionInner createOrUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryImageName,
+ String galleryImageVersionName,
+ GalleryImageVersionInner galleryImageVersion,
+ Context context);
+
+ /**
+ * Update a gallery image version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides.
+ * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated.
+ * @param galleryImageVersionName The name of the gallery image version to be updated. 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryImageVersion Parameters supplied to the update gallery image version operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery image version that you want to create or update along with {@link
+ * Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryImageVersionInner> beginUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryImageName,
+ String galleryImageVersionName,
+ GalleryImageVersionUpdate galleryImageVersion);
+
+ /**
+ * Update a gallery image version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides.
+ * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated.
+ * @param galleryImageVersionName The name of the gallery image version to be updated. 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryImageVersion Parameters supplied to the update gallery image version operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery image version that you want to create or update along with {@link
+ * Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, GalleryImageVersionInner> beginUpdate(
+ String resourceGroupName,
+ String galleryName,
+ String galleryImageName,
+ String galleryImageVersionName,
+ GalleryImageVersionUpdate galleryImageVersion,
+ Context context);
+
+ /**
+ * Update a gallery image version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides.
+ * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated.
+ * @param galleryImageVersionName The name of the gallery image version to be updated. 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryImageVersion Parameters supplied to the update gallery image version operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery image version that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryImageVersionInner update(
+ String resourceGroupName,
+ String galleryName,
+ String galleryImageName,
+ String galleryImageVersionName,
+ GalleryImageVersionUpdate galleryImageVersion);
+
+ /**
+ * Update a gallery image version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides.
+ * @param galleryImageName The name of the gallery image definition in which the Image Version is to be updated.
+ * @param galleryImageVersionName The name of the gallery image version to be updated. 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: <MajorVersion>.<MinorVersion>.<Patch>.
+ * @param galleryImageVersion Parameters supplied to the update gallery image version operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery image version that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryImageVersionInner update(
+ String resourceGroupName,
+ String galleryName,
+ String galleryImageName,
+ String galleryImageVersionName,
+ GalleryImageVersionUpdate galleryImageVersion,
+ Context context);
+
+ /**
+ * Retrieves information about a gallery image version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides.
+ * @param galleryImageName The name of the gallery image definition in which the Image Version resides.
+ * @param galleryImageVersionName The name of the gallery image version to be retrieved.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery image version that you want to create or update.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ GalleryImageVersionInner get(
+ String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName);
+
+ /**
+ * Retrieves information about a gallery image version.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides.
+ * @param galleryImageName The name of the gallery image definition in which the Image Version resides.
+ * @param galleryImageVersionName The name of the gallery image version to be retrieved.
+ * @param expand The expand expression to apply on the operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.resourcemanager.compute.generated.models.ApiErrorException thrown if the request is rejected by
+ * server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return specifies information about the gallery image version that you want to create or update along with {@link
+ * Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response