diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 9ae5730c5e3d..4ba83e33990a 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -464,6 +464,7 @@ com.azure.resourcemanager:azure-resourcemanager-edgezones;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-devopsinfrastructure;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-oracledatabase;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-informaticadatamanagement;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-azurefleet;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 io.clientcore:clientcore-parent;1.0.0-beta.1;1.0.0-beta.1 diff --git a/pom.xml b/pom.xml index b83a3963b563..8bcd8341fbac 100644 --- a/pom.xml +++ b/pom.xml @@ -29,6 +29,7 @@ sdk/avs sdk/azureadexternalidentities sdk/azurearcdata + sdk/azurefleet sdk/azurestack sdk/azurestackhci sdk/baremetalinfrastructure diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/CHANGELOG.md b/sdk/azurefleet/azure-resourcemanager-azurefleet/CHANGELOG.md new file mode 100644 index 000000000000..6151e32543fd --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2024-06-13) + +- Azure Resource Manager azurefleet client library for Java. This package contains Microsoft Azure SDK for azurefleet Management SDK. Package tag package-preview-2024-05. 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/azurefleet/azure-resourcemanager-azurefleet/README.md b/sdk/azurefleet/azure-resourcemanager-azurefleet/README.md new file mode 100644 index 000000000000..ac65ad8eca18 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/README.md @@ -0,0 +1,107 @@ +# Azure Resource Manager azurefleet client library for Java + +Azure Resource Manager azurefleet client library for Java. + +This package contains Microsoft Azure SDK for azurefleet Management SDK. Package tag package-preview-2024-05. 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-azurefleet;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-azurefleet + 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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Microsoft Entra ID token authentication depends on correct configuration of the 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 `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +AzurefleetManager manager = AzurefleetManager + .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/azurefleet/azure-resourcemanager-azurefleet/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fazurefleet%2Fazure-resourcemanager-azurefleet%2FREADME.png) diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/SAMPLE.md b/sdk/azurefleet/azure-resourcemanager-azurefleet/SAMPLE.md new file mode 100644 index 000000000000..a3d65bb736ff --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/SAMPLE.md @@ -0,0 +1,921 @@ +# Code snippets and samples + + +## Fleets + +- [CreateOrUpdate](#fleets_createorupdate) +- [Delete](#fleets_delete) +- [GetByResourceGroup](#fleets_getbyresourcegroup) +- [List](#fleets_list) +- [ListByResourceGroup](#fleets_listbyresourcegroup) +- [Update](#fleets_update) + +## Operations + +- [List](#operations_list) + +## VirtualMachineScaleSets + +- [ListByFleet](#virtualmachinescalesets_listbyfleet) +### Fleets_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.azurefleet.models.AdditionalUnattendContent; +import com.azure.resourcemanager.azurefleet.models.ApiEntityReference; +import com.azure.resourcemanager.azurefleet.models.ApplicationProfile; +import com.azure.resourcemanager.azurefleet.models.BillingProfile; +import com.azure.resourcemanager.azurefleet.models.BootDiagnostics; +import com.azure.resourcemanager.azurefleet.models.CachingTypes; +import com.azure.resourcemanager.azurefleet.models.CapacityReservationProfile; +import com.azure.resourcemanager.azurefleet.models.ComponentNames; +import com.azure.resourcemanager.azurefleet.models.ComputeProfile; +import com.azure.resourcemanager.azurefleet.models.DeleteOptions; +import com.azure.resourcemanager.azurefleet.models.DiagnosticsProfile; +import com.azure.resourcemanager.azurefleet.models.DiffDiskOptions; +import com.azure.resourcemanager.azurefleet.models.DiffDiskPlacement; +import com.azure.resourcemanager.azurefleet.models.DiffDiskSettings; +import com.azure.resourcemanager.azurefleet.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.azurefleet.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.azurefleet.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.azurefleet.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.azurefleet.models.EncryptionIdentity; +import com.azure.resourcemanager.azurefleet.models.EvictionPolicy; +import com.azure.resourcemanager.azurefleet.models.ImageReference; +import com.azure.resourcemanager.azurefleet.models.InstanceViewStatus; +import com.azure.resourcemanager.azurefleet.models.IpVersion; +import com.azure.resourcemanager.azurefleet.models.KeyVaultSecretReference; +import com.azure.resourcemanager.azurefleet.models.LinuxConfiguration; +import com.azure.resourcemanager.azurefleet.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.azurefleet.models.LinuxPatchSettings; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentity; +import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurefleet.models.Mode; +import com.azure.resourcemanager.azurefleet.models.NetworkApiVersion; +import com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.azurefleet.models.OperatingSystemTypes; +import com.azure.resourcemanager.azurefleet.models.OSImageNotificationProfile; +import com.azure.resourcemanager.azurefleet.models.PassNames; +import com.azure.resourcemanager.azurefleet.models.PatchSettings; +import com.azure.resourcemanager.azurefleet.models.ProtocolTypes; +import com.azure.resourcemanager.azurefleet.models.ProxyAgentSettings; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSku; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSkuName; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSkuTier; +import com.azure.resourcemanager.azurefleet.models.RegularPriorityAllocationStrategy; +import com.azure.resourcemanager.azurefleet.models.RegularPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.ScheduledEventsProfile; +import com.azure.resourcemanager.azurefleet.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.azurefleet.models.SecurityPostureReference; +import com.azure.resourcemanager.azurefleet.models.SecurityProfile; +import com.azure.resourcemanager.azurefleet.models.SecurityTypes; +import com.azure.resourcemanager.azurefleet.models.ServiceArtifactReference; +import com.azure.resourcemanager.azurefleet.models.SettingNames; +import com.azure.resourcemanager.azurefleet.models.SpotAllocationStrategy; +import com.azure.resourcemanager.azurefleet.models.SpotPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.SshConfiguration; +import com.azure.resourcemanager.azurefleet.models.SshPublicKey; +import com.azure.resourcemanager.azurefleet.models.StatusLevelTypes; +import com.azure.resourcemanager.azurefleet.models.StorageAccountTypes; +import com.azure.resourcemanager.azurefleet.models.TerminateNotificationProfile; +import com.azure.resourcemanager.azurefleet.models.UefiSettings; +import com.azure.resourcemanager.azurefleet.models.UserAssignedIdentity; +import com.azure.resourcemanager.azurefleet.models.VaultCertificate; +import com.azure.resourcemanager.azurefleet.models.VaultSecretGroup; +import com.azure.resourcemanager.azurefleet.models.VirtualHardDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineExtension; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineExtensionInstanceView; +import com.azure.resourcemanager.azurefleet.models.VirtualMachinePriorityTypes; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetDataDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetExtension; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetExtensionProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetHardwareProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpTag; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetManagedDiskParameters; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetOSDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetOSProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetStorageProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetVMProfile; +import com.azure.resourcemanager.azurefleet.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.azurefleet.models.VMGalleryApplication; +import com.azure.resourcemanager.azurefleet.models.VmSizeProfile; +import com.azure.resourcemanager.azurefleet.models.VMSizeProperties; +import com.azure.resourcemanager.azurefleet.models.WindowsConfiguration; +import com.azure.resourcemanager.azurefleet.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchMode; +import com.azure.resourcemanager.azurefleet.models.WinRMConfiguration; +import com.azure.resourcemanager.azurefleet.models.WinRMListener; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Fleets CreateOrUpdate. + */ +public final class FleetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_CreateOrUpdate.json + */ + /** + * Sample code: Fleets_CreateOrUpdate. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsCreateOrUpdate(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) + throws IOException { + manager.fleets() + .define("testFleet") + .withRegion("westus") + .withExistingResourceGroup("rgazurefleet") + .withTags(mapOf("key3518", "fakeTokenPlaceholder")) + .withZones(Arrays.asList("zone1", "zone2")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("key9851", new UserAssignedIdentity()))) + .withSpotPriorityProfile(new SpotPriorityProfile().withCapacity(20) + .withMinCapacity(10) + .withMaxPricePerVM(0.00865F) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(SpotAllocationStrategy.PRICE_CAPACITY_OPTIMIZED) + .withMaintain(true)) + .withRegularPriorityProfile(new RegularPriorityProfile().withCapacity(20) + .withMinCapacity(10) + .withAllocationStrategy(RegularPriorityAllocationStrategy.LOWEST_PRICE)) + .withVmSizesProfile(Arrays.asList(new VmSizeProfile().withName("Standard_d1_v2").withRank(19225))) + .withComputeProfile(new ComputeProfile() + .withBaseVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile(new VirtualMachineScaleSetOSProfile().withComputerNamePrefix("o") + .withAdminUsername("nrgzqciiaaxjrqldbmjbqkyhntp") + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("xjjib") + .withWindowsConfiguration(new WindowsConfiguration().withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("hlyjiqcfksgrpjrct") + .withAdditionalUnattendContent(Arrays + .asList(new AdditionalUnattendContent().withPassName(PassNames.OOBE_SYSTEM) + .withComponentName(ComponentNames.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("bubmqbxjkj"))) + .withPatchSettings(new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.MANUAL) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings( + new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + WindowsVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withWinRM(new WinRMConfiguration() + .withListeners(Arrays.asList(new WinRMListener().withProtocol(ProtocolTypes.HTTP) + .withCertificateUrl("phwesineizrl")))) + .withEnableVMAgentPlatformUpdates(true)) + .withLinuxConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys(Arrays + .asList(new SshPublicKey().withPath("kmqz").withKeyData("fakeTokenPlaceholder")))) + .withProvisionVMAgent(true) + .withPatchSettings(new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT) + .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings(new LinuxVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withEnableVMAgentPlatformUpdates(true)) + .withSecrets( + Arrays.asList(new VaultSecretGroup().withSourceVault(new SubResource().withId("groxwd")) + .withVaultCertificates( + Arrays.asList(new VaultCertificate().withCertificateUrl("tyldwkzafmnkvpo") + .withCertificateStore("nlxrwavpzhueffxsshlun"))))) + .withAllowExtensionOperations(true) + .withRequireGuestProvisionSignal(true)) + .withStorageProfile(new VirtualMachineScaleSetStorageProfile() + .withImageReference(new ImageReference().withId("aiunknwgksu") + .withPublisher("mqxgwbiyjzmxavhbkd") + .withOffer("isxgumkarlkomp") + .withSku("eojmppqcrnpmxirtp") + .withVersion("wvpcqefgtmqdgltiuz") + .withSharedGalleryImageId("kmkgihoxwlawuuhcinfirktdwkmx") + .withCommunityGalleryImageId("vlqe")) + .withOsDisk(new VirtualMachineScaleSetOSDisk().withName("wfttw") + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withDiskSizeGB(14) + .withOsType(OperatingSystemTypes.WINDOWS) + .withImage(new VirtualHardDisk().withUri("thqceubivdrjs")) + .withVhdContainers(Arrays.asList("tkzcwddtinkfpnfklatw")) + .withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("vmatqblzjalbatdepyzqmnd")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("vmatqblzjalbatdepyzqmnd")))) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)) + .withDataDisks( + Arrays + .asList(new VirtualMachineScaleSetDataDisk().withName("eogiykmdmeikswxmigjws") + .withLun(14) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(6) + .withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("vmatqblzjalbatdepyzqmnd")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters() + .withId("vmatqblzjalbatdepyzqmnd")))) + .withDiskIopsReadWrite(27L) + .withDiskMBpsReadWrite(2L) + .withDeleteOption(DiskDeleteOptionTypes.DELETE))) + .withDiskControllerType("uzb")) + .withNetworkProfile(new VirtualMachineScaleSetNetworkProfile() + .withHealthProbe(new ApiEntityReference().withId("cmkfcjhmrwxwqtac")) + .withNetworkInterfaceConfigurations( + Arrays.asList(new VirtualMachineScaleSetNetworkConfiguration().withName("i") + .withPrimary(true) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .withEnableFpga(true) + .withNetworkSecurityGroup(new SubResource().withId("groxwd")) + .withDnsSettings(new VirtualMachineScaleSetNetworkConfigurationDnsSettings() + .withDnsServers(Arrays.asList("nxmmfolhclsesu"))) + .withIpConfigurations(Arrays.asList(new VirtualMachineScaleSetIpConfiguration() + .withName("oezqhkidfhyywlfzwuotilrpbqnjg") + .withSubnet(new ApiEntityReference().withId("cmkfcjhmrwxwqtac")) + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachineScaleSetPublicIpAddressConfiguration().withName("fvpqf") + .withSku(new PublicIpAddressSku().withName(PublicIpAddressSkuName.BASIC) + .withTier(PublicIpAddressSkuTier.REGIONAL)) + .withIdleTimeoutInMinutes(9) + .withDnsSettings( + new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings() + .withDomainNameLabel("ukrddzvmorpmfsczjwtbvp") + .withDomainNameLabelScope( + DomainNameLabelScopeTypes.TENANT_REUSE)) + .withIpTags(Arrays.asList( + new VirtualMachineScaleSetIpTag().withIpTagType("sddgsoemnzgqizale") + .withTag("wufmhrjsakbiaetyara"))) + .withPublicIpPrefix(new SubResource().withId("groxwd")) + .withPublicIpAddressVersion(IpVersion.IPV4) + .withDeleteOption(DeleteOptions.DELETE)) + .withPrivateIpAddressVersion(IpVersion.IPV4) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource().withId("groxwd"))) + .withApplicationSecurityGroups( + Arrays.asList(new SubResource().withId("groxwd"))) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource().withId("groxwd"))) + .withLoadBalancerInboundNatPools( + Arrays.asList(new SubResource().withId("groxwd"))))) + .withEnableIpForwarding(true) + .withDeleteOption(DeleteOptions.DELETE) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.NONE))) + .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) + .withEncryptionIdentity( + new EncryptionIdentity().withUserAssignedIdentityResourceId("qoersmt")) + .withProxyAgentSettings(new ProxyAgentSettings().withEnabled(true) + .withMode(Mode.AUDIT) + .withKeyIncarnationId(20))) + .withDiagnosticsProfile(new DiagnosticsProfile().withBootDiagnostics( + new BootDiagnostics().withEnabled(true).withStorageUri("rzamfwghybpx"))) + .withExtensionProfile(new VirtualMachineScaleSetExtensionProfile() + .withExtensions(Arrays.asList(new VirtualMachineScaleSetExtension().withName("bndxuxx") + .withForceUpdateTag("yhgxw") + .withPublisher("kpxtirxjfprhs") + .withTypePropertiesType("pgjilctjjwaa") + .withTypeHandlerVersion("zevivcoilxmbwlrihhhibq") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProvisionAfterExtensions(Arrays.asList("nftzosroolbcwmpupujzqwqe")) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("groxwd"))))) + .withExtensionsTimeBudget("mbhjahtdygwgyszdwjtvlvtgchdwil")) + .withLicenseType("v") + .withPriority(VirtualMachinePriorityTypes.REGULAR) + .withEvictionPolicy(VirtualMachineEvictionPolicyTypes.DEALLOCATE) + .withBillingProfile(new BillingProfile().withMaxPrice(2.0D)) + .withScheduledEventsProfile(new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("iljppmmw").withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("olbpadmevekyczfokodtfprxti") + .withEnable(true))) + .withUserData("s") + .withCapacityReservation(new CapacityReservationProfile() + .withCapacityReservationGroup(new SubResource().withId("groxwd"))) + .withApplicationProfile(new ApplicationProfile() + .withGalleryApplications(Arrays.asList(new VMGalleryApplication().withTags("eyrqjbib") + .withOrder(5) + .withPackageReferenceId("lfxqiadouhmbovcd") + .withConfigurationReference("ulztmiavpojpbpbddgnuuiimxcpau") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(true)))) + .withHardwareProfile(new VirtualMachineScaleSetHardwareProfile() + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(16).withVCpusPerCore(23))) + .withServiceArtifactReference(new ServiceArtifactReference().withId("qlkeeyskyr")) + .withSecurityPostureReference(new SecurityPostureReference() + .withId("mubredelfbshboaxrsxiajihahaa") + .withExcludeExtensions(Arrays.asList(new VirtualMachineExtension() + .withLocation("wrqxhbqaebwkzmcdmngyqmhogc") + .withTags(mapOf("key7356", "fakeTokenPlaceholder")) + .withForceUpdateTag("oriasdwawveilgusfrn") + .withPublisher("rxoajzb") + .withTypePropertiesType("vhrtgbaqdkbrrqxsdiiaqxksmqukl") + .withTypeHandlerVersion("bvzbiibps") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withInstanceView(new VirtualMachineExtensionInstanceView().withName("ip") + .withType("woadxvobquacooaujyg") + .withTypeHandlerVersion("ftkkqxdqiofgsusvxekdcpua") + .withSubstatuses( + Arrays.asList(new InstanceViewStatus().withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("pomenhgqjoelbxvsqwxxexqxv") + .withMessage("jxjjmlwbjylzvrislyyflhnmizhiu") + .withTime(OffsetDateTime.parse("2024-04-29T21:51:44.042Z")))) + .withStatuses( + Arrays.asList(new InstanceViewStatus().withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("pomenhgqjoelbxvsqwxxexqxv") + .withMessage("jxjjmlwbjylzvrislyyflhnmizhiu") + .withTime(OffsetDateTime.parse("2024-04-29T21:51:44.042Z"))))) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("groxwd"))) + .withProvisionAfterExtensions(Arrays.asList("lwsfavklrgzuwmyxscskt")))))) + .withComputeApiVersion("2023-07-01") + .withPlatformFaultDomainCount(1)) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Fleets_Delete + +```java +/** + * Samples for Fleets Delete. + */ +public final class FleetsDeleteSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Delete.json + */ + /** + * Sample code: Fleets_Delete. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsDelete(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.fleets().delete("rgazurefleet", "testFleet", com.azure.core.util.Context.NONE); + } +} +``` + +### Fleets_GetByResourceGroup + +```java +/** + * Samples for Fleets GetByResourceGroup. + */ +public final class FleetsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Get.json + */ + /** + * Sample code: Fleets_Get. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsGet(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.fleets().getByResourceGroupWithResponse("rgazurefleet", "testFleet", com.azure.core.util.Context.NONE); + } +} +``` + +### Fleets_List + +```java +/** + * Samples for Fleets List. + */ +public final class FleetsListSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_ListBySubscription.json + */ + /** + * Sample code: Fleets_ListBySubscription. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsListBySubscription(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.fleets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Fleets_ListByResourceGroup + +```java +/** + * Samples for Fleets ListByResourceGroup. + */ +public final class FleetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_ListByResourceGroup.json + */ + /** + * Sample code: Fleets_ListByResourceGroup. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsListByResourceGroup(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.fleets().listByResourceGroup("rgazurefleet", com.azure.core.util.Context.NONE); + } +} +``` + +### Fleets_Update + +```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.azurefleet.models.AdditionalUnattendContent; +import com.azure.resourcemanager.azurefleet.models.ApiEntityReference; +import com.azure.resourcemanager.azurefleet.models.ApplicationProfile; +import com.azure.resourcemanager.azurefleet.models.BillingProfile; +import com.azure.resourcemanager.azurefleet.models.BootDiagnostics; +import com.azure.resourcemanager.azurefleet.models.CachingTypes; +import com.azure.resourcemanager.azurefleet.models.CapacityReservationProfile; +import com.azure.resourcemanager.azurefleet.models.ComponentNames; +import com.azure.resourcemanager.azurefleet.models.ComputeProfileUpdate; +import com.azure.resourcemanager.azurefleet.models.DeleteOptions; +import com.azure.resourcemanager.azurefleet.models.DiagnosticsProfile; +import com.azure.resourcemanager.azurefleet.models.DiffDiskOptions; +import com.azure.resourcemanager.azurefleet.models.DiffDiskPlacement; +import com.azure.resourcemanager.azurefleet.models.DiffDiskSettings; +import com.azure.resourcemanager.azurefleet.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.azurefleet.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.azurefleet.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.azurefleet.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.azurefleet.models.EncryptionIdentity; +import com.azure.resourcemanager.azurefleet.models.EvictionPolicy; +import com.azure.resourcemanager.azurefleet.models.Fleet; +import com.azure.resourcemanager.azurefleet.models.FleetPropertiesUpdate; +import com.azure.resourcemanager.azurefleet.models.ImageReference; +import com.azure.resourcemanager.azurefleet.models.InstanceViewStatus; +import com.azure.resourcemanager.azurefleet.models.IpVersion; +import com.azure.resourcemanager.azurefleet.models.KeyVaultSecretReference; +import com.azure.resourcemanager.azurefleet.models.LinuxConfiguration; +import com.azure.resourcemanager.azurefleet.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.azurefleet.models.LinuxPatchSettings; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentityUpdate; +import com.azure.resourcemanager.azurefleet.models.Mode; +import com.azure.resourcemanager.azurefleet.models.NetworkApiVersion; +import com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.azurefleet.models.OperatingSystemTypes; +import com.azure.resourcemanager.azurefleet.models.OSImageNotificationProfile; +import com.azure.resourcemanager.azurefleet.models.PassNames; +import com.azure.resourcemanager.azurefleet.models.PatchSettings; +import com.azure.resourcemanager.azurefleet.models.ProtocolTypes; +import com.azure.resourcemanager.azurefleet.models.ProxyAgentSettings; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSku; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSkuName; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSkuTier; +import com.azure.resourcemanager.azurefleet.models.RegularPriorityAllocationStrategy; +import com.azure.resourcemanager.azurefleet.models.RegularPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.ResourcePlanUpdate; +import com.azure.resourcemanager.azurefleet.models.ScheduledEventsProfile; +import com.azure.resourcemanager.azurefleet.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.azurefleet.models.SecurityPostureReference; +import com.azure.resourcemanager.azurefleet.models.SecurityProfile; +import com.azure.resourcemanager.azurefleet.models.SecurityTypes; +import com.azure.resourcemanager.azurefleet.models.ServiceArtifactReference; +import com.azure.resourcemanager.azurefleet.models.SettingNames; +import com.azure.resourcemanager.azurefleet.models.SpotAllocationStrategy; +import com.azure.resourcemanager.azurefleet.models.SpotPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.SshConfiguration; +import com.azure.resourcemanager.azurefleet.models.SshPublicKey; +import com.azure.resourcemanager.azurefleet.models.StatusLevelTypes; +import com.azure.resourcemanager.azurefleet.models.StorageAccountTypes; +import com.azure.resourcemanager.azurefleet.models.TerminateNotificationProfile; +import com.azure.resourcemanager.azurefleet.models.UefiSettings; +import com.azure.resourcemanager.azurefleet.models.VaultCertificate; +import com.azure.resourcemanager.azurefleet.models.VaultSecretGroup; +import com.azure.resourcemanager.azurefleet.models.VirtualHardDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineExtension; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineExtensionInstanceView; +import com.azure.resourcemanager.azurefleet.models.VirtualMachinePriorityTypes; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetDataDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetExtension; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetExtensionProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetHardwareProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpTag; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetManagedDiskParameters; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetOSDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetOSProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetStorageProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetVMProfile; +import com.azure.resourcemanager.azurefleet.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.azurefleet.models.VMGalleryApplication; +import com.azure.resourcemanager.azurefleet.models.VmSizeProfile; +import com.azure.resourcemanager.azurefleet.models.VMSizeProperties; +import com.azure.resourcemanager.azurefleet.models.WindowsConfiguration; +import com.azure.resourcemanager.azurefleet.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchMode; +import com.azure.resourcemanager.azurefleet.models.WinRMConfiguration; +import com.azure.resourcemanager.azurefleet.models.WinRMListener; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Fleets Update. + */ +public final class FleetsUpdateSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Update.json + */ + /** + * Sample code: Fleets_Update. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsUpdate(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) throws IOException { + Fleet resource = manager.fleets() + .getByResourceGroupWithResponse("rgazurefleet", "testFleet", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentityUpdate().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf())) + .withPlan(new ResourcePlanUpdate().withName("jwgrcrnrtfoxn") + .withPublisher("iozjbiqqckqm") + .withProduct("cgopbyvdyqikahwyxfpzwaqk") + .withPromotionCode("fakeTokenPlaceholder") + .withVersion("wa")) + .withProperties(new FleetPropertiesUpdate() + .withSpotPriorityProfile(new SpotPriorityProfile().withCapacity(20) + .withMinCapacity(10) + .withMaxPricePerVM(0.00865F) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(SpotAllocationStrategy.PRICE_CAPACITY_OPTIMIZED) + .withMaintain(true)) + .withRegularPriorityProfile(new RegularPriorityProfile().withCapacity(20) + .withMinCapacity(10) + .withAllocationStrategy(RegularPriorityAllocationStrategy.LOWEST_PRICE)) + .withVmSizesProfile(Arrays.asList(new VmSizeProfile().withName("Standard_d1_v2").withRank(19225))) + .withComputeProfile(new ComputeProfileUpdate() + .withBaseVirtualMachineProfile(new VirtualMachineScaleSetVMProfile() + .withOsProfile(new VirtualMachineScaleSetOSProfile().withComputerNamePrefix("o") + .withAdminUsername("nrgzqciiaaxjrqldbmjbqkyhntp") + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("xjjib") + .withWindowsConfiguration(new WindowsConfiguration().withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("hlyjiqcfksgrpjrct") + .withAdditionalUnattendContent(Arrays + .asList(new AdditionalUnattendContent().withPassName(PassNames.OOBE_SYSTEM) + .withComponentName(ComponentNames.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("bubmqbxjkj"))) + .withPatchSettings(new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.MANUAL) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings( + new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + WindowsVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withWinRM(new WinRMConfiguration() + .withListeners(Arrays.asList(new WinRMListener().withProtocol(ProtocolTypes.HTTP) + .withCertificateUrl("phwesineizrl")))) + .withEnableVMAgentPlatformUpdates(true)) + .withLinuxConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys(Arrays + .asList(new SshPublicKey().withPath("kmqz").withKeyData("fakeTokenPlaceholder")))) + .withProvisionVMAgent(true) + .withPatchSettings(new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT) + .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings(new LinuxVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withEnableVMAgentPlatformUpdates(true)) + .withSecrets( + Arrays.asList(new VaultSecretGroup().withSourceVault(new SubResource().withId("groxwd")) + .withVaultCertificates( + Arrays.asList(new VaultCertificate().withCertificateUrl("tyldwkzafmnkvpo") + .withCertificateStore("nlxrwavpzhueffxsshlun"))))) + .withAllowExtensionOperations(true) + .withRequireGuestProvisionSignal(true)) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference(new ImageReference().withId("aiunknwgksu") + .withPublisher("mqxgwbiyjzmxavhbkd") + .withOffer("isxgumkarlkomp") + .withSku("eojmppqcrnpmxirtp") + .withVersion("wvpcqefgtmqdgltiuz") + .withSharedGalleryImageId("kmkgihoxwlawuuhcinfirktdwkmx") + .withCommunityGalleryImageId("vlqe")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk().withName("wfttw") + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withDiskSizeGB(14) + .withOsType(OperatingSystemTypes.WINDOWS) + .withImage(new VirtualHardDisk().withUri("thqceubivdrjs")) + .withVhdContainers(Arrays.asList("tkzcwddtinkfpnfklatw")) + .withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("vmatqblzjalbatdepyzqmnd")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters() + .withId("vmatqblzjalbatdepyzqmnd")))) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)) + .withDataDisks( + Arrays.asList(new VirtualMachineScaleSetDataDisk().withName("eogiykmdmeikswxmigjws") + .withLun(14) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(6) + .withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("vmatqblzjalbatdepyzqmnd")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters() + .withId("vmatqblzjalbatdepyzqmnd")))) + .withDiskIopsReadWrite(27L) + .withDiskMBpsReadWrite(2L) + .withDeleteOption(DiskDeleteOptionTypes.DELETE))) + .withDiskControllerType("uzb")) + .withNetworkProfile(new VirtualMachineScaleSetNetworkProfile() + .withHealthProbe(new ApiEntityReference().withId("cmkfcjhmrwxwqtac")) + .withNetworkInterfaceConfigurations( + Arrays.asList(new VirtualMachineScaleSetNetworkConfiguration().withName("i") + .withPrimary(true) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .withEnableFpga(true) + .withNetworkSecurityGroup(new SubResource().withId("groxwd")) + .withDnsSettings(new VirtualMachineScaleSetNetworkConfigurationDnsSettings() + .withDnsServers(Arrays.asList("nxmmfolhclsesu"))) + .withIpConfigurations(Arrays.asList(new VirtualMachineScaleSetIpConfiguration() + .withName("oezqhkidfhyywlfzwuotilrpbqnjg") + .withSubnet(new ApiEntityReference().withId("cmkfcjhmrwxwqtac")) + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachineScaleSetPublicIpAddressConfiguration().withName("fvpqf") + .withSku(new PublicIpAddressSku().withName(PublicIpAddressSkuName.BASIC) + .withTier(PublicIpAddressSkuTier.REGIONAL)) + .withIdleTimeoutInMinutes(9) + .withDnsSettings( + new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings() + .withDomainNameLabel("ukrddzvmorpmfsczjwtbvp") + .withDomainNameLabelScope( + DomainNameLabelScopeTypes.TENANT_REUSE)) + .withIpTags(Arrays.asList( + new VirtualMachineScaleSetIpTag().withIpTagType("sddgsoemnzgqizale") + .withTag("wufmhrjsakbiaetyara"))) + .withPublicIpPrefix(new SubResource().withId("groxwd")) + .withPublicIpAddressVersion(IpVersion.IPV4) + .withDeleteOption(DeleteOptions.DELETE)) + .withPrivateIpAddressVersion(IpVersion.IPV4) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource().withId("groxwd"))) + .withApplicationSecurityGroups( + Arrays.asList(new SubResource().withId("groxwd"))) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource().withId("groxwd"))) + .withLoadBalancerInboundNatPools( + Arrays.asList(new SubResource().withId("groxwd"))))) + .withEnableIpForwarding(true) + .withDeleteOption(DeleteOptions.DELETE) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.NONE))) + .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) + .withEncryptionIdentity( + new EncryptionIdentity().withUserAssignedIdentityResourceId("qoersmt")) + .withProxyAgentSettings(new ProxyAgentSettings().withEnabled(true) + .withMode(Mode.AUDIT) + .withKeyIncarnationId(20))) + .withDiagnosticsProfile(new DiagnosticsProfile().withBootDiagnostics( + new BootDiagnostics().withEnabled(true).withStorageUri("rzamfwghybpx"))) + .withExtensionProfile(new VirtualMachineScaleSetExtensionProfile() + .withExtensions(Arrays.asList(new VirtualMachineScaleSetExtension().withName("bndxuxx") + .withForceUpdateTag("yhgxw") + .withPublisher("kpxtirxjfprhs") + .withTypePropertiesType("pgjilctjjwaa") + .withTypeHandlerVersion("zevivcoilxmbwlrihhhibq") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProvisionAfterExtensions(Arrays.asList("nftzosroolbcwmpupujzqwqe")) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("groxwd"))))) + .withExtensionsTimeBudget("mbhjahtdygwgyszdwjtvlvtgchdwil")) + .withLicenseType("v") + .withPriority(VirtualMachinePriorityTypes.REGULAR) + .withEvictionPolicy(VirtualMachineEvictionPolicyTypes.DEALLOCATE) + .withBillingProfile(new BillingProfile().withMaxPrice(2.0D)) + .withScheduledEventsProfile(new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("iljppmmw").withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("olbpadmevekyczfokodtfprxti") + .withEnable(true))) + .withUserData("s") + .withCapacityReservation(new CapacityReservationProfile() + .withCapacityReservationGroup(new SubResource().withId("groxwd"))) + .withApplicationProfile(new ApplicationProfile() + .withGalleryApplications(Arrays.asList(new VMGalleryApplication().withTags("eyrqjbib") + .withOrder(5) + .withPackageReferenceId("lfxqiadouhmbovcd") + .withConfigurationReference("ulztmiavpojpbpbddgnuuiimxcpau") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(true)))) + .withHardwareProfile(new VirtualMachineScaleSetHardwareProfile() + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(16).withVCpusPerCore(23))) + .withServiceArtifactReference(new ServiceArtifactReference().withId("qlkeeyskyr")) + .withSecurityPostureReference( + new SecurityPostureReference().withId("mubredelfbshboaxrsxiajihahaa") + .withExcludeExtensions(Arrays.asList(new VirtualMachineExtension() + .withLocation("wrqxhbqaebwkzmcdmngyqmhogc") + .withTags(mapOf()) + .withForceUpdateTag("oriasdwawveilgusfrn") + .withPublisher("rxoajzb") + .withTypePropertiesType("vhrtgbaqdkbrrqxsdiiaqxksmqukl") + .withTypeHandlerVersion("bvzbiibps") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withInstanceView(new VirtualMachineExtensionInstanceView().withName("ip") + .withType("woadxvobquacooaujyg") + .withTypeHandlerVersion("ftkkqxdqiofgsusvxekdcpua") + .withSubstatuses( + Arrays.asList(new InstanceViewStatus().withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("pomenhgqjoelbxvsqwxxexqxv") + .withMessage("jxjjmlwbjylzvrislyyflhnmizhiu") + .withTime(OffsetDateTime.parse("2024-04-29T21:51:44.042Z")))) + .withStatuses( + Arrays.asList(new InstanceViewStatus().withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("pomenhgqjoelbxvsqwxxexqxv") + .withMessage("jxjjmlwbjylzvrislyyflhnmizhiu") + .withTime(OffsetDateTime.parse("2024-04-29T21:51:44.042Z"))))) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("groxwd"))) + .withProvisionAfterExtensions(Arrays.asList("lwsfavklrgzuwmyxscskt")))))) + .withComputeApiVersion("2023-07-01") + .withPlatformFaultDomainCount(1))) + .apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void operationsList(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachineScaleSets_ListByFleet + +```java +/** + * Samples for VirtualMachineScaleSets ListByFleet. + */ +public final class VirtualMachineScaleSetsListByFleetSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/VirtualMachineScaleSets_ListByFleet.json + */ + /** + * Sample code: VirtualMachineScaleSets_ListByFleet. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void + virtualMachineScaleSetsListByFleet(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.virtualMachineScaleSets().listByFleet("rgazurefleet", "myFleet", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/pom.xml b/sdk/azurefleet/azure-resourcemanager-azurefleet/pom.xml new file mode 100644 index 000000000000..0afb80d981af --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-azurefleet + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for azurefleet Management + This package contains Microsoft Azure SDK for azurefleet Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-preview-2024-05. + 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 + 0 + 0 + true + + + + com.azure + azure-core + 1.49.1 + + + com.azure + azure-core-management + 1.15.0 + + + diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/AzurefleetManager.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/AzurefleetManager.java new file mode 100644 index 000000000000..670e27598ad5 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/AzurefleetManager.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet; + +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.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; +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.RetryOptions; +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.azurefleet.fluent.MicrosoftAzureFleet; +import com.azure.resourcemanager.azurefleet.implementation.FleetsImpl; +import com.azure.resourcemanager.azurefleet.implementation.MicrosoftAzureFleetBuilder; +import com.azure.resourcemanager.azurefleet.implementation.OperationsImpl; +import com.azure.resourcemanager.azurefleet.implementation.VirtualMachineScaleSetsImpl; +import com.azure.resourcemanager.azurefleet.models.Fleets; +import com.azure.resourcemanager.azurefleet.models.Operations; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSets; +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 AzurefleetManager. + */ +public final class AzurefleetManager { + private Operations operations; + + private Fleets fleets; + + private VirtualMachineScaleSets virtualMachineScaleSets; + + private final MicrosoftAzureFleet clientObject; + + private AzurefleetManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new MicrosoftAzureFleetBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of azurefleet service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the azurefleet service API instance. + */ + public static AzurefleetManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of azurefleet service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the azurefleet service API instance. + */ + public static AzurefleetManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new AzurefleetManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create AzurefleetManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new AzurefleetManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static 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 RetryOptions retryOptions; + 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 retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of azurefleet service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the azurefleet service API instance. + */ + public AzurefleetManager 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.azurefleet") + .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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + 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 AzurefleetManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Fleets. It manages Fleet. + * + * @return Resource collection API of Fleets. + */ + public Fleets fleets() { + if (this.fleets == null) { + this.fleets = new FleetsImpl(clientObject.getFleets(), this); + } + return fleets; + } + + /** + * Gets the resource collection API of VirtualMachineScaleSets. + * + * @return Resource collection API of VirtualMachineScaleSets. + */ + public VirtualMachineScaleSets virtualMachineScaleSets() { + if (this.virtualMachineScaleSets == null) { + this.virtualMachineScaleSets + = new VirtualMachineScaleSetsImpl(clientObject.getVirtualMachineScaleSets(), this); + } + return virtualMachineScaleSets; + } + + /** + * Gets wrapped service client MicrosoftAzureFleet providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client MicrosoftAzureFleet. + */ + public MicrosoftAzureFleet serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/FleetsClient.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/FleetsClient.java new file mode 100644 index 000000000000..b258455d9501 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/FleetsClient.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.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.azurefleet.fluent.models.FleetInner; +import com.azure.resourcemanager.azurefleet.models.FleetUpdate; + +/** + * An instance of this class provides access to all the operations defined in FleetsClient. + */ +public interface FleetsClient { + /** + * List Fleet resources by subscription ID. + * + * @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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Fleet resources by subscription ID. + * + * @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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Fleet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Fleet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @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 Fleet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String fleetName, Context context); + + /** + * Get a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @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 Fleet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetInner getByResourceGroup(String resourceGroupName, String fleetName); + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @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 SyncPoller} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FleetInner> beginCreateOrUpdate(String resourceGroupName, String fleetName, + FleetInner resource); + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @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 SyncPoller} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FleetInner> beginCreateOrUpdate(String resourceGroupName, String fleetName, + FleetInner resource, Context context); + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @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 an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetInner createOrUpdate(String resourceGroupName, String fleetName, FleetInner resource); + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @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 an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetInner createOrUpdate(String resourceGroupName, String fleetName, FleetInner resource, Context context); + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @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 SyncPoller} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FleetInner> beginUpdate(String resourceGroupName, String fleetName, + FleetUpdate properties); + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @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 SyncPoller} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FleetInner> beginUpdate(String resourceGroupName, String fleetName, + FleetUpdate properties, Context context); + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @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 an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetInner update(String resourceGroupName, String fleetName, FleetUpdate properties); + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @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 an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetInner update(String resourceGroupName, String fleetName, FleetUpdate properties, Context context); + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName); + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName, Context context); + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @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 fleetName); + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @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 fleetName, Context context); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/MicrosoftAzureFleet.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/MicrosoftAzureFleet.java new file mode 100644 index 000000000000..aa0e094d9d75 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/MicrosoftAzureFleet.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for MicrosoftAzureFleet class. + */ +public interface MicrosoftAzureFleet { + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * 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 FleetsClient object to access its operations. + * + * @return the FleetsClient object. + */ + FleetsClient getFleets(); + + /** + * Gets the VirtualMachineScaleSetsClient object to access its operations. + * + * @return the VirtualMachineScaleSetsClient object. + */ + VirtualMachineScaleSetsClient getVirtualMachineScaleSets(); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/OperationsClient.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/OperationsClient.java new file mode 100644 index 000000000000..286f74f260ac --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurefleet.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/VirtualMachineScaleSetsClient.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/VirtualMachineScaleSetsClient.java new file mode 100644 index 000000000000..ae7c54e69ea2 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/VirtualMachineScaleSetsClient.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.azurefleet.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner; + +/** + * An instance of this class provides access to all the operations defined in VirtualMachineScaleSetsClient. + */ +public interface VirtualMachineScaleSetsClient { + /** + * List VirtualMachineScaleSet resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Fleet. + * @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 response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFleet(String resourceGroupName, String name); + + /** + * List VirtualMachineScaleSet resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Fleet. + * @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 response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFleet(String resourceGroupName, String name, Context context); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetInner.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetInner.java new file mode 100644 index 000000000000..674221fbc82f --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetInner.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azurefleet.models.ComputeProfile; +import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentity; +import com.azure.resourcemanager.azurefleet.models.Plan; +import com.azure.resourcemanager.azurefleet.models.ProvisioningState; +import com.azure.resourcemanager.azurefleet.models.RegularPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.SpotPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.VmSizeProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * An Compute Fleet resource. + */ +@Fluent +public final class FleetInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties") + private FleetProperties innerProperties; + + /* + * Zones in which the Compute Fleet is available + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The managed service identities assigned to this resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Details of the resource plan. + */ + @JsonProperty(value = "plan") + private Plan plan; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of FleetInner class. + */ + public FleetInner() { + } + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private FleetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the zones property: Zones in which the Compute Fleet is available. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Zones in which the Compute Fleet is available. + * + * @param zones the zones value to set. + * @return the FleetInner object itself. + */ + public FleetInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the FleetInner object itself. + */ + public FleetInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the plan property: Details of the resource plan. + * + * @return the plan value. + */ + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: Details of the resource plan. + * + * @param plan the plan value to set. + * @return the FleetInner object itself. + */ + public FleetInner withPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * {@inheritDoc} + */ + @Override + public FleetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FleetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet. + * + * @return the spotPriorityProfile value. + */ + public SpotPriorityProfile spotPriorityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().spotPriorityProfile(); + } + + /** + * Set the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet. + * + * @param spotPriorityProfile the spotPriorityProfile value to set. + * @return the FleetInner object itself. + */ + public FleetInner withSpotPriorityProfile(SpotPriorityProfile spotPriorityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new FleetProperties(); + } + this.innerProperties().withSpotPriorityProfile(spotPriorityProfile); + return this; + } + + /** + * Get the regularPriorityProfile property: Configuration Options for Regular instances in Compute Fleet. + * + * @return the regularPriorityProfile value. + */ + public RegularPriorityProfile regularPriorityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().regularPriorityProfile(); + } + + /** + * Set the regularPriorityProfile property: Configuration Options for Regular instances in Compute Fleet. + * + * @param regularPriorityProfile the regularPriorityProfile value to set. + * @return the FleetInner object itself. + */ + public FleetInner withRegularPriorityProfile(RegularPriorityProfile regularPriorityProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new FleetProperties(); + } + this.innerProperties().withRegularPriorityProfile(regularPriorityProfile); + return this; + } + + /** + * Get the vmSizesProfile property: List of VM sizes supported for Compute Fleet. + * + * @return the vmSizesProfile value. + */ + public List vmSizesProfile() { + return this.innerProperties() == null ? null : this.innerProperties().vmSizesProfile(); + } + + /** + * Set the vmSizesProfile property: List of VM sizes supported for Compute Fleet. + * + * @param vmSizesProfile the vmSizesProfile value to set. + * @return the FleetInner object itself. + */ + public FleetInner withVmSizesProfile(List vmSizesProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new FleetProperties(); + } + this.innerProperties().withVmSizesProfile(vmSizesProfile); + return this; + } + + /** + * Get the computeProfile property: Compute Profile to use for running user's workloads. + * + * @return the computeProfile value. + */ + public ComputeProfile computeProfile() { + return this.innerProperties() == null ? null : this.innerProperties().computeProfile(); + } + + /** + * Set the computeProfile property: Compute Profile to use for running user's workloads. + * + * @param computeProfile the computeProfile value to set. + * @return the FleetInner object itself. + */ + public FleetInner withComputeProfile(ComputeProfile computeProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new FleetProperties(); + } + this.innerProperties().withComputeProfile(computeProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (plan() != null) { + plan().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetProperties.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetProperties.java new file mode 100644 index 000000000000..426bd5cbd532 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/FleetProperties.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurefleet.models.ComputeProfile; +import com.azure.resourcemanager.azurefleet.models.ProvisioningState; +import com.azure.resourcemanager.azurefleet.models.RegularPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.SpotPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.VmSizeProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Details of the Compute Fleet. + */ +@Fluent +public final class FleetProperties { + /* + * The status of the last operation. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Configuration Options for Spot instances in Compute Fleet. + */ + @JsonProperty(value = "spotPriorityProfile") + private SpotPriorityProfile spotPriorityProfile; + + /* + * Configuration Options for Regular instances in Compute Fleet. + */ + @JsonProperty(value = "regularPriorityProfile") + private RegularPriorityProfile regularPriorityProfile; + + /* + * List of VM sizes supported for Compute Fleet + */ + @JsonProperty(value = "vmSizesProfile", required = true) + private List vmSizesProfile; + + /* + * Compute Profile to use for running user's workloads. + */ + @JsonProperty(value = "computeProfile", required = true) + private ComputeProfile computeProfile; + + /** + * Creates an instance of FleetProperties class. + */ + public FleetProperties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet. + * + * @return the spotPriorityProfile value. + */ + public SpotPriorityProfile spotPriorityProfile() { + return this.spotPriorityProfile; + } + + /** + * Set the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet. + * + * @param spotPriorityProfile the spotPriorityProfile value to set. + * @return the FleetProperties object itself. + */ + public FleetProperties withSpotPriorityProfile(SpotPriorityProfile spotPriorityProfile) { + this.spotPriorityProfile = spotPriorityProfile; + return this; + } + + /** + * Get the regularPriorityProfile property: Configuration Options for Regular instances in Compute Fleet. + * + * @return the regularPriorityProfile value. + */ + public RegularPriorityProfile regularPriorityProfile() { + return this.regularPriorityProfile; + } + + /** + * Set the regularPriorityProfile property: Configuration Options for Regular instances in Compute Fleet. + * + * @param regularPriorityProfile the regularPriorityProfile value to set. + * @return the FleetProperties object itself. + */ + public FleetProperties withRegularPriorityProfile(RegularPriorityProfile regularPriorityProfile) { + this.regularPriorityProfile = regularPriorityProfile; + return this; + } + + /** + * Get the vmSizesProfile property: List of VM sizes supported for Compute Fleet. + * + * @return the vmSizesProfile value. + */ + public List vmSizesProfile() { + return this.vmSizesProfile; + } + + /** + * Set the vmSizesProfile property: List of VM sizes supported for Compute Fleet. + * + * @param vmSizesProfile the vmSizesProfile value to set. + * @return the FleetProperties object itself. + */ + public FleetProperties withVmSizesProfile(List vmSizesProfile) { + this.vmSizesProfile = vmSizesProfile; + return this; + } + + /** + * Get the computeProfile property: Compute Profile to use for running user's workloads. + * + * @return the computeProfile value. + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the computeProfile property: Compute Profile to use for running user's workloads. + * + * @param computeProfile the computeProfile value to set. + * @return the FleetProperties object itself. + */ + public FleetProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (spotPriorityProfile() != null) { + spotPriorityProfile().validate(); + } + if (regularPriorityProfile() != null) { + regularPriorityProfile().validate(); + } + if (vmSizesProfile() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property vmSizesProfile in model FleetProperties")); + } else { + vmSizesProfile().forEach(e -> e.validate()); + } + if (computeProfile() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property computeProfile in model FleetProperties")); + } else { + computeProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FleetProperties.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/OperationInner.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/OperationInner.java new file mode 100644 index 000000000000..1dd72ee37baa --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/OperationInner.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurefleet.models.ActionType; +import com.azure.resourcemanager.azurefleet.models.OperationDisplay; +import com.azure.resourcemanager.azurefleet.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineExtensionProperties.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineExtensionProperties.java new file mode 100644 index 000000000000..0a0dd9db986a --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineExtensionProperties.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.azurefleet.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurefleet.models.KeyVaultSecretReference; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineExtensionInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes the properties of a Virtual Machine Extension. + */ +@Fluent +public final class VirtualMachineExtensionProperties { + /* + * How the extension handler should be forced to update even if the extension configuration has not changed. + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Specifies the type of the extension; an example is "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + */ + @JsonProperty(value = "autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The virtual machine extension instance view. + */ + @JsonProperty(value = "instanceView") + private VirtualMachineExtensionInstanceView instanceView; + + /* + * Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. + */ + @JsonProperty(value = "suppressFailures") + private Boolean suppressFailures; + + /* + * The extensions protected settings that are passed by reference, and consumed from key vault + */ + @JsonProperty(value = "protectedSettingsFromKeyVault") + private KeyVaultSecretReference protectedSettingsFromKeyVault; + + /* + * Collection of extension names after which this extension needs to be provisioned. + */ + @JsonProperty(value = "provisionAfterExtensions") + private List provisionAfterExtensions; + + /** + * Creates an instance of VirtualMachineExtensionProperties class. + */ + public VirtualMachineExtensionProperties() { + } + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the instanceView property: The virtual machine extension instance view. + * + * @return the instanceView value. + */ + public VirtualMachineExtensionInstanceView instanceView() { + return this.instanceView; + } + + /** + * Set the instanceView property: The virtual machine extension instance view. + * + * @param instanceView the instanceView value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withInstanceView(VirtualMachineExtensionInstanceView instanceView) { + this.instanceView = instanceView; + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.suppressFailures; + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withSuppressFailures(Boolean suppressFailures) { + this.suppressFailures = suppressFailures; + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.protectedSettingsFromKeyVault; + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties + withProtectedSettingsFromKeyVault(KeyVaultSecretReference protectedSettingsFromKeyVault) { + this.protectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + return this; + } + + /** + * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + public List provisionAfterExtensions() { + return this.provisionAfterExtensions; + } + + /** + * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @param provisionAfterExtensions the provisionAfterExtensions value to set. + * @return the VirtualMachineExtensionProperties object itself. + */ + public VirtualMachineExtensionProperties withProvisionAfterExtensions(List provisionAfterExtensions) { + this.provisionAfterExtensions = provisionAfterExtensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instanceView() != null) { + instanceView().validate(); + } + if (protectedSettingsFromKeyVault() != null) { + protectedSettingsFromKeyVault().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetExtensionProperties.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetExtensionProperties.java new file mode 100644 index 000000000000..31b762b6b06c --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetExtensionProperties.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurefleet.models.KeyVaultSecretReference; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes the properties of a Virtual Machine Scale Set Extension. + */ +@Fluent +public final class VirtualMachineScaleSetExtensionProperties { + /* + * If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Specifies the type of the extension; an example is "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + */ + @JsonProperty(value = "autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Collection of extension names after which this extension needs to be provisioned. + */ + @JsonProperty(value = "provisionAfterExtensions") + private List provisionAfterExtensions; + + /* + * Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. + */ + @JsonProperty(value = "suppressFailures") + private Boolean suppressFailures; + + /* + * The extensions protected settings that are passed by reference, and consumed from key vault + */ + @JsonProperty(value = "protectedSettingsFromKeyVault") + private KeyVaultSecretReference protectedSettingsFromKeyVault; + + /** + * Creates an instance of VirtualMachineScaleSetExtensionProperties class. + */ + public VirtualMachineScaleSetExtensionProperties() { + } + + /** + * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + public List provisionAfterExtensions() { + return this.provisionAfterExtensions; + } + + /** + * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @param provisionAfterExtensions the provisionAfterExtensions value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties + withProvisionAfterExtensions(List provisionAfterExtensions) { + this.provisionAfterExtensions = provisionAfterExtensions; + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.suppressFailures; + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties withSuppressFailures(Boolean suppressFailures) { + this.suppressFailures = suppressFailures; + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.protectedSettingsFromKeyVault; + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineScaleSetExtensionProperties object itself. + */ + public VirtualMachineScaleSetExtensionProperties + withProtectedSettingsFromKeyVault(KeyVaultSecretReference protectedSettingsFromKeyVault) { + this.protectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protectedSettingsFromKeyVault() != null) { + protectedSettingsFromKeyVault().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetInner.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetInner.java new file mode 100644 index 000000000000..fe347281459b --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetInner.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurefleet.models.ApiError; +import com.azure.resourcemanager.azurefleet.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An AzureFleet's virtualMachineScaleSet. + */ +@Immutable +public final class VirtualMachineScaleSetInner { + /* + * The name of the virtualMachineScaleSet + */ + @JsonProperty(value = "name", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The compute RP resource id of the virtualMachineScaleSet + * "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" + */ + @JsonProperty(value = "id", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Type of the virtualMachineScaleSet + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. + */ + @JsonProperty(value = "operationStatus", required = true, access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState operationStatus; + + /* + * Error Information when `operationStatus` is `Failed` + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ApiError error; + + /** + * Creates an instance of VirtualMachineScaleSetInner class. + */ + public VirtualMachineScaleSetInner() { + } + + /** + * Get the name property: The name of the virtualMachineScaleSet. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the id property: The compute RP resource id of the virtualMachineScaleSet + * "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}". + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the type property: Type of the virtualMachineScaleSet. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the operationStatus property: This represents the operationStatus of the VMSS in response to the last + * operation that was performed on it by Azure Fleet resource. + * + * @return the operationStatus value. + */ + public ProvisioningState operationStatus() { + return this.operationStatus; + } + + /** + * Get the error property: Error Information when `operationStatus` is `Failed`. + * + * @return the error value. + */ + public ApiError error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetIpConfigurationProperties.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetIpConfigurationProperties.java new file mode 100644 index 000000000000..2cb322914e42 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetIpConfigurationProperties.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.azurefleet.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.azurefleet.models.ApiEntityReference; +import com.azure.resourcemanager.azurefleet.models.IpVersion; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machine scale set network profile's IP configuration properties. + */ +@Fluent +public final class VirtualMachineScaleSetIpConfigurationProperties { + /* + * Specifies the identifier of the subnet. + */ + @JsonProperty(value = "subnet") + private ApiEntityReference subnet; + + /* + * Specifies the primary network interface in case the virtual machine has more than 1 network interface. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * The publicIPAddressConfiguration. + */ + @JsonProperty(value = "publicIPAddressConfiguration") + private VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration; + + /* + * Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + */ + @JsonProperty(value = "privateIPAddressVersion") + private IpVersion privateIpAddressVersion; + + /* + * Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. + */ + @JsonProperty(value = "applicationGatewayBackendAddressPools") + private List applicationGatewayBackendAddressPools; + + /* + * Specifies an array of references to application security group. + */ + @JsonProperty(value = "applicationSecurityGroups") + private List applicationSecurityGroups; + + /* + * Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. + */ + @JsonProperty(value = "loadBalancerBackendAddressPools") + private List loadBalancerBackendAddressPools; + + /* + * Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. + */ + @JsonProperty(value = "loadBalancerInboundNatPools") + private List loadBalancerInboundNatPools; + + /** + * Creates an instance of VirtualMachineScaleSetIpConfigurationProperties class. + */ + public VirtualMachineScaleSetIpConfigurationProperties() { + } + + /** + * Get the subnet property: Specifies the identifier of the subnet. + * + * @return the subnet value. + */ + public ApiEntityReference subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Specifies the identifier of the subnet. + * + * @param subnet the subnet value to set. + * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties withSubnet(ApiEntityReference subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @return the publicIpAddressConfiguration value. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration() { + return this.publicIpAddressConfiguration; + } + + /** + * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. + * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties withPublicIpAddressConfiguration( + VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration) { + this.publicIpAddressConfiguration = publicIpAddressConfiguration; + return this; + } + + /** + * Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the privateIpAddressVersion value. + */ + public IpVersion privateIpAddressVersion() { + return this.privateIpAddressVersion; + } + + /** + * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param privateIpAddressVersion the privateIpAddressVersion value to set. + * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties + withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { + this.privateIpAddressVersion = privateIpAddressVersion; + return this; + } + + /** + * Get the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A scale set can reference backend address pools of multiple application gateways. + * Multiple scale sets cannot use the same application gateway. + * + * @return the applicationGatewayBackendAddressPools value. + */ + public List applicationGatewayBackendAddressPools() { + return this.applicationGatewayBackendAddressPools; + } + + /** + * Set the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A scale set can reference backend address pools of multiple application gateways. + * Multiple scale sets cannot use the same application gateway. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. + * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties + withApplicationGatewayBackendAddressPools(List applicationGatewayBackendAddressPools) { + this.applicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + return this; + } + + /** + * Get the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @return the applicationSecurityGroups value. + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set. + * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties + withApplicationSecurityGroups(List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * Get the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A scale set can reference backend address pools of one public and one internal load balancer. + * Multiple scale sets cannot use the same basic sku load balancer. + * + * @return the loadBalancerBackendAddressPools value. + */ + public List loadBalancerBackendAddressPools() { + return this.loadBalancerBackendAddressPools; + } + + /** + * Set the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A scale set can reference backend address pools of one public and one internal load balancer. + * Multiple scale sets cannot use the same basic sku load balancer. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. + * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties + withLoadBalancerBackendAddressPools(List loadBalancerBackendAddressPools) { + this.loadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + return this; + } + + /** + * Get the loadBalancerInboundNatPools property: Specifies an array of references to inbound Nat pools of the load + * balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple + * scale sets cannot use the same basic sku load balancer. + * + * @return the loadBalancerInboundNatPools value. + */ + public List loadBalancerInboundNatPools() { + return this.loadBalancerInboundNatPools; + } + + /** + * Set the loadBalancerInboundNatPools property: Specifies an array of references to inbound Nat pools of the load + * balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple + * scale sets cannot use the same basic sku load balancer. + * + * @param loadBalancerInboundNatPools the loadBalancerInboundNatPools value to set. + * @return the VirtualMachineScaleSetIpConfigurationProperties object itself. + */ + public VirtualMachineScaleSetIpConfigurationProperties + withLoadBalancerInboundNatPools(List loadBalancerInboundNatPools) { + this.loadBalancerInboundNatPools = loadBalancerInboundNatPools; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + if (publicIpAddressConfiguration() != null) { + publicIpAddressConfiguration().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetNetworkConfigurationProperties.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetNetworkConfigurationProperties.java new file mode 100644 index 000000000000..e4a04f75c0d2 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetNetworkConfigurationProperties.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurefleet.models.DeleteOptions; +import com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machine scale set network profile's IP configuration. + */ +@Fluent +public final class VirtualMachineScaleSetNetworkConfigurationProperties { + /* + * Specifies the primary network interface in case the virtual machine has more than 1 network interface. + */ + @JsonProperty(value = "primary") + private Boolean primary; + + /* + * Specifies whether the network interface is accelerated networking-enabled. + */ + @JsonProperty(value = "enableAcceleratedNetworking") + private Boolean enableAcceleratedNetworking; + + /* + * Specifies whether the network interface is disabled for tcp state tracking. + */ + @JsonProperty(value = "disableTcpStateTracking") + private Boolean disableTcpStateTracking; + + /* + * Specifies whether the network interface is FPGA networking-enabled. + */ + @JsonProperty(value = "enableFpga") + private Boolean enableFpga; + + /* + * The network security group. + */ + @JsonProperty(value = "networkSecurityGroup") + private SubResource networkSecurityGroup; + + /* + * The dns settings to be applied on the network interfaces. + */ + @JsonProperty(value = "dnsSettings") + private VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings; + + /* + * Specifies the IP configurations of the network interface. + */ + @JsonProperty(value = "ipConfigurations", required = true) + private List ipConfigurations; + + /* + * Whether IP forwarding enabled on this NIC. + */ + @JsonProperty(value = "enableIPForwarding") + private Boolean enableIpForwarding; + + /* + * Specify what happens to the network interface when the VM is deleted + */ + @JsonProperty(value = "deleteOption") + private DeleteOptions deleteOption; + + /* + * Specifies whether the Auxiliary mode is enabled for the Network Interface resource. + */ + @JsonProperty(value = "auxiliaryMode") + private NetworkInterfaceAuxiliaryMode auxiliaryMode; + + /* + * Specifies whether the Auxiliary sku is enabled for the Network Interface resource. + */ + @JsonProperty(value = "auxiliarySku") + private NetworkInterfaceAuxiliarySku auxiliarySku; + + /** + * Creates an instance of VirtualMachineScaleSetNetworkConfigurationProperties class. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties() { + } + + /** + * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties + withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @return the disableTcpStateTracking value. + */ + public Boolean disableTcpStateTracking() { + return this.disableTcpStateTracking; + } + + /** + * Set the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @param disableTcpStateTracking the disableTcpStateTracking value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties + withDisableTcpStateTracking(Boolean disableTcpStateTracking) { + this.disableTcpStateTracking = disableTcpStateTracking; + return this; + } + + /** + * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @return the enableFpga value. + */ + public Boolean enableFpga() { + return this.enableFpga; + } + + /** + * Set the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @param enableFpga the enableFpga value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties withEnableFpga(Boolean enableFpga) { + this.enableFpga = enableFpga; + return this; + } + + /** + * Get the networkSecurityGroup property: The network security group. + * + * @return the networkSecurityGroup value. + */ + public SubResource networkSecurityGroup() { + return this.networkSecurityGroup; + } + + /** + * Set the networkSecurityGroup property: The network security group. + * + * @param networkSecurityGroup the networkSecurityGroup value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties + withNetworkSecurityGroup(SubResource networkSecurityGroup) { + this.networkSecurityGroup = networkSecurityGroup; + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @return the dnsSettings value. + */ + public VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties + withDnsSettings(VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties + withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.enableIpForwarding; + } + + /** + * Set the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @param enableIpForwarding the enableIpForwarding value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties withEnableIpForwarding(Boolean enableIpForwarding) { + this.enableIpForwarding = enableIpForwarding; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Get the auxiliaryMode property: Specifies whether the Auxiliary mode is enabled for the Network Interface + * resource. + * + * @return the auxiliaryMode value. + */ + public NetworkInterfaceAuxiliaryMode auxiliaryMode() { + return this.auxiliaryMode; + } + + /** + * Set the auxiliaryMode property: Specifies whether the Auxiliary mode is enabled for the Network Interface + * resource. + * + * @param auxiliaryMode the auxiliaryMode value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties + withAuxiliaryMode(NetworkInterfaceAuxiliaryMode auxiliaryMode) { + this.auxiliaryMode = auxiliaryMode; + return this; + } + + /** + * Get the auxiliarySku property: Specifies whether the Auxiliary sku is enabled for the Network Interface resource. + * + * @return the auxiliarySku value. + */ + public NetworkInterfaceAuxiliarySku auxiliarySku() { + return this.auxiliarySku; + } + + /** + * Set the auxiliarySku property: Specifies whether the Auxiliary sku is enabled for the Network Interface resource. + * + * @param auxiliarySku the auxiliarySku value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationProperties object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationProperties + withAuxiliarySku(NetworkInterfaceAuxiliarySku auxiliarySku) { + this.auxiliarySku = auxiliarySku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (ipConfigurations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ipConfigurations in model VirtualMachineScaleSetNetworkConfigurationProperties")); + } else { + ipConfigurations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(VirtualMachineScaleSetNetworkConfigurationProperties.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetPublicIpAddressConfigurationProperties.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetPublicIpAddressConfigurationProperties.java new file mode 100644 index 000000000000..3d75aff21384 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/VirtualMachineScaleSetPublicIpAddressConfigurationProperties.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.azurefleet.models.DeleteOptions; +import com.azure.resourcemanager.azurefleet.models.IpVersion; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpTag; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. + */ +@Fluent +public final class VirtualMachineScaleSetPublicIpAddressConfigurationProperties { + /* + * The idle timeout of the public IP address. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * The dns settings to be applied on the publicIP addresses . + */ + @JsonProperty(value = "dnsSettings") + private VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings; + + /* + * The list of IP tags associated with the public IP address. + */ + @JsonProperty(value = "ipTags") + private List ipTags; + + /* + * The PublicIPPrefix from which to allocate publicIP addresses. + */ + @JsonProperty(value = "publicIPPrefix") + private SubResource publicIpPrefix; + + /* + * Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + */ + @JsonProperty(value = "publicIPAddressVersion") + private IpVersion publicIpAddressVersion; + + /* + * Specify what happens to the public IP when the VM is deleted + */ + @JsonProperty(value = "deleteOption") + private DeleteOptions deleteOption; + + /** + * Creates an instance of VirtualMachineScaleSetPublicIpAddressConfigurationProperties class. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties() { + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties + withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @return the dnsSettings value. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings() { + return this.dnsSettings; + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties + withDnsSettings(VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the ipTags property: The list of IP tags associated with the public IP address. + * + * @return the ipTags value. + */ + public List ipTags() { + return this.ipTags; + } + + /** + * Set the ipTags property: The list of IP tags associated with the public IP address. + * + * @param ipTags the ipTags value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties + withIpTags(List ipTags) { + this.ipTags = ipTags; + return this; + } + + /** + * Get the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @return the publicIpPrefix value. + */ + public SubResource publicIpPrefix() { + return this.publicIpPrefix; + } + + /** + * Set the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @param publicIpPrefix the publicIpPrefix value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties withPublicIpPrefix(SubResource publicIpPrefix) { + this.publicIpPrefix = publicIpPrefix; + return this; + } + + /** + * Get the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the publicIpAddressVersion value. + */ + public IpVersion publicIpAddressVersion() { + return this.publicIpAddressVersion; + } + + /** + * Set the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param publicIpAddressVersion the publicIpAddressVersion value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties + withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { + this.publicIpAddressVersion = publicIpAddressVersion; + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfigurationProperties object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationProperties withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (ipTags() != null) { + ipTags().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/package-info.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/package-info.java new file mode 100644 index 000000000000..34ccfc630ff3 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for MicrosoftAzureFleet. + * null. + */ +package com.azure.resourcemanager.azurefleet.fluent.models; diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/package-info.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/package-info.java new file mode 100644 index 000000000000..2b1da72465e8 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for MicrosoftAzureFleet. + * null. + */ +package com.azure.resourcemanager.azurefleet.fluent; diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetImpl.java new file mode 100644 index 000000000000..0737d49527a2 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetImpl.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.azurefleet.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurefleet.fluent.models.FleetInner; +import com.azure.resourcemanager.azurefleet.models.ComputeProfile; +import com.azure.resourcemanager.azurefleet.models.Fleet; +import com.azure.resourcemanager.azurefleet.models.FleetPropertiesUpdate; +import com.azure.resourcemanager.azurefleet.models.FleetUpdate; +import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentity; +import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentityUpdate; +import com.azure.resourcemanager.azurefleet.models.Plan; +import com.azure.resourcemanager.azurefleet.models.ProvisioningState; +import com.azure.resourcemanager.azurefleet.models.RegularPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.ResourcePlanUpdate; +import com.azure.resourcemanager.azurefleet.models.SpotPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.VmSizeProfile; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class FleetImpl implements Fleet, Fleet.Definition, Fleet.Update { + private FleetInner innerObject; + + private final com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SpotPriorityProfile spotPriorityProfile() { + return this.innerModel().spotPriorityProfile(); + } + + public RegularPriorityProfile regularPriorityProfile() { + return this.innerModel().regularPriorityProfile(); + } + + public List vmSizesProfile() { + List inner = this.innerModel().vmSizesProfile(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ComputeProfile computeProfile() { + return this.innerModel().computeProfile(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FleetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurefleet.AzurefleetManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String fleetName; + + private FleetUpdate updateProperties; + + public FleetImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Fleet create() { + this.innerObject = serviceManager.serviceClient() + .getFleets() + .createOrUpdate(resourceGroupName, fleetName, this.innerModel(), Context.NONE); + return this; + } + + public Fleet create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFleets() + .createOrUpdate(resourceGroupName, fleetName, this.innerModel(), context); + return this; + } + + FleetImpl(String name, com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) { + this.innerObject = new FleetInner(); + this.serviceManager = serviceManager; + this.fleetName = name; + } + + public FleetImpl update() { + this.updateProperties = new FleetUpdate(); + return this; + } + + public Fleet apply() { + this.innerObject = serviceManager.serviceClient() + .getFleets() + .update(resourceGroupName, fleetName, updateProperties, Context.NONE); + return this; + } + + public Fleet apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFleets() + .update(resourceGroupName, fleetName, updateProperties, context); + return this; + } + + FleetImpl(FleetInner innerObject, com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fleetName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "fleets"); + } + + public Fleet refresh() { + this.innerObject = serviceManager.serviceClient() + .getFleets() + .getByResourceGroupWithResponse(resourceGroupName, fleetName, Context.NONE) + .getValue(); + return this; + } + + public Fleet refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFleets() + .getByResourceGroupWithResponse(resourceGroupName, fleetName, context) + .getValue(); + return this; + } + + public FleetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FleetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FleetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public FleetImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public FleetImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public FleetImpl withPlan(Plan plan) { + this.innerModel().withPlan(plan); + return this; + } + + public FleetImpl withSpotPriorityProfile(SpotPriorityProfile spotPriorityProfile) { + this.innerModel().withSpotPriorityProfile(spotPriorityProfile); + return this; + } + + public FleetImpl withRegularPriorityProfile(RegularPriorityProfile regularPriorityProfile) { + this.innerModel().withRegularPriorityProfile(regularPriorityProfile); + return this; + } + + public FleetImpl withVmSizesProfile(List vmSizesProfile) { + this.innerModel().withVmSizesProfile(vmSizesProfile); + return this; + } + + public FleetImpl withComputeProfile(ComputeProfile computeProfile) { + this.innerModel().withComputeProfile(computeProfile); + return this; + } + + public FleetImpl withIdentity(ManagedServiceIdentityUpdate identity) { + this.updateProperties.withIdentity(identity); + return this; + } + + public FleetImpl withPlan(ResourcePlanUpdate plan) { + this.updateProperties.withPlan(plan); + return this; + } + + public FleetImpl withProperties(FleetPropertiesUpdate properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsClientImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsClientImpl.java new file mode 100644 index 000000000000..5f422b208ac7 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsClientImpl.java @@ -0,0 +1,1269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurefleet.fluent.FleetsClient; +import com.azure.resourcemanager.azurefleet.fluent.models.FleetInner; +import com.azure.resourcemanager.azurefleet.models.FleetListResult; +import com.azure.resourcemanager.azurefleet.models.FleetUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FleetsClient. + */ +public final class FleetsClientImpl implements FleetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FleetsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAzureFleetImpl client; + + /** + * Initializes an instance of FleetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FleetsClientImpl(MicrosoftAzureFleetImpl client) { + this.service = RestProxy.create(FleetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAzureFleetFleets to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAzureFleetF") + public interface FleetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @BodyParam("application/json") FleetInner resource, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @BodyParam("application/json") FleetUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Fleet resources by subscription ID. + * + * @throws 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 response of a Fleet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Fleet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Fleet resources by subscription ID. + * + * @throws 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 response of a Fleet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Fleet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Fleet resources by subscription ID. + * + * @throws 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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Fleet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Fleet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Fleet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Fleet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Fleet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Fleet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Fleet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Fleet along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String fleetName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Fleet along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String fleetName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, context); + } + + /** + * Get a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Fleet on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String fleetName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, fleetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Fleet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String fleetName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, fleetName, context).block(); + } + + /** + * Get a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Fleet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetInner getByResourceGroup(String resourceGroupName, String fleetName) { + return getByResourceGroupWithResponse(resourceGroupName, fleetName, Context.NONE).getValue(); + } + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String fleetName, + FleetInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String fleetName, + FleetInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, resource, accept, context); + } + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PollerFlux} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetInner> beginCreateOrUpdateAsync(String resourceGroupName, + String fleetName, FleetInner resource) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, fleetName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FleetInner.class, + FleetInner.class, this.client.getContext()); + } + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PollerFlux} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetInner> beginCreateOrUpdateAsync(String resourceGroupName, + String fleetName, FleetInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, fleetName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FleetInner.class, + FleetInner.class, context); + } + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SyncPoller} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FleetInner> beginCreateOrUpdate(String resourceGroupName, + String fleetName, FleetInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, fleetName, resource).getSyncPoller(); + } + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SyncPoller} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FleetInner> beginCreateOrUpdate(String resourceGroupName, + String fleetName, FleetInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, fleetName, resource, context).getSyncPoller(); + } + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String fleetName, FleetInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, fleetName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String fleetName, FleetInner resource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, fleetName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetInner createOrUpdate(String resourceGroupName, String fleetName, FleetInner resource) { + return createOrUpdateAsync(resourceGroupName, fleetName, resource).block(); + } + + /** + * Create a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetInner createOrUpdate(String resourceGroupName, String fleetName, FleetInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, fleetName, resource, context).block(); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String fleetName, + FleetUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String fleetName, + FleetUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, properties, accept, context); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PollerFlux} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetInner> beginUpdateAsync(String resourceGroupName, String fleetName, + FleetUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, fleetName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FleetInner.class, + FleetInner.class, this.client.getContext()); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PollerFlux} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetInner> beginUpdateAsync(String resourceGroupName, String fleetName, + FleetUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, fleetName, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FleetInner.class, + FleetInner.class, context); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SyncPoller} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FleetInner> beginUpdate(String resourceGroupName, String fleetName, + FleetUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, fleetName, properties).getSyncPoller(); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SyncPoller} for polling of an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FleetInner> beginUpdate(String resourceGroupName, String fleetName, + FleetUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, fleetName, properties, context).getSyncPoller(); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String fleetName, FleetUpdate properties) { + return beginUpdateAsync(resourceGroupName, fleetName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String fleetName, FleetUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, fleetName, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetInner update(String resourceGroupName, String fleetName, FleetUpdate properties) { + return updateAsync(resourceGroupName, fleetName, properties).block(); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Compute Fleet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetInner update(String resourceGroupName, String fleetName, FleetUpdate properties, Context context) { + return updateAsync(resourceGroupName, fleetName, properties, context).block(); + } + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String fleetName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String fleetName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, accept, context); + } + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String fleetName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, fleetName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String fleetName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, fleetName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName) { + return this.beginDeleteAsync(resourceGroupName, fleetName).getSyncPoller(); + } + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName, Context context) { + return this.beginDeleteAsync(resourceGroupName, fleetName, context).getSyncPoller(); + } + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String fleetName) { + return beginDeleteAsync(resourceGroupName, fleetName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String fleetName, Context context) { + return beginDeleteAsync(resourceGroupName, fleetName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public void delete(String resourceGroupName, String fleetName) { + deleteAsync(resourceGroupName, fleetName).block(); + } + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + public void delete(String resourceGroupName, String fleetName, Context context) { + deleteAsync(resourceGroupName, fleetName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a Fleet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsImpl.java new file mode 100644 index 000000000000..5fc8a408f6ea --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/FleetsImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurefleet.fluent.FleetsClient; +import com.azure.resourcemanager.azurefleet.fluent.models.FleetInner; +import com.azure.resourcemanager.azurefleet.models.Fleet; +import com.azure.resourcemanager.azurefleet.models.Fleets; + +public final class FleetsImpl implements Fleets { + private static final ClientLogger LOGGER = new ClientLogger(FleetsImpl.class); + + private final FleetsClient innerClient; + + private final com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager; + + public FleetsImpl(FleetsClient innerClient, com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FleetImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FleetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FleetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FleetImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String fleetName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, fleetName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FleetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Fleet getByResourceGroup(String resourceGroupName, String fleetName) { + FleetInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, fleetName); + if (inner != null) { + return new FleetImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String fleetName) { + this.serviceClient().delete(resourceGroupName, fleetName); + } + + public void delete(String resourceGroupName, String fleetName, Context context) { + this.serviceClient().delete(resourceGroupName, fleetName, context); + } + + public Fleet getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String fleetName = ResourceManagerUtils.getValueFromIdByName(id, "fleets"); + if (fleetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, fleetName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String fleetName = ResourceManagerUtils.getValueFromIdByName(id, "fleets"); + if (fleetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, fleetName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String fleetName = ResourceManagerUtils.getValueFromIdByName(id, "fleets"); + if (fleetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id))); + } + this.delete(resourceGroupName, fleetName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String fleetName = ResourceManagerUtils.getValueFromIdByName(id, "fleets"); + if (fleetName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id))); + } + this.delete(resourceGroupName, fleetName, context); + } + + private FleetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurefleet.AzurefleetManager manager() { + return this.serviceManager; + } + + public FleetImpl define(String name) { + return new FleetImpl(name, this.manager()); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetBuilder.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetBuilder.java new file mode 100644 index 000000000000..95626582663e --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the MicrosoftAzureFleetImpl type. + */ +@ServiceClientBuilder(serviceClients = { MicrosoftAzureFleetImpl.class }) +public final class MicrosoftAzureFleetBuilder { + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the MicrosoftAzureFleetBuilder. + */ + public MicrosoftAzureFleetBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the MicrosoftAzureFleetBuilder. + */ + public MicrosoftAzureFleetBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the MicrosoftAzureFleetBuilder. + */ + public MicrosoftAzureFleetBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the MicrosoftAzureFleetBuilder. + */ + public MicrosoftAzureFleetBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the MicrosoftAzureFleetBuilder. + */ + public MicrosoftAzureFleetBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the MicrosoftAzureFleetBuilder. + */ + public MicrosoftAzureFleetBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of MicrosoftAzureFleetImpl with the provided parameters. + * + * @return an instance of MicrosoftAzureFleetImpl. + */ + public MicrosoftAzureFleetImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + MicrosoftAzureFleetImpl client = new MicrosoftAzureFleetImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetImpl.java new file mode 100644 index 000000000000..9e6e8036d536 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/MicrosoftAzureFleetImpl.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurefleet.fluent.FleetsClient; +import com.azure.resourcemanager.azurefleet.fluent.MicrosoftAzureFleet; +import com.azure.resourcemanager.azurefleet.fluent.OperationsClient; +import com.azure.resourcemanager.azurefleet.fluent.VirtualMachineScaleSetsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the MicrosoftAzureFleetImpl type. + */ +@ServiceClient(builder = MicrosoftAzureFleetBuilder.class) +public final class MicrosoftAzureFleetImpl implements MicrosoftAzureFleet { + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The FleetsClient object to access its operations. + */ + private final FleetsClient fleets; + + /** + * Gets the FleetsClient object to access its operations. + * + * @return the FleetsClient object. + */ + public FleetsClient getFleets() { + return this.fleets; + } + + /** + * The VirtualMachineScaleSetsClient object to access its operations. + */ + private final VirtualMachineScaleSetsClient virtualMachineScaleSets; + + /** + * Gets the VirtualMachineScaleSetsClient object to access its operations. + * + * @return the VirtualMachineScaleSetsClient object. + */ + public VirtualMachineScaleSetsClient getVirtualMachineScaleSets() { + return this.virtualMachineScaleSets; + } + + /** + * Initializes an instance of MicrosoftAzureFleet client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param endpoint server parameter. + */ + MicrosoftAzureFleetImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2024-05-01-preview"; + this.operations = new OperationsClientImpl(this); + this.fleets = new FleetsClientImpl(this); + this.virtualMachineScaleSets = new VirtualMachineScaleSetsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MicrosoftAzureFleetImpl.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationImpl.java new file mode 100644 index 000000000000..4662a3a72548 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.implementation; + +import com.azure.resourcemanager.azurefleet.fluent.models.OperationInner; +import com.azure.resourcemanager.azurefleet.models.ActionType; +import com.azure.resourcemanager.azurefleet.models.Operation; +import com.azure.resourcemanager.azurefleet.models.OperationDisplay; +import com.azure.resourcemanager.azurefleet.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurefleet.AzurefleetManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationsClientImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..740eb1ef655c --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationsClientImpl.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.azurefleet.fluent.OperationsClient; +import com.azure.resourcemanager.azurefleet.fluent.models.OperationInner; +import com.azure.resourcemanager.azurefleet.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAzureFleetImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(MicrosoftAzureFleetImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAzureFleetOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAzureFleetO") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AzureFleet/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws 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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the operations for the provider. + * + * @throws 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 list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the operations for the provider. + * + * @throws 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 list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationsImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationsImpl.java new file mode 100644 index 000000000000..37b1cbc23f99 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurefleet.fluent.OperationsClient; +import com.azure.resourcemanager.azurefleet.fluent.models.OperationInner; +import com.azure.resourcemanager.azurefleet.models.Operation; +import com.azure.resourcemanager.azurefleet.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurefleet.AzurefleetManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/ResourceManagerUtils.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..26ff8f2a7e79 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetImpl.java new file mode 100644 index 000000000000..875a339a2be6 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.implementation; + +import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner; +import com.azure.resourcemanager.azurefleet.models.ApiError; +import com.azure.resourcemanager.azurefleet.models.ProvisioningState; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSet; + +public final class VirtualMachineScaleSetImpl implements VirtualMachineScaleSet { + private VirtualMachineScaleSetInner innerObject; + + private final com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager; + + VirtualMachineScaleSetImpl(VirtualMachineScaleSetInner innerObject, + com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProvisioningState operationStatus() { + return this.innerModel().operationStatus(); + } + + public ApiError error() { + return this.innerModel().error(); + } + + public VirtualMachineScaleSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurefleet.AzurefleetManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetsClientImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetsClientImpl.java new file mode 100644 index 000000000000..a99c6a9a3bb8 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetsClientImpl.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.azurefleet.fluent.VirtualMachineScaleSetsClient; +import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in VirtualMachineScaleSetsClient. + */ +public final class VirtualMachineScaleSetsClientImpl implements VirtualMachineScaleSetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final VirtualMachineScaleSetsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAzureFleetImpl client; + + /** + * Initializes an instance of VirtualMachineScaleSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineScaleSetsClientImpl(MicrosoftAzureFleetImpl client) { + this.service = RestProxy.create(VirtualMachineScaleSetsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAzureFleetVirtualMachineScaleSets to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAzureFleetV") + public interface VirtualMachineScaleSetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{name}/virtualMachineScaleSets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFleet(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFleetNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List VirtualMachineScaleSet resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a VirtualMachineScaleSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFleetSinglePageAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByFleet(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List VirtualMachineScaleSet resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Fleet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a VirtualMachineScaleSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFleetSinglePageAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByFleet(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List VirtualMachineScaleSet resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFleetAsync(String resourceGroupName, String name) { + return new PagedFlux<>(() -> listByFleetSinglePageAsync(resourceGroupName, name), + nextLink -> listByFleetNextSinglePageAsync(nextLink)); + } + + /** + * List VirtualMachineScaleSet resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Fleet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFleetAsync(String resourceGroupName, String name, + Context context) { + return new PagedFlux<>(() -> listByFleetSinglePageAsync(resourceGroupName, name, context), + nextLink -> listByFleetNextSinglePageAsync(nextLink, context)); + } + + /** + * List VirtualMachineScaleSet resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFleet(String resourceGroupName, String name) { + return new PagedIterable<>(listByFleetAsync(resourceGroupName, name)); + } + + /** + * List VirtualMachineScaleSet resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Fleet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFleet(String resourceGroupName, String name, + Context context) { + return new PagedIterable<>(listByFleetAsync(resourceGroupName, name, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a VirtualMachineScaleSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFleetNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByFleetNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a VirtualMachineScaleSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFleetNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByFleetNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetsImpl.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetsImpl.java new file mode 100644 index 000000000000..903424bc2d01 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/VirtualMachineScaleSetsImpl.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.azurefleet.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurefleet.fluent.VirtualMachineScaleSetsClient; +import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSet; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSets; + +public final class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetsImpl.class); + + private final VirtualMachineScaleSetsClient innerClient; + + private final com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager; + + public VirtualMachineScaleSetsImpl(VirtualMachineScaleSetsClient innerClient, + com.azure.resourcemanager.azurefleet.AzurefleetManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByFleet(String resourceGroupName, String name) { + PagedIterable inner = this.serviceClient().listByFleet(resourceGroupName, name); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineScaleSetImpl(inner1, this.manager())); + } + + public PagedIterable listByFleet(String resourceGroupName, String name, Context context) { + PagedIterable inner + = this.serviceClient().listByFleet(resourceGroupName, name, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineScaleSetImpl(inner1, this.manager())); + } + + private VirtualMachineScaleSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurefleet.AzurefleetManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/package-info.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/package-info.java new file mode 100644 index 000000000000..c545dd343536 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for MicrosoftAzureFleet. + * null. + */ +package com.azure.resourcemanager.azurefleet.implementation; diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ActionType.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ActionType.java new file mode 100644 index 000000000000..f9a0731d0bfe --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ActionType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Static value Internal for ActionType. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContent.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContent.java new file mode 100644 index 000000000000..b419b4cd1c94 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/AdditionalUnattendContent.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies additional XML formatted information that can be included in the Unattend.xml file, which is used by + * Windows Setup. Contents are defined by setting name, component name, and the pass in which the content is applied. + */ +@Fluent +public final class AdditionalUnattendContent { + /* + * The pass name. Currently, the only allowable value is OobeSystem. + */ + @JsonProperty(value = "passName") + private PassNames passName; + + /* + * The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. + */ + @JsonProperty(value = "componentName") + private ComponentNames componentName; + + /* + * Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. + */ + @JsonProperty(value = "settingName") + private SettingNames settingName; + + /* + * Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Creates an instance of AdditionalUnattendContent class. + */ + public AdditionalUnattendContent() { + } + + /** + * Get the passName property: The pass name. Currently, the only allowable value is OobeSystem. + * + * @return the passName value. + */ + public PassNames passName() { + return this.passName; + } + + /** + * Set the passName property: The pass name. Currently, the only allowable value is OobeSystem. + * + * @param passName the passName value to set. + * @return the AdditionalUnattendContent object itself. + */ + public AdditionalUnattendContent withPassName(PassNames passName) { + this.passName = passName; + return this; + } + + /** + * Get the componentName property: The component name. Currently, the only allowable value is + * Microsoft-Windows-Shell-Setup. + * + * @return the componentName value. + */ + public ComponentNames componentName() { + return this.componentName; + } + + /** + * Set the componentName property: The component name. Currently, the only allowable value is + * Microsoft-Windows-Shell-Setup. + * + * @param componentName the componentName value to set. + * @return the AdditionalUnattendContent object itself. + */ + public AdditionalUnattendContent withComponentName(ComponentNames componentName) { + this.componentName = componentName; + return this; + } + + /** + * Get the settingName property: Specifies the name of the setting to which the content applies. Possible values + * are: FirstLogonCommands and AutoLogon. + * + * @return the settingName value. + */ + public SettingNames settingName() { + return this.settingName; + } + + /** + * Set the settingName property: Specifies the name of the setting to which the content applies. Possible values + * are: FirstLogonCommands and AutoLogon. + * + * @param settingName the settingName value to set. + * @return the AdditionalUnattendContent object itself. + */ + public AdditionalUnattendContent withSettingName(SettingNames settingName) { + this.settingName = settingName; + return this; + } + + /** + * Get the content property: Specifies the XML formatted content that is added to the unattend.xml file for the + * specified path and component. The XML must be less than 4KB and must include the root element for the setting or + * feature that is being inserted. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: Specifies the XML formatted content that is added to the unattend.xml file for the + * specified path and component. The XML must be less than 4KB and must include the root element for the setting or + * feature that is being inserted. + * + * @param content the content value to set. + * @return the AdditionalUnattendContent object itself. + */ + public AdditionalUnattendContent withContent(String content) { + this.content = content; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiEntityReference.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiEntityReference.java new file mode 100644 index 000000000000..13cb5774096b --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiEntityReference.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The API entity reference. + */ +@Fluent +public final class ApiEntityReference { + /* + * The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + */ + @JsonProperty(value = "id") + private String id; + + /** + * Creates an instance of ApiEntityReference class. + */ + public ApiEntityReference() { + } + + /** + * Get the id property: The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ARM resource id in the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + * + * @param id the id value to set. + * @return the ApiEntityReference object itself. + */ + public ApiEntityReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiError.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiError.java new file mode 100644 index 000000000000..de437ccabda8 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiError.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Api error. + */ +@Fluent +public final class ApiError { + /* + * The Api error details + */ + @JsonProperty(value = "details") + private List details; + + /* + * The Api inner error + */ + @JsonProperty(value = "innererror") + private InnerError innererror; + + /* + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The target of the particular error. + */ + @JsonProperty(value = "target") + private String target; + + /* + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Creates an instance of ApiError class. + */ + public ApiError() { + } + + /** + * Get the details property: The Api error details. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Set the details property: The Api error details. + * + * @param details the details value to set. + * @return the ApiError object itself. + */ + public ApiError withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get the innererror property: The Api inner error. + * + * @return the innererror value. + */ + public InnerError innererror() { + return this.innererror; + } + + /** + * Set the innererror property: The Api inner error. + * + * @param innererror the innererror value to set. + * @return the ApiError object itself. + */ + public ApiError withInnererror(InnerError innererror) { + this.innererror = innererror; + return this; + } + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The error code. + * + * @param code the code value to set. + * @return the ApiError object itself. + */ + public ApiError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the target property: The target of the particular error. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The target of the particular error. + * + * @param target the target value to set. + * @return the ApiError object itself. + */ + public ApiError withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The error message. + * + * @param message the message value to set. + * @return the ApiError object itself. + */ + public ApiError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + if (innererror() != null) { + innererror().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiErrorBase.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiErrorBase.java new file mode 100644 index 000000000000..6db3b669ad22 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApiErrorBase.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Api error base. + */ +@Fluent +public final class ApiErrorBase { + /* + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The target of the particular error. + */ + @JsonProperty(value = "target") + private String target; + + /* + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Creates an instance of ApiErrorBase class. + */ + public ApiErrorBase() { + } + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The error code. + * + * @param code the code value to set. + * @return the ApiErrorBase object itself. + */ + public ApiErrorBase withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the target property: The target of the particular error. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The target of the particular error. + * + * @param target the target value to set. + * @return the ApiErrorBase object itself. + */ + public ApiErrorBase withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The error message. + * + * @param message the message value to set. + * @return the ApiErrorBase object itself. + */ + public ApiErrorBase withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApplicationProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApplicationProfile.java new file mode 100644 index 000000000000..b818918f2005 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ApplicationProfile.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Contains the list of gallery applications that should be made available to the VM/VMSS. + */ +@Fluent +public final class ApplicationProfile { + /* + * Specifies the gallery applications that should be made available to the VM/VMSS + */ + @JsonProperty(value = "galleryApplications") + private List galleryApplications; + + /** + * Creates an instance of ApplicationProfile class. + */ + public ApplicationProfile() { + } + + /** + * Get the galleryApplications property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @return the galleryApplications value. + */ + public List galleryApplications() { + return this.galleryApplications; + } + + /** + * Set the galleryApplications property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @param galleryApplications the galleryApplications value to set. + * @return the ApplicationProfile object itself. + */ + public ApplicationProfile withGalleryApplications(List galleryApplications) { + this.galleryApplications = galleryApplications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (galleryApplications() != null) { + galleryApplications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BillingProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BillingProfile.java new file mode 100644 index 000000000000..566dc747c3c6 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BillingProfile.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the billing related details of a Azure Spot VM or VMSS. Minimum api-version: 2019-03-01. + */ +@Fluent +public final class BillingProfile { + /* + * Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars.

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

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

Possible values are:

- Any decimal value greater than zero. Example: 0.01538

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

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

Minimum api-version: 2019-03-01. + */ + @JsonProperty(value = "maxPrice") + private Double maxPrice; + + /** + * Creates an instance of BillingProfile class. + */ + public BillingProfile() { + } + + /** + * Get the maxPrice property: Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This + * price is in US Dollars. <br><br> This price will be compared with the current Azure Spot price for + * the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation + * will only succeed if the maxPrice is greater than the current Azure Spot price. <br><br> The maxPrice + * will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice + * after creation of VM/VMSS. <br><br> Possible values are: <br><br> - Any decimal value + * greater than zero. Example: 0.01538 <br><br> -1 – indicates default price to be up-to on-demand. + * <br><br> You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted + * for price reasons. Also, the default max price is -1 if it is not provided by you. <br><br>Minimum + * api-version: 2019-03-01. + * + * @return the maxPrice value. + */ + public Double maxPrice() { + return this.maxPrice; + } + + /** + * Set the maxPrice property: Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This + * price is in US Dollars. <br><br> This price will be compared with the current Azure Spot price for + * the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation + * will only succeed if the maxPrice is greater than the current Azure Spot price. <br><br> The maxPrice + * will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice + * after creation of VM/VMSS. <br><br> Possible values are: <br><br> - Any decimal value + * greater than zero. Example: 0.01538 <br><br> -1 – indicates default price to be up-to on-demand. + * <br><br> You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted + * for price reasons. Also, the default max price is -1 if it is not provided by you. <br><br>Minimum + * api-version: 2019-03-01. + * + * @param maxPrice the maxPrice value to set. + * @return the BillingProfile object itself. + */ + public BillingProfile withMaxPrice(Double maxPrice) { + this.maxPrice = maxPrice; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BootDiagnostics.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BootDiagnostics.java new file mode 100644 index 000000000000..1fec114b2c96 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/BootDiagnostics.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. + * You can easily view the output of your console log. Azure also enables you to see a screenshot of the VM from the + * hypervisor. + */ +@Fluent +public final class BootDiagnostics { + /* + * Whether boot diagnostics should be enabled on the Virtual Machine. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Uri of the storage account to use for placing the console output and screenshot. If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + */ + @JsonProperty(value = "storageUri") + private String storageUri; + + /** + * Creates an instance of BootDiagnostics class. + */ + public BootDiagnostics() { + } + + /** + * Get the enabled property: Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether boot diagnostics should be enabled on the Virtual Machine. + * + * @param enabled the enabled value to set. + * @return the BootDiagnostics object itself. + */ + public BootDiagnostics withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the storageUri property: Uri of the storage account to use for placing the console output and screenshot. If + * storageUri is not specified while enabling boot diagnostics, managed storage will be used. + * + * @return the storageUri value. + */ + public String storageUri() { + return this.storageUri; + } + + /** + * Set the storageUri property: Uri of the storage account to use for placing the console output and screenshot. If + * storageUri is not specified while enabling boot diagnostics, managed storage will be used. + * + * @param storageUri the storageUri value to set. + * @return the BootDiagnostics object itself. + */ + public BootDiagnostics withStorageUri(String storageUri) { + this.storageUri = storageUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CachingTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CachingTypes.java new file mode 100644 index 000000000000..d3cb81d47ce8 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CachingTypes.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values + * are: **None for Standard storage. ReadOnly for Premium storage**. + */ +public enum CachingTypes { + /** + * Enum value None. + */ + NONE("None"), + + /** + * Enum value ReadOnly. + */ + READ_ONLY("ReadOnly"), + + /** + * Enum value ReadWrite. + */ + READ_WRITE("ReadWrite"); + + /** + * The actual serialized value for a CachingTypes instance. + */ + private final String value; + + CachingTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CachingTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed CachingTypes object, or null if unable to parse. + */ + @JsonCreator + public static CachingTypes fromString(String value) { + if (value == null) { + return null; + } + CachingTypes[] items = CachingTypes.values(); + for (CachingTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CapacityReservationProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CapacityReservationProfile.java new file mode 100644 index 000000000000..91a8a24b77d6 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/CapacityReservationProfile.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters of a capacity reservation Profile. + */ +@Fluent +public final class CapacityReservationProfile { + /* + * Specifies the capacity reservation group resource id that should be used for allocating the virtual machine or scaleset vm instances provided enough capacity has been reserved. Please refer to https://aka.ms/CapacityReservation for more details. + */ + @JsonProperty(value = "capacityReservationGroup") + private SubResource capacityReservationGroup; + + /** + * Creates an instance of CapacityReservationProfile class. + */ + public CapacityReservationProfile() { + } + + /** + * Get the capacityReservationGroup property: Specifies the capacity reservation group resource id that should be + * used for allocating the virtual machine or scaleset vm instances provided enough capacity has been reserved. + * Please refer to https://aka.ms/CapacityReservation for more details. + * + * @return the capacityReservationGroup value. + */ + public SubResource capacityReservationGroup() { + return this.capacityReservationGroup; + } + + /** + * Set the capacityReservationGroup property: Specifies the capacity reservation group resource id that should be + * used for allocating the virtual machine or scaleset vm instances provided enough capacity has been reserved. + * Please refer to https://aka.ms/CapacityReservation for more details. + * + * @param capacityReservationGroup the capacityReservationGroup value to set. + * @return the CapacityReservationProfile object itself. + */ + public CapacityReservationProfile withCapacityReservationGroup(SubResource capacityReservationGroup) { + this.capacityReservationGroup = capacityReservationGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComponentNames.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComponentNames.java new file mode 100644 index 000000000000..ddd0cbe9033f --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComponentNames.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. + */ +public enum ComponentNames { + /** + * Enum value Microsoft-Windows-Shell-Setup. + */ + MICROSOFT_WINDOWS_SHELL_SETUP("Microsoft-Windows-Shell-Setup"); + + /** + * The actual serialized value for a ComponentNames instance. + */ + private final String value; + + ComponentNames(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ComponentNames instance. + * + * @param value the serialized value to parse. + * @return the parsed ComponentNames object, or null if unable to parse. + */ + @JsonCreator + public static ComponentNames fromString(String value) { + if (value == null) { + return null; + } + ComponentNames[] items = ComponentNames.values(); + for (ComponentNames item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComputeProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComputeProfile.java new file mode 100644 index 000000000000..167a2d0b3ab1 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComputeProfile.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Compute Profile to use for running user's workloads. + */ +@Fluent +public final class ComputeProfile { + /* + * Base Virtual Machine Profile Properties to be specified according to "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile" + */ + @JsonProperty(value = "baseVirtualMachineProfile", required = true) + private VirtualMachineScaleSetVMProfile baseVirtualMachineProfile; + + /* + * Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machine scale sets and Virtual Machines. + * The default value will be the latest supported computeApiVersion by Compute Fleet. + */ + @JsonProperty(value = "computeApiVersion") + private String computeApiVersion; + + /* + * Specifies the number of fault domains to use when creating the underlying VMSS. + * A fault domain is a logical group of hardware within an Azure datacenter. + * VMs in the same fault domain share a common power source and network switch. + * If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible). + * This property cannot be updated. + */ + @JsonProperty(value = "platformFaultDomainCount") + private Integer platformFaultDomainCount; + + /** + * Creates an instance of ComputeProfile class. + */ + public ComputeProfile() { + } + + /** + * Get the baseVirtualMachineProfile property: Base Virtual Machine Profile Properties to be specified according to + * "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". + * + * @return the baseVirtualMachineProfile value. + */ + public VirtualMachineScaleSetVMProfile baseVirtualMachineProfile() { + return this.baseVirtualMachineProfile; + } + + /** + * Set the baseVirtualMachineProfile property: Base Virtual Machine Profile Properties to be specified according to + * "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". + * + * @param baseVirtualMachineProfile the baseVirtualMachineProfile value to set. + * @return the ComputeProfile object itself. + */ + public ComputeProfile withBaseVirtualMachineProfile(VirtualMachineScaleSetVMProfile baseVirtualMachineProfile) { + this.baseVirtualMachineProfile = baseVirtualMachineProfile; + return this; + } + + /** + * Get the computeApiVersion property: Specifies the Microsoft.Compute API version to use when creating underlying + * Virtual Machine scale sets and Virtual Machines. + * The default value will be the latest supported computeApiVersion by Compute Fleet. + * + * @return the computeApiVersion value. + */ + public String computeApiVersion() { + return this.computeApiVersion; + } + + /** + * Set the computeApiVersion property: Specifies the Microsoft.Compute API version to use when creating underlying + * Virtual Machine scale sets and Virtual Machines. + * The default value will be the latest supported computeApiVersion by Compute Fleet. + * + * @param computeApiVersion the computeApiVersion value to set. + * @return the ComputeProfile object itself. + */ + public ComputeProfile withComputeApiVersion(String computeApiVersion) { + this.computeApiVersion = computeApiVersion; + return this; + } + + /** + * Get the platformFaultDomainCount property: Specifies the number of fault domains to use when creating the + * underlying VMSS. + * A fault domain is a logical group of hardware within an Azure datacenter. + * VMs in the same fault domain share a common power source and network switch. + * If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible). + * This property cannot be updated. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.platformFaultDomainCount; + } + + /** + * Set the platformFaultDomainCount property: Specifies the number of fault domains to use when creating the + * underlying VMSS. + * A fault domain is a logical group of hardware within an Azure datacenter. + * VMs in the same fault domain share a common power source and network switch. + * If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible). + * This property cannot be updated. + * + * @param platformFaultDomainCount the platformFaultDomainCount value to set. + * @return the ComputeProfile object itself. + */ + public ComputeProfile withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + this.platformFaultDomainCount = platformFaultDomainCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (baseVirtualMachineProfile() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property baseVirtualMachineProfile in model ComputeProfile")); + } else { + baseVirtualMachineProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ComputeProfile.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComputeProfileUpdate.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComputeProfileUpdate.java new file mode 100644 index 000000000000..25b6eab95e64 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ComputeProfileUpdate.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Compute Profile to use for running user's workloads. + */ +@Fluent +public final class ComputeProfileUpdate { + /* + * Base Virtual Machine Profile Properties to be specified according to "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile" + */ + @JsonProperty(value = "baseVirtualMachineProfile") + private VirtualMachineScaleSetVMProfile baseVirtualMachineProfile; + + /* + * Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machine scale sets and Virtual Machines. + * The default value will be the latest supported computeApiVersion by Compute Fleet. + */ + @JsonProperty(value = "computeApiVersion") + private String computeApiVersion; + + /* + * Specifies the number of fault domains to use when creating the underlying VMSS. + * A fault domain is a logical group of hardware within an Azure datacenter. + * VMs in the same fault domain share a common power source and network switch. + * If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible). + * This property cannot be updated. + */ + @JsonProperty(value = "platformFaultDomainCount") + private Integer platformFaultDomainCount; + + /** + * Creates an instance of ComputeProfileUpdate class. + */ + public ComputeProfileUpdate() { + } + + /** + * Get the baseVirtualMachineProfile property: Base Virtual Machine Profile Properties to be specified according to + * "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". + * + * @return the baseVirtualMachineProfile value. + */ + public VirtualMachineScaleSetVMProfile baseVirtualMachineProfile() { + return this.baseVirtualMachineProfile; + } + + /** + * Set the baseVirtualMachineProfile property: Base Virtual Machine Profile Properties to be specified according to + * "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". + * + * @param baseVirtualMachineProfile the baseVirtualMachineProfile value to set. + * @return the ComputeProfileUpdate object itself. + */ + public ComputeProfileUpdate + withBaseVirtualMachineProfile(VirtualMachineScaleSetVMProfile baseVirtualMachineProfile) { + this.baseVirtualMachineProfile = baseVirtualMachineProfile; + return this; + } + + /** + * Get the computeApiVersion property: Specifies the Microsoft.Compute API version to use when creating underlying + * Virtual Machine scale sets and Virtual Machines. + * The default value will be the latest supported computeApiVersion by Compute Fleet. + * + * @return the computeApiVersion value. + */ + public String computeApiVersion() { + return this.computeApiVersion; + } + + /** + * Set the computeApiVersion property: Specifies the Microsoft.Compute API version to use when creating underlying + * Virtual Machine scale sets and Virtual Machines. + * The default value will be the latest supported computeApiVersion by Compute Fleet. + * + * @param computeApiVersion the computeApiVersion value to set. + * @return the ComputeProfileUpdate object itself. + */ + public ComputeProfileUpdate withComputeApiVersion(String computeApiVersion) { + this.computeApiVersion = computeApiVersion; + return this; + } + + /** + * Get the platformFaultDomainCount property: Specifies the number of fault domains to use when creating the + * underlying VMSS. + * A fault domain is a logical group of hardware within an Azure datacenter. + * VMs in the same fault domain share a common power source and network switch. + * If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible). + * This property cannot be updated. + * + * @return the platformFaultDomainCount value. + */ + public Integer platformFaultDomainCount() { + return this.platformFaultDomainCount; + } + + /** + * Set the platformFaultDomainCount property: Specifies the number of fault domains to use when creating the + * underlying VMSS. + * A fault domain is a logical group of hardware within an Azure datacenter. + * VMs in the same fault domain share a common power source and network switch. + * If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible). + * This property cannot be updated. + * + * @param platformFaultDomainCount the platformFaultDomainCount value to set. + * @return the ComputeProfileUpdate object itself. + */ + public ComputeProfileUpdate withPlatformFaultDomainCount(Integer platformFaultDomainCount) { + this.platformFaultDomainCount = platformFaultDomainCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (baseVirtualMachineProfile() != null) { + baseVirtualMachineProfile().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DeleteOptions.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DeleteOptions.java new file mode 100644 index 000000000000..061d97ebee28 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DeleteOptions.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specify what happens to the network interface when the VM is deleted. + */ +public final class DeleteOptions extends ExpandableStringEnum { + /** + * Static value Delete for DeleteOptions. + */ + public static final DeleteOptions DELETE = fromString("Delete"); + + /** + * Static value Detach for DeleteOptions. + */ + public static final DeleteOptions DETACH = fromString("Detach"); + + /** + * Creates a new instance of DeleteOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeleteOptions() { + } + + /** + * Creates or finds a DeleteOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteOptions. + */ + @JsonCreator + public static DeleteOptions fromString(String name) { + return fromString(name, DeleteOptions.class); + } + + /** + * Gets known DeleteOptions values. + * + * @return known DeleteOptions values. + */ + public static Collection values() { + return values(DeleteOptions.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiagnosticsProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiagnosticsProfile.java new file mode 100644 index 000000000000..4b7d1f920523 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiagnosticsProfile.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. + */ +@Fluent +public final class DiagnosticsProfile { + /* + * Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. **NOTE**: If storageUri is being specified then ensure that the storage account is in the same region and subscription as the VM. You can easily view the output of your console log. Azure also enables you to see a screenshot of the VM from the hypervisor. + */ + @JsonProperty(value = "bootDiagnostics") + private BootDiagnostics bootDiagnostics; + + /** + * Creates an instance of DiagnosticsProfile class. + */ + public DiagnosticsProfile() { + } + + /** + * Get the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status. **NOTE**: If storageUri is being specified then ensure that the storage + * account is in the same region and subscription as the VM. You can easily view the output of your console log. + * Azure also enables you to see a screenshot of the VM from the hypervisor. + * + * @return the bootDiagnostics value. + */ + public BootDiagnostics bootDiagnostics() { + return this.bootDiagnostics; + } + + /** + * Set the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console Output + * and Screenshot to diagnose VM status. **NOTE**: If storageUri is being specified then ensure that the storage + * account is in the same region and subscription as the VM. You can easily view the output of your console log. + * Azure also enables you to see a screenshot of the VM from the hypervisor. + * + * @param bootDiagnostics the bootDiagnostics value to set. + * @return the DiagnosticsProfile object itself. + */ + public DiagnosticsProfile withBootDiagnostics(BootDiagnostics bootDiagnostics) { + this.bootDiagnostics = bootDiagnostics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bootDiagnostics() != null) { + bootDiagnostics().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiffDiskOptions.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiffDiskOptions.java new file mode 100644 index 000000000000..8165836d904a --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiffDiskOptions.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the ephemeral disk option for operating system disk. + */ +public final class DiffDiskOptions extends ExpandableStringEnum { + /** + * Static value Local for DiffDiskOptions. + */ + public static final DiffDiskOptions LOCAL = fromString("Local"); + + /** + * Creates a new instance of DiffDiskOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiffDiskOptions() { + } + + /** + * Creates or finds a DiffDiskOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiffDiskOptions. + */ + @JsonCreator + public static DiffDiskOptions fromString(String name) { + return fromString(name, DiffDiskOptions.class); + } + + /** + * Gets known DiffDiskOptions values. + * + * @return known DiffDiskOptions values. + */ + public static Collection values() { + return values(DiffDiskOptions.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiffDiskPlacement.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiffDiskPlacement.java new file mode 100644 index 000000000000..7d3211f3e704 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiffDiskPlacement.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.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the ephemeral disk placement for operating system disk. This property can be used by user in the request to + * choose the location i.e, cache disk or resource disk space for Ephemeral OS disk provisioning. For more information + * on Ephemeral OS disk size requirements, please refer Ephemeral OS disk size requirements for Windows VM at + * https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + */ +public final class DiffDiskPlacement extends ExpandableStringEnum { + /** + * Static value CacheDisk for DiffDiskPlacement. + */ + public static final DiffDiskPlacement CACHE_DISK = fromString("CacheDisk"); + + /** + * Static value ResourceDisk for DiffDiskPlacement. + */ + public static final DiffDiskPlacement RESOURCE_DISK = fromString("ResourceDisk"); + + /** + * Creates a new instance of DiffDiskPlacement value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiffDiskPlacement() { + } + + /** + * Creates or finds a DiffDiskPlacement from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiffDiskPlacement. + */ + @JsonCreator + public static DiffDiskPlacement fromString(String name) { + return fromString(name, DiffDiskPlacement.class); + } + + /** + * Gets known DiffDiskPlacement values. + * + * @return known DiffDiskPlacement values. + */ + public static Collection values() { + return values(DiffDiskPlacement.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiffDiskSettings.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiffDiskSettings.java new file mode 100644 index 000000000000..c7b0f2e9c81a --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiffDiskSettings.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters of ephemeral disk settings that can be specified for operating system disk. **Note:** The + * ephemeral disk settings can only be specified for managed disk. + */ +@Fluent +public final class DiffDiskSettings { + /* + * Specifies the ephemeral disk settings for operating system disk. + */ + @JsonProperty(value = "option") + private DiffDiskOptions option; + + /* + * Specifies the ephemeral disk placement for operating system disk. Possible values are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is used. Refer to the VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. + */ + @JsonProperty(value = "placement") + private DiffDiskPlacement placement; + + /** + * Creates an instance of DiffDiskSettings class. + */ + public DiffDiskSettings() { + } + + /** + * Get the option property: Specifies the ephemeral disk settings for operating system disk. + * + * @return the option value. + */ + public DiffDiskOptions option() { + return this.option; + } + + /** + * Set the option property: Specifies the ephemeral disk settings for operating system disk. + * + * @param option the option value to set. + * @return the DiffDiskSettings object itself. + */ + public DiffDiskSettings withOption(DiffDiskOptions option) { + this.option = option; + return this; + } + + /** + * Get the placement property: Specifies the ephemeral disk placement for operating system disk. Possible values + * are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: **CacheDisk** if one is configured for the VM + * size otherwise **ResourceDisk** is used. Refer to the VM size documentation for Windows VM at + * https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. + * + * @return the placement value. + */ + public DiffDiskPlacement placement() { + return this.placement; + } + + /** + * Set the placement property: Specifies the ephemeral disk placement for operating system disk. Possible values + * are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: **CacheDisk** if one is configured for the VM + * size otherwise **ResourceDisk** is used. Refer to the VM size documentation for Windows VM at + * https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + * https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. + * + * @param placement the placement value to set. + * @return the DiffDiskSettings object itself. + */ + public DiffDiskSettings withPlacement(DiffDiskPlacement placement) { + this.placement = placement; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiskCreateOptionTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiskCreateOptionTypes.java new file mode 100644 index 000000000000..06d7ff50b61a --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiskCreateOptionTypes.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are + * using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image + * to create the virtual machine. If you are using a platform image, you also use the imageReference element described + * above. If you are using a marketplace image, you also use the plan element previously described. + */ +public final class DiskCreateOptionTypes extends ExpandableStringEnum { + /** + * Static value FromImage for DiskCreateOptionTypes. + */ + public static final DiskCreateOptionTypes FROM_IMAGE = fromString("FromImage"); + + /** + * Static value Empty for DiskCreateOptionTypes. + */ + public static final DiskCreateOptionTypes EMPTY = fromString("Empty"); + + /** + * Static value Attach for DiskCreateOptionTypes. + */ + public static final DiskCreateOptionTypes ATTACH = fromString("Attach"); + + /** + * Creates a new instance of DiskCreateOptionTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskCreateOptionTypes() { + } + + /** + * Creates or finds a DiskCreateOptionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskCreateOptionTypes. + */ + @JsonCreator + public static DiskCreateOptionTypes fromString(String name) { + return fromString(name, DiskCreateOptionTypes.class); + } + + /** + * Gets known DiskCreateOptionTypes values. + * + * @return known DiskCreateOptionTypes values. + */ + public static Collection values() { + return values(DiskCreateOptionTypes.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiskDeleteOptionTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiskDeleteOptionTypes.java new file mode 100644 index 000000000000..e20ff0a06267 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiskDeleteOptionTypes.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the behavior of the managed disk when the VM gets deleted, for example whether the managed disk is deleted + * or detached. Supported values are: **Delete.** If this value is used, the managed disk is deleted when VM gets + * deleted. **Detach.** If this value is used, the managed disk is retained after VM gets deleted. Minimum api-version: + * 2021-03-01. + */ +public final class DiskDeleteOptionTypes extends ExpandableStringEnum { + /** + * Static value Delete for DiskDeleteOptionTypes. + */ + public static final DiskDeleteOptionTypes DELETE = fromString("Delete"); + + /** + * Static value Detach for DiskDeleteOptionTypes. + */ + public static final DiskDeleteOptionTypes DETACH = fromString("Detach"); + + /** + * Creates a new instance of DiskDeleteOptionTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskDeleteOptionTypes() { + } + + /** + * Creates or finds a DiskDeleteOptionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskDeleteOptionTypes. + */ + @JsonCreator + public static DiskDeleteOptionTypes fromString(String name) { + return fromString(name, DiskDeleteOptionTypes.class); + } + + /** + * Gets known DiskDeleteOptionTypes values. + * + * @return known DiskDeleteOptionTypes values. + */ + public static Collection values() { + return values(DiskDeleteOptionTypes.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiskEncryptionSetParameters.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiskEncryptionSetParameters.java new file mode 100644 index 000000000000..a6198c0620a3 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DiskEncryptionSetParameters.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; + +/** + * Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. **Note:** + * The disk encryption set resource id can only be specified for managed disk. Please refer + * https://aka.ms/mdssewithcmkoverview for more details. + */ +@Fluent +public final class DiskEncryptionSetParameters extends SubResource { + /** + * Creates an instance of DiskEncryptionSetParameters class. + */ + public DiskEncryptionSetParameters() { + } + + /** + * {@inheritDoc} + */ + @Override + public DiskEncryptionSetParameters withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DomainNameLabelScopeTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DomainNameLabelScopeTypes.java new file mode 100644 index 000000000000..1869978ba95e --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/DomainNameLabelScopeTypes.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The Domain name label scope.The concatenation of the hashed domain name label that generated according to the policy + * from domain name label scope and vm index will be the domain name labels of the PublicIPAddress resources that will + * be created. + */ +public final class DomainNameLabelScopeTypes extends ExpandableStringEnum { + /** + * Static value TenantReuse for DomainNameLabelScopeTypes. + */ + public static final DomainNameLabelScopeTypes TENANT_REUSE = fromString("TenantReuse"); + + /** + * Static value SubscriptionReuse for DomainNameLabelScopeTypes. + */ + public static final DomainNameLabelScopeTypes SUBSCRIPTION_REUSE = fromString("SubscriptionReuse"); + + /** + * Static value ResourceGroupReuse for DomainNameLabelScopeTypes. + */ + public static final DomainNameLabelScopeTypes RESOURCE_GROUP_REUSE = fromString("ResourceGroupReuse"); + + /** + * Static value NoReuse for DomainNameLabelScopeTypes. + */ + public static final DomainNameLabelScopeTypes NO_REUSE = fromString("NoReuse"); + + /** + * Creates a new instance of DomainNameLabelScopeTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DomainNameLabelScopeTypes() { + } + + /** + * Creates or finds a DomainNameLabelScopeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding DomainNameLabelScopeTypes. + */ + @JsonCreator + public static DomainNameLabelScopeTypes fromString(String name) { + return fromString(name, DomainNameLabelScopeTypes.class); + } + + /** + * Gets known DomainNameLabelScopeTypes values. + * + * @return known DomainNameLabelScopeTypes values. + */ + public static Collection values() { + return values(DomainNameLabelScopeTypes.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/EncryptionIdentity.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/EncryptionIdentity.java new file mode 100644 index 000000000000..0640ba3fe03a --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/EncryptionIdentity.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the Managed Identity used by ADE to get access token for keyvault operations. + */ +@Fluent +public final class EncryptionIdentity { + /* + * Specifies ARM Resource ID of one of the user identities associated with the VM. + */ + @JsonProperty(value = "userAssignedIdentityResourceId") + private String userAssignedIdentityResourceId; + + /** + * Creates an instance of EncryptionIdentity class. + */ + public EncryptionIdentity() { + } + + /** + * Get the userAssignedIdentityResourceId property: Specifies ARM Resource ID of one of the user identities + * associated with the VM. + * + * @return the userAssignedIdentityResourceId value. + */ + public String userAssignedIdentityResourceId() { + return this.userAssignedIdentityResourceId; + } + + /** + * Set the userAssignedIdentityResourceId property: Specifies ARM Resource ID of one of the user identities + * associated with the VM. + * + * @param userAssignedIdentityResourceId the userAssignedIdentityResourceId value to set. + * @return the EncryptionIdentity object itself. + */ + public EncryptionIdentity withUserAssignedIdentityResourceId(String userAssignedIdentityResourceId) { + this.userAssignedIdentityResourceId = userAssignedIdentityResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/EvictionPolicy.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/EvictionPolicy.java new file mode 100644 index 000000000000..9a2ae6b4189d --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/EvictionPolicy.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Different kind of eviction policies. + */ +public final class EvictionPolicy extends ExpandableStringEnum { + /** + * Static value Delete for EvictionPolicy. + */ + public static final EvictionPolicy DELETE = fromString("Delete"); + + /** + * Static value Deallocate for EvictionPolicy. + */ + public static final EvictionPolicy DEALLOCATE = fromString("Deallocate"); + + /** + * Creates a new instance of EvictionPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EvictionPolicy() { + } + + /** + * Creates or finds a EvictionPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding EvictionPolicy. + */ + @JsonCreator + public static EvictionPolicy fromString(String name) { + return fromString(name, EvictionPolicy.class); + } + + /** + * Gets known EvictionPolicy values. + * + * @return known EvictionPolicy values. + */ + public static Collection values() { + return values(EvictionPolicy.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Fleet.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Fleet.java new file mode 100644 index 000000000000..256d6690dbf2 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Fleet.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.azurefleet.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurefleet.fluent.models.FleetInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of Fleet. + */ +public interface Fleet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the zones property: Zones in which the Compute Fleet is available. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the plan property: Details of the resource plan. + * + * @return the plan value. + */ + Plan plan(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet. + * + * @return the spotPriorityProfile value. + */ + SpotPriorityProfile spotPriorityProfile(); + + /** + * Gets the regularPriorityProfile property: Configuration Options for Regular instances in Compute Fleet. + * + * @return the regularPriorityProfile value. + */ + RegularPriorityProfile regularPriorityProfile(); + + /** + * Gets the vmSizesProfile property: List of VM sizes supported for Compute Fleet. + * + * @return the vmSizesProfile value. + */ + List vmSizesProfile(); + + /** + * Gets the computeProfile property: Compute Profile to use for running user's workloads. + * + * @return the computeProfile value. + */ + ComputeProfile computeProfile(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.azurefleet.fluent.models.FleetInner object. + * + * @return the inner object. + */ + FleetInner innerModel(); + + /** + * The entirety of the Fleet definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Fleet definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Fleet definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Fleet definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Fleet definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Fleet definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithZones, + DefinitionStages.WithIdentity, DefinitionStages.WithPlan, DefinitionStages.WithSpotPriorityProfile, + DefinitionStages.WithRegularPriorityProfile, DefinitionStages.WithVmSizesProfile, + DefinitionStages.WithComputeProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + Fleet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Fleet create(Context context); + } + + /** + * The stage of the Fleet definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Fleet definition allowing to specify zones. + */ + interface WithZones { + /** + * Specifies the zones property: Zones in which the Compute Fleet is available. + * + * @param zones Zones in which the Compute Fleet is available. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + + /** + * The stage of the Fleet definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the Fleet definition allowing to specify plan. + */ + interface WithPlan { + /** + * Specifies the plan property: Details of the resource plan.. + * + * @param plan Details of the resource plan. + * @return the next definition stage. + */ + WithCreate withPlan(Plan plan); + } + + /** + * The stage of the Fleet definition allowing to specify spotPriorityProfile. + */ + interface WithSpotPriorityProfile { + /** + * Specifies the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet.. + * + * @param spotPriorityProfile Configuration Options for Spot instances in Compute Fleet. + * @return the next definition stage. + */ + WithCreate withSpotPriorityProfile(SpotPriorityProfile spotPriorityProfile); + } + + /** + * The stage of the Fleet definition allowing to specify regularPriorityProfile. + */ + interface WithRegularPriorityProfile { + /** + * Specifies the regularPriorityProfile property: Configuration Options for Regular instances in Compute + * Fleet.. + * + * @param regularPriorityProfile Configuration Options for Regular instances in Compute Fleet. + * @return the next definition stage. + */ + WithCreate withRegularPriorityProfile(RegularPriorityProfile regularPriorityProfile); + } + + /** + * The stage of the Fleet definition allowing to specify vmSizesProfile. + */ + interface WithVmSizesProfile { + /** + * Specifies the vmSizesProfile property: List of VM sizes supported for Compute Fleet. + * + * @param vmSizesProfile List of VM sizes supported for Compute Fleet. + * @return the next definition stage. + */ + WithCreate withVmSizesProfile(List vmSizesProfile); + } + + /** + * The stage of the Fleet definition allowing to specify computeProfile. + */ + interface WithComputeProfile { + /** + * Specifies the computeProfile property: Compute Profile to use for running user's workloads.. + * + * @param computeProfile Compute Profile to use for running user's workloads. + * @return the next definition stage. + */ + WithCreate withComputeProfile(ComputeProfile computeProfile); + } + } + + /** + * Begins update for the Fleet resource. + * + * @return the stage of resource update. + */ + Fleet.Update update(); + + /** + * The template for Fleet update. + */ + interface Update + extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithPlan, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Fleet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Fleet apply(Context context); + } + + /** + * The Fleet update stages. + */ + interface UpdateStages { + /** + * The stage of the Fleet update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the Fleet update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Updatable managed service identity. + * + * @param identity Updatable managed service identity. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentityUpdate identity); + } + + /** + * The stage of the Fleet update allowing to specify plan. + */ + interface WithPlan { + /** + * Specifies the plan property: Updatable resource plan. + * + * @param plan Updatable resource plan. + * @return the next definition stage. + */ + Update withPlan(ResourcePlanUpdate plan); + } + + /** + * The stage of the Fleet update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: RP-specific updatable properties. + * + * @param properties RP-specific updatable properties. + * @return the next definition stage. + */ + Update withProperties(FleetPropertiesUpdate properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Fleet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Fleet refresh(Context context); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/FleetListResult.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/FleetListResult.java new file mode 100644 index 000000000000..2b0c9a848342 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/FleetListResult.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurefleet.fluent.models.FleetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response of a Fleet list operation. + */ +@Fluent +public final class FleetListResult { + /* + * The Fleet items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of FleetListResult class. + */ + public FleetListResult() { + } + + /** + * Get the value property: The Fleet items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Fleet items on this page. + * + * @param value the value value to set. + * @return the FleetListResult object itself. + */ + public FleetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the FleetListResult object itself. + */ + public FleetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model FleetListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FleetListResult.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/FleetPropertiesUpdate.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/FleetPropertiesUpdate.java new file mode 100644 index 000000000000..a7a4014835f0 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/FleetPropertiesUpdate.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Details of the Compute Fleet. + */ +@Fluent +public final class FleetPropertiesUpdate { + /* + * Configuration Options for Spot instances in Compute Fleet. + */ + @JsonProperty(value = "spotPriorityProfile") + private SpotPriorityProfile spotPriorityProfile; + + /* + * Configuration Options for Regular instances in Compute Fleet. + */ + @JsonProperty(value = "regularPriorityProfile") + private RegularPriorityProfile regularPriorityProfile; + + /* + * List of VM sizes supported for Compute Fleet + */ + @JsonProperty(value = "vmSizesProfile") + private List vmSizesProfile; + + /* + * Compute Profile to use for running user's workloads. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfileUpdate computeProfile; + + /** + * Creates an instance of FleetPropertiesUpdate class. + */ + public FleetPropertiesUpdate() { + } + + /** + * Get the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet. + * + * @return the spotPriorityProfile value. + */ + public SpotPriorityProfile spotPriorityProfile() { + return this.spotPriorityProfile; + } + + /** + * Set the spotPriorityProfile property: Configuration Options for Spot instances in Compute Fleet. + * + * @param spotPriorityProfile the spotPriorityProfile value to set. + * @return the FleetPropertiesUpdate object itself. + */ + public FleetPropertiesUpdate withSpotPriorityProfile(SpotPriorityProfile spotPriorityProfile) { + this.spotPriorityProfile = spotPriorityProfile; + return this; + } + + /** + * Get the regularPriorityProfile property: Configuration Options for Regular instances in Compute Fleet. + * + * @return the regularPriorityProfile value. + */ + public RegularPriorityProfile regularPriorityProfile() { + return this.regularPriorityProfile; + } + + /** + * Set the regularPriorityProfile property: Configuration Options for Regular instances in Compute Fleet. + * + * @param regularPriorityProfile the regularPriorityProfile value to set. + * @return the FleetPropertiesUpdate object itself. + */ + public FleetPropertiesUpdate withRegularPriorityProfile(RegularPriorityProfile regularPriorityProfile) { + this.regularPriorityProfile = regularPriorityProfile; + return this; + } + + /** + * Get the vmSizesProfile property: List of VM sizes supported for Compute Fleet. + * + * @return the vmSizesProfile value. + */ + public List vmSizesProfile() { + return this.vmSizesProfile; + } + + /** + * Set the vmSizesProfile property: List of VM sizes supported for Compute Fleet. + * + * @param vmSizesProfile the vmSizesProfile value to set. + * @return the FleetPropertiesUpdate object itself. + */ + public FleetPropertiesUpdate withVmSizesProfile(List vmSizesProfile) { + this.vmSizesProfile = vmSizesProfile; + return this; + } + + /** + * Get the computeProfile property: Compute Profile to use for running user's workloads. + * + * @return the computeProfile value. + */ + public ComputeProfileUpdate computeProfile() { + return this.computeProfile; + } + + /** + * Set the computeProfile property: Compute Profile to use for running user's workloads. + * + * @param computeProfile the computeProfile value to set. + * @return the FleetPropertiesUpdate object itself. + */ + public FleetPropertiesUpdate withComputeProfile(ComputeProfileUpdate computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (spotPriorityProfile() != null) { + spotPriorityProfile().validate(); + } + if (regularPriorityProfile() != null) { + regularPriorityProfile().validate(); + } + if (vmSizesProfile() != null) { + vmSizesProfile().forEach(e -> e.validate()); + } + if (computeProfile() != null) { + computeProfile().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/FleetUpdate.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/FleetUpdate.java new file mode 100644 index 000000000000..74fb254d8a36 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/FleetUpdate.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Fleet Update Model. + */ +@Fluent +public final class FleetUpdate { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Updatable managed service identity + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentityUpdate identity; + + /* + * Updatable resource plan + */ + @JsonProperty(value = "plan") + private ResourcePlanUpdate plan; + + /* + * RP-specific updatable properties + */ + @JsonProperty(value = "properties") + private FleetPropertiesUpdate properties; + + /** + * Creates an instance of FleetUpdate class. + */ + public FleetUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the FleetUpdate object itself. + */ + public FleetUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: Updatable managed service identity. + * + * @return the identity value. + */ + public ManagedServiceIdentityUpdate identity() { + return this.identity; + } + + /** + * Set the identity property: Updatable managed service identity. + * + * @param identity the identity value to set. + * @return the FleetUpdate object itself. + */ + public FleetUpdate withIdentity(ManagedServiceIdentityUpdate identity) { + this.identity = identity; + return this; + } + + /** + * Get the plan property: Updatable resource plan. + * + * @return the plan value. + */ + public ResourcePlanUpdate plan() { + return this.plan; + } + + /** + * Set the plan property: Updatable resource plan. + * + * @param plan the plan value to set. + * @return the FleetUpdate object itself. + */ + public FleetUpdate withPlan(ResourcePlanUpdate plan) { + this.plan = plan; + return this; + } + + /** + * Get the properties property: RP-specific updatable properties. + * + * @return the properties value. + */ + public FleetPropertiesUpdate properties() { + return this.properties; + } + + /** + * Set the properties property: RP-specific updatable properties. + * + * @param properties the properties value to set. + * @return the FleetUpdate object itself. + */ + public FleetUpdate withProperties(FleetPropertiesUpdate properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (plan() != null) { + plan().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Fleets.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Fleets.java new file mode 100644 index 000000000000..d8ec3d6d5fd5 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Fleets.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Fleets. + */ +public interface Fleets { + /** + * List Fleet resources by subscription ID. + * + * @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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Fleet resources by subscription ID. + * + * @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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Fleet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Fleet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a Fleet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @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 Fleet along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String fleetName, Context context); + + /** + * Get a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @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 Fleet. + */ + Fleet getByResourceGroup(String resourceGroupName, String fleetName); + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @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. + */ + void deleteByResourceGroup(String resourceGroupName, String fleetName); + + /** + * Delete a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Compute Fleet. + * @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. + */ + void delete(String resourceGroupName, String fleetName, Context context); + + /** + * Get a Fleet. + * + * @param id the resource ID. + * @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 Fleet along with {@link Response}. + */ + Fleet getById(String id); + + /** + * Get a Fleet. + * + * @param id the resource ID. + * @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 Fleet along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Fleet. + * + * @param id the resource ID. + * @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. + */ + void deleteById(String id); + + /** + * Delete a Fleet. + * + * @param id the resource ID. + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Fleet resource. + * + * @param name resource name. + * @return the first stage of the new Fleet definition. + */ + Fleet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ImageReference.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ImageReference.java new file mode 100644 index 000000000000..0260010444b5 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ImageReference.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies information about the image to use. You can specify information about platform images, marketplace images, + * or virtual machine images. This element is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can + * only be set when you create the scale set. + */ +@Fluent +public final class ImageReference extends SubResource { + /* + * The image publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Specifies the offer of the platform image or marketplace image used to create the virtual machine. + */ + @JsonProperty(value = "offer") + private String offer; + + /* + * The image SKU. + */ + @JsonProperty(value = "sku") + private String sku; + + /* + * Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for deployment, to use 'latest' version of gallery image, just set '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' in the 'id' field without version input. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'. + */ + @JsonProperty(value = "exactVersion", access = JsonProperty.Access.WRITE_ONLY) + private String exactVersion; + + /* + * Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call. + */ + @JsonProperty(value = "sharedGalleryImageId") + private String sharedGalleryImageId; + + /* + * Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET call. + */ + @JsonProperty(value = "communityGalleryImageId") + private String communityGalleryImageId; + + /** + * Creates an instance of ImageReference class. + */ + public ImageReference() { + } + + /** + * Get the publisher property: The image publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The image publisher. + * + * @param publisher the publisher value to set. + * @return the ImageReference object itself. + */ + public ImageReference withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual + * machine. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual + * machine. + * + * @param offer the offer value to set. + * @return the ImageReference object itself. + */ + public ImageReference withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the sku property: The image SKU. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The image SKU. + * + * @param sku the sku value to set. + * @return the ImageReference object itself. + */ + public ImageReference withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the version property: Specifies the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal + * numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. + * Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for + * deployment, to use 'latest' version of gallery image, just set + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + * in the 'id' field without version input. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Specifies the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal + * numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. + * Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for + * deployment, to use 'latest' version of gallery image, just set + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + * in the 'id' field without version input. + * + * @param version the version value to set. + * @return the ImageReference object itself. + */ + public ImageReference withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the exactVersion property: Specifies in decimal numbers, the version of platform image or marketplace image + * used to create the virtual machine. This readonly field differs from 'version', only if the value specified in + * 'version' field is 'latest'. + * + * @return the exactVersion value. + */ + public String exactVersion() { + return this.exactVersion; + } + + /** + * Get the sharedGalleryImageId property: Specified the shared gallery image unique id for vm deployment. This can + * be fetched from shared gallery image GET call. + * + * @return the sharedGalleryImageId value. + */ + public String sharedGalleryImageId() { + return this.sharedGalleryImageId; + } + + /** + * Set the sharedGalleryImageId property: Specified the shared gallery image unique id for vm deployment. This can + * be fetched from shared gallery image GET call. + * + * @param sharedGalleryImageId the sharedGalleryImageId value to set. + * @return the ImageReference object itself. + */ + public ImageReference withSharedGalleryImageId(String sharedGalleryImageId) { + this.sharedGalleryImageId = sharedGalleryImageId; + return this; + } + + /** + * Get the communityGalleryImageId property: Specified the community gallery image unique id for vm deployment. This + * can be fetched from community gallery image GET call. + * + * @return the communityGalleryImageId value. + */ + public String communityGalleryImageId() { + return this.communityGalleryImageId; + } + + /** + * Set the communityGalleryImageId property: Specified the community gallery image unique id for vm deployment. This + * can be fetched from community gallery image GET call. + * + * @param communityGalleryImageId the communityGalleryImageId value to set. + * @return the ImageReference object itself. + */ + public ImageReference withCommunityGalleryImageId(String communityGalleryImageId) { + this.communityGalleryImageId = communityGalleryImageId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ImageReference withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/InnerError.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/InnerError.java new file mode 100644 index 000000000000..e15fcaf88e3f --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/InnerError.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Inner error details. + */ +@Fluent +public final class InnerError { + /* + * The exception type. + */ + @JsonProperty(value = "exceptiontype") + private String exceptiontype; + + /* + * The internal error message or exception dump. + */ + @JsonProperty(value = "errordetail") + private String errordetail; + + /** + * Creates an instance of InnerError class. + */ + public InnerError() { + } + + /** + * Get the exceptiontype property: The exception type. + * + * @return the exceptiontype value. + */ + public String exceptiontype() { + return this.exceptiontype; + } + + /** + * Set the exceptiontype property: The exception type. + * + * @param exceptiontype the exceptiontype value to set. + * @return the InnerError object itself. + */ + public InnerError withExceptiontype(String exceptiontype) { + this.exceptiontype = exceptiontype; + return this; + } + + /** + * Get the errordetail property: The internal error message or exception dump. + * + * @return the errordetail value. + */ + public String errordetail() { + return this.errordetail; + } + + /** + * Set the errordetail property: The internal error message or exception dump. + * + * @param errordetail the errordetail value to set. + * @return the InnerError object itself. + */ + public InnerError withErrordetail(String errordetail) { + this.errordetail = errordetail; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/InstanceViewStatus.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/InstanceViewStatus.java new file mode 100644 index 000000000000..94b6798b280a --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/InstanceViewStatus.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Instance view status. + */ +@Fluent +public final class InstanceViewStatus { + /* + * The status code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The level code. + */ + @JsonProperty(value = "level") + private StatusLevelTypes level; + + /* + * The short localizable label for the status. + */ + @JsonProperty(value = "displayStatus") + private String displayStatus; + + /* + * The detailed status message, including for alerts and error messages. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The time of the status. + */ + @JsonProperty(value = "time") + private OffsetDateTime time; + + /** + * Creates an instance of InstanceViewStatus class. + */ + public InstanceViewStatus() { + } + + /** + * Get the code property: The status code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The status code. + * + * @param code the code value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the level property: The level code. + * + * @return the level value. + */ + public StatusLevelTypes level() { + return this.level; + } + + /** + * Set the level property: The level code. + * + * @param level the level value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withLevel(StatusLevelTypes level) { + this.level = level; + return this; + } + + /** + * Get the displayStatus property: The short localizable label for the status. + * + * @return the displayStatus value. + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Set the displayStatus property: The short localizable label for the status. + * + * @param displayStatus the displayStatus value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withDisplayStatus(String displayStatus) { + this.displayStatus = displayStatus; + return this; + } + + /** + * Get the message property: The detailed status message, including for alerts and error messages. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The detailed status message, including for alerts and error messages. + * + * @param message the message value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the time property: The time of the status. + * + * @return the time value. + */ + public OffsetDateTime time() { + return this.time; + } + + /** + * Set the time property: The time of the status. + * + * @param time the time value to set. + * @return the InstanceViewStatus object itself. + */ + public InstanceViewStatus withTime(OffsetDateTime time) { + this.time = time; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/IpVersion.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/IpVersion.java new file mode 100644 index 000000000000..0d806e102d07 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/IpVersion.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. + * Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + */ +public final class IpVersion extends ExpandableStringEnum { + /** + * Static value IPv4 for IpVersion. + */ + public static final IpVersion IPV4 = fromString("IPv4"); + + /** + * Static value IPv6 for IpVersion. + */ + public static final IpVersion IPV6 = fromString("IPv6"); + + /** + * Creates a new instance of IpVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpVersion() { + } + + /** + * Creates or finds a IpVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpVersion. + */ + @JsonCreator + public static IpVersion fromString(String name) { + return fromString(name, IpVersion.class); + } + + /** + * Gets known IpVersion values. + * + * @return known IpVersion values. + */ + public static Collection values() { + return values(IpVersion.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/KeyVaultSecretReference.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/KeyVaultSecretReference.java new file mode 100644 index 000000000000..a17b411fe94f --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/KeyVaultSecretReference.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a reference to Key Vault Secret. + */ +@Fluent +public final class KeyVaultSecretReference { + /* + * The URL referencing a secret in a Key Vault. + */ + @JsonProperty(value = "secretUrl", required = true) + private String secretUrl; + + /* + * The relative URL of the Key Vault containing the secret. + */ + @JsonProperty(value = "sourceVault", required = true) + private SubResource sourceVault; + + /** + * Creates an instance of KeyVaultSecretReference class. + */ + public KeyVaultSecretReference() { + } + + /** + * Get the secretUrl property: The URL referencing a secret in a Key Vault. + * + * @return the secretUrl value. + */ + public String secretUrl() { + return this.secretUrl; + } + + /** + * Set the secretUrl property: The URL referencing a secret in a Key Vault. + * + * @param secretUrl the secretUrl value to set. + * @return the KeyVaultSecretReference object itself. + */ + public KeyVaultSecretReference withSecretUrl(String secretUrl) { + this.secretUrl = secretUrl; + return this; + } + + /** + * Get the sourceVault property: The relative URL of the Key Vault containing the secret. + * + * @return the sourceVault value. + */ + public SubResource sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: The relative URL of the Key Vault containing the secret. + * + * @param sourceVault the sourceVault value to set. + * @return the KeyVaultSecretReference object itself. + */ + public KeyVaultSecretReference withSourceVault(SubResource sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secretUrl() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property secretUrl in model KeyVaultSecretReference")); + } + if (sourceVault() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceVault in model KeyVaultSecretReference")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultSecretReference.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxConfiguration.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxConfiguration.java new file mode 100644 index 000000000000..8dcc67df008f --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxConfiguration.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, + * see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + */ +@Fluent +public final class LinuxConfiguration { + /* + * Specifies whether password authentication should be disabled. + */ + @JsonProperty(value = "disablePasswordAuthentication") + private Boolean disablePasswordAuthentication; + + /* + * Specifies the ssh key configuration for a Linux OS. + */ + @JsonProperty(value = "ssh") + private SshConfiguration ssh; + + /* + * Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. + */ + @JsonProperty(value = "provisionVMAgent") + private Boolean provisionVMAgent; + + /* + * [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + */ + @JsonProperty(value = "patchSettings") + private LinuxPatchSettings patchSettings; + + /* + * Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false. + */ + @JsonProperty(value = "enableVMAgentPlatformUpdates") + private Boolean enableVMAgentPlatformUpdates; + + /** + * Creates an instance of LinuxConfiguration class. + */ + public LinuxConfiguration() { + } + + /** + * Get the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. + * + * @return the disablePasswordAuthentication value. + */ + public Boolean disablePasswordAuthentication() { + return this.disablePasswordAuthentication; + } + + /** + * Set the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. + * + * @param disablePasswordAuthentication the disablePasswordAuthentication value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withDisablePasswordAuthentication(Boolean disablePasswordAuthentication) { + this.disablePasswordAuthentication = disablePasswordAuthentication; + return this; + } + + /** + * Get the ssh property: Specifies the ssh key configuration for a Linux OS. + * + * @return the ssh value. + */ + public SshConfiguration ssh() { + return this.ssh; + } + + /** + * Set the ssh property: Specifies the ssh key configuration for a Linux OS. + * + * @param ssh the ssh value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withSsh(SshConfiguration ssh) { + this.ssh = ssh; + return this; + } + + /** + * Get the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual + * machine. When this property is not specified in the request body, default behavior is to set it to true. This + * will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. + * + * @return the provisionVMAgent value. + */ + public Boolean provisionVMAgent() { + return this.provisionVMAgent; + } + + /** + * Set the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual + * machine. When this property is not specified in the request body, default behavior is to set it to true. This + * will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. + * + * @param provisionVMAgent the provisionVMAgent value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withProvisionVMAgent(Boolean provisionVMAgent) { + this.provisionVMAgent = provisionVMAgent; + return this; + } + + /** + * Get the patchSettings property: [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + * + * @return the patchSettings value. + */ + public LinuxPatchSettings patchSettings() { + return this.patchSettings; + } + + /** + * Set the patchSettings property: [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + * + * @param patchSettings the patchSettings value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withPatchSettings(LinuxPatchSettings patchSettings) { + this.patchSettings = patchSettings; + return this; + } + + /** + * Get the enableVMAgentPlatformUpdates property: Indicates whether VMAgent Platform Updates is enabled for the + * Linux virtual machine. Default value is false. + * + * @return the enableVMAgentPlatformUpdates value. + */ + public Boolean enableVMAgentPlatformUpdates() { + return this.enableVMAgentPlatformUpdates; + } + + /** + * Set the enableVMAgentPlatformUpdates property: Indicates whether VMAgent Platform Updates is enabled for the + * Linux virtual machine. Default value is false. + * + * @param enableVMAgentPlatformUpdates the enableVMAgentPlatformUpdates value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withEnableVMAgentPlatformUpdates(Boolean enableVMAgentPlatformUpdates) { + this.enableVMAgentPlatformUpdates = enableVMAgentPlatformUpdates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ssh() != null) { + ssh().validate(); + } + if (patchSettings() != null) { + patchSettings().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxPatchAssessmentMode.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxPatchAssessmentMode.java new file mode 100644 index 000000000000..43a2da93bc0f --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxPatchAssessmentMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.<br /><br /> Possible values + * are:<br /><br /> **ImageDefault** - You control the timing of patch assessments on a virtual machine. + * <br /><br /> **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property + * provisionVMAgent must be true. + */ +public final class LinuxPatchAssessmentMode extends ExpandableStringEnum { + /** + * Static value ImageDefault for LinuxPatchAssessmentMode. + */ + public static final LinuxPatchAssessmentMode IMAGE_DEFAULT = fromString("ImageDefault"); + + /** + * Static value AutomaticByPlatform for LinuxPatchAssessmentMode. + */ + public static final LinuxPatchAssessmentMode AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates a new instance of LinuxPatchAssessmentMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinuxPatchAssessmentMode() { + } + + /** + * Creates or finds a LinuxPatchAssessmentMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinuxPatchAssessmentMode. + */ + @JsonCreator + public static LinuxPatchAssessmentMode fromString(String name) { + return fromString(name, LinuxPatchAssessmentMode.class); + } + + /** + * Gets known LinuxPatchAssessmentMode values. + * + * @return known LinuxPatchAssessmentMode values. + */ + public static Collection values() { + return values(LinuxPatchAssessmentMode.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxPatchSettings.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxPatchSettings.java new file mode 100644 index 000000000000..d796747e021e --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxPatchSettings.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies settings related to VM Guest Patching on Linux. + */ +@Fluent +public final class LinuxPatchSettings { + /* + * Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

Possible values are:

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

**AutomaticByPlatform** - The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true + */ + @JsonProperty(value = "patchMode") + private LinuxVMGuestPatchMode patchMode; + + /* + * Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.

Possible values are:

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

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. + */ + @JsonProperty(value = "assessmentMode") + private LinuxPatchAssessmentMode assessmentMode; + + /* + * Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux. + */ + @JsonProperty(value = "automaticByPlatformSettings") + private LinuxVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings; + + /** + * Creates an instance of LinuxPatchSettings class. + */ + public LinuxPatchSettings() { + } + + /** + * Get the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **ImageDefault** - The virtual machine's default patching configuration is + * used. <br /><br /> **AutomaticByPlatform** - The virtual machine will be automatically updated by the + * platform. The property provisionVMAgent must be true. + * + * @return the patchMode value. + */ + public LinuxVMGuestPatchMode patchMode() { + return this.patchMode; + } + + /** + * Set the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **ImageDefault** - The virtual machine's default patching configuration is + * used. <br /><br /> **AutomaticByPlatform** - The virtual machine will be automatically updated by the + * platform. The property provisionVMAgent must be true. + * + * @param patchMode the patchMode value to set. + * @return the LinuxPatchSettings object itself. + */ + public LinuxPatchSettings withPatchMode(LinuxVMGuestPatchMode patchMode) { + this.patchMode = patchMode; + return this; + } + + /** + * Get the assessmentMode property: Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine. <br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @return the assessmentMode value. + */ + public LinuxPatchAssessmentMode assessmentMode() { + return this.assessmentMode; + } + + /** + * Set the assessmentMode property: Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine. <br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @param assessmentMode the assessmentMode value to set. + * @return the LinuxPatchSettings object itself. + */ + public LinuxPatchSettings withAssessmentMode(LinuxPatchAssessmentMode assessmentMode) { + this.assessmentMode = assessmentMode; + return this; + } + + /** + * Get the automaticByPlatformSettings property: Specifies additional settings for patch mode AutomaticByPlatform in + * VM Guest Patching on Linux. + * + * @return the automaticByPlatformSettings value. + */ + public LinuxVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings() { + return this.automaticByPlatformSettings; + } + + /** + * Set the automaticByPlatformSettings property: Specifies additional settings for patch mode AutomaticByPlatform in + * VM Guest Patching on Linux. + * + * @param automaticByPlatformSettings the automaticByPlatformSettings value to set. + * @return the LinuxPatchSettings object itself. + */ + public LinuxPatchSettings + withAutomaticByPlatformSettings(LinuxVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings) { + this.automaticByPlatformSettings = automaticByPlatformSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (automaticByPlatformSettings() != null) { + automaticByPlatformSettings().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java new file mode 100644 index 000000000000..57cf63f2bd94 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxVMGuestPatchAutomaticByPlatformRebootSetting.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + */ +public final class LinuxVMGuestPatchAutomaticByPlatformRebootSetting + extends ExpandableStringEnum { + /** + * Static value Unknown for LinuxVMGuestPatchAutomaticByPlatformRebootSetting. + */ + public static final LinuxVMGuestPatchAutomaticByPlatformRebootSetting UNKNOWN = fromString("Unknown"); + + /** + * Static value IfRequired for LinuxVMGuestPatchAutomaticByPlatformRebootSetting. + */ + public static final LinuxVMGuestPatchAutomaticByPlatformRebootSetting IF_REQUIRED = fromString("IfRequired"); + + /** + * Static value Never for LinuxVMGuestPatchAutomaticByPlatformRebootSetting. + */ + public static final LinuxVMGuestPatchAutomaticByPlatformRebootSetting NEVER = fromString("Never"); + + /** + * Static value Always for LinuxVMGuestPatchAutomaticByPlatformRebootSetting. + */ + public static final LinuxVMGuestPatchAutomaticByPlatformRebootSetting ALWAYS = fromString("Always"); + + /** + * Creates a new instance of LinuxVMGuestPatchAutomaticByPlatformRebootSetting value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinuxVMGuestPatchAutomaticByPlatformRebootSetting() { + } + + /** + * Creates or finds a LinuxVMGuestPatchAutomaticByPlatformRebootSetting from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinuxVMGuestPatchAutomaticByPlatformRebootSetting. + */ + @JsonCreator + public static LinuxVMGuestPatchAutomaticByPlatformRebootSetting fromString(String name) { + return fromString(name, LinuxVMGuestPatchAutomaticByPlatformRebootSetting.class); + } + + /** + * Gets known LinuxVMGuestPatchAutomaticByPlatformRebootSetting values. + * + * @return known LinuxVMGuestPatchAutomaticByPlatformRebootSetting values. + */ + public static Collection values() { + return values(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java new file mode 100644 index 000000000000..cddb5f204d8f --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxVMGuestPatchAutomaticByPlatformSettings.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Linux patch settings. + */ +@Fluent +public final class LinuxVMGuestPatchAutomaticByPlatformSettings { + /* + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + */ + @JsonProperty(value = "rebootSetting") + private LinuxVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting; + + /* + * Enables customer to schedule patching without accidental upgrades + */ + @JsonProperty(value = "bypassPlatformSafetyChecksOnUserSchedule") + private Boolean bypassPlatformSafetyChecksOnUserSchedule; + + /** + * Creates an instance of LinuxVMGuestPatchAutomaticByPlatformSettings class. + */ + public LinuxVMGuestPatchAutomaticByPlatformSettings() { + } + + /** + * Get the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * operations. + * + * @return the rebootSetting value. + */ + public LinuxVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting() { + return this.rebootSetting; + } + + /** + * Set the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * operations. + * + * @param rebootSetting the rebootSetting value to set. + * @return the LinuxVMGuestPatchAutomaticByPlatformSettings object itself. + */ + public LinuxVMGuestPatchAutomaticByPlatformSettings + withRebootSetting(LinuxVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting) { + this.rebootSetting = rebootSetting; + return this; + } + + /** + * Get the bypassPlatformSafetyChecksOnUserSchedule property: Enables customer to schedule patching without + * accidental upgrades. + * + * @return the bypassPlatformSafetyChecksOnUserSchedule value. + */ + public Boolean bypassPlatformSafetyChecksOnUserSchedule() { + return this.bypassPlatformSafetyChecksOnUserSchedule; + } + + /** + * Set the bypassPlatformSafetyChecksOnUserSchedule property: Enables customer to schedule patching without + * accidental upgrades. + * + * @param bypassPlatformSafetyChecksOnUserSchedule the bypassPlatformSafetyChecksOnUserSchedule value to set. + * @return the LinuxVMGuestPatchAutomaticByPlatformSettings object itself. + */ + public LinuxVMGuestPatchAutomaticByPlatformSettings + withBypassPlatformSafetyChecksOnUserSchedule(Boolean bypassPlatformSafetyChecksOnUserSchedule) { + this.bypassPlatformSafetyChecksOnUserSchedule = bypassPlatformSafetyChecksOnUserSchedule; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxVMGuestPatchMode.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxVMGuestPatchMode.java new file mode 100644 index 000000000000..307522332b28 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/LinuxVMGuestPatchMode.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.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine + * scale set with OrchestrationMode as Flexible.<br /><br /> Possible values are:<br /><br /> + * **ImageDefault** - The virtual machine's default patching configuration is used. <br /><br /> + * **AutomaticByPlatform** - The virtual machine will be automatically updated by the platform. The property + * provisionVMAgent must be true. + */ +public final class LinuxVMGuestPatchMode extends ExpandableStringEnum { + /** + * Static value ImageDefault for LinuxVMGuestPatchMode. + */ + public static final LinuxVMGuestPatchMode IMAGE_DEFAULT = fromString("ImageDefault"); + + /** + * Static value AutomaticByPlatform for LinuxVMGuestPatchMode. + */ + public static final LinuxVMGuestPatchMode AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates a new instance of LinuxVMGuestPatchMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinuxVMGuestPatchMode() { + } + + /** + * Creates or finds a LinuxVMGuestPatchMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinuxVMGuestPatchMode. + */ + @JsonCreator + public static LinuxVMGuestPatchMode fromString(String name) { + return fromString(name, LinuxVMGuestPatchMode.class); + } + + /** + * Gets known LinuxVMGuestPatchMode values. + * + * @return known LinuxVMGuestPatchMode values. + */ + public static Collection values() { + return values(LinuxVMGuestPatchMode.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ManagedServiceIdentity.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..a25fea34c12c --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ManagedServiceIdentity.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ManagedServiceIdentityType.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..f09def356f20 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ManagedServiceIdentityType.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED_1 + = fromString("SystemAssigned, UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ManagedServiceIdentityUpdate.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ManagedServiceIdentityUpdate.java new file mode 100644 index 000000000000..8d68c2d5f25f --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ManagedServiceIdentityUpdate.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The template for adding optional properties. + */ +@Fluent +public final class ManagedServiceIdentityUpdate { + /* + * The type of managed identity assigned to this resource. + */ + @JsonProperty(value = "type") + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentityUpdate class. + */ + public ManagedServiceIdentityUpdate() { + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the ManagedServiceIdentityUpdate object itself. + */ + public ManagedServiceIdentityUpdate withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentityUpdate object itself. + */ + public ManagedServiceIdentityUpdate + withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Mode.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Mode.java new file mode 100644 index 000000000000..c3836a574031 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Mode.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent will start to audit or + * monitor but not enforce access control over requests to host endpoints in Audit mode, while in Enforce mode it will + * enforce access control. The default value is Enforce mode. + */ +public final class Mode extends ExpandableStringEnum { + /** + * Static value Audit for Mode. + */ + public static final Mode AUDIT = fromString("Audit"); + + /** + * Static value Enforce for Mode. + */ + public static final Mode ENFORCE = fromString("Enforce"); + + /** + * Creates a new instance of Mode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Mode() { + } + + /** + * Creates or finds a Mode from its string representation. + * + * @param name a name to look for. + * @return the corresponding Mode. + */ + @JsonCreator + public static Mode fromString(String name) { + return fromString(name, Mode.class); + } + + /** + * Gets known Mode values. + * + * @return known Mode values. + */ + public static Collection values() { + return values(Mode.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/NetworkApiVersion.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/NetworkApiVersion.java new file mode 100644 index 000000000000..b7f37f1a4e39 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/NetworkApiVersion.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * specifies the Microsoft.Network API version used when creating networking resources in the Network Interface + * Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible'. + */ +public final class NetworkApiVersion extends ExpandableStringEnum { + /** + * Static value 2020-11-01 for NetworkApiVersion. + */ + public static final NetworkApiVersion TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE = fromString("2020-11-01"); + + /** + * Creates a new instance of NetworkApiVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkApiVersion() { + } + + /** + * Creates or finds a NetworkApiVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkApiVersion. + */ + @JsonCreator + public static NetworkApiVersion fromString(String name) { + return fromString(name, NetworkApiVersion.class); + } + + /** + * Gets known NetworkApiVersion values. + * + * @return known NetworkApiVersion values. + */ + public static Collection values() { + return values(NetworkApiVersion.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/NetworkInterfaceAuxiliaryMode.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/NetworkInterfaceAuxiliaryMode.java new file mode 100644 index 000000000000..79a131ba060d --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/NetworkInterfaceAuxiliaryMode.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies whether the Auxiliary mode is enabled for the Network Interface resource. + */ +public final class NetworkInterfaceAuxiliaryMode extends ExpandableStringEnum { + /** + * Static value None for NetworkInterfaceAuxiliaryMode. + */ + public static final NetworkInterfaceAuxiliaryMode NONE = fromString("None"); + + /** + * Static value AcceleratedConnections for NetworkInterfaceAuxiliaryMode. + */ + public static final NetworkInterfaceAuxiliaryMode ACCELERATED_CONNECTIONS = fromString("AcceleratedConnections"); + + /** + * Static value Floating for NetworkInterfaceAuxiliaryMode. + */ + public static final NetworkInterfaceAuxiliaryMode FLOATING = fromString("Floating"); + + /** + * Creates a new instance of NetworkInterfaceAuxiliaryMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkInterfaceAuxiliaryMode() { + } + + /** + * Creates or finds a NetworkInterfaceAuxiliaryMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceAuxiliaryMode. + */ + @JsonCreator + public static NetworkInterfaceAuxiliaryMode fromString(String name) { + return fromString(name, NetworkInterfaceAuxiliaryMode.class); + } + + /** + * Gets known NetworkInterfaceAuxiliaryMode values. + * + * @return known NetworkInterfaceAuxiliaryMode values. + */ + public static Collection values() { + return values(NetworkInterfaceAuxiliaryMode.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/NetworkInterfaceAuxiliarySku.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/NetworkInterfaceAuxiliarySku.java new file mode 100644 index 000000000000..d6e369f32d74 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/NetworkInterfaceAuxiliarySku.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies whether the Auxiliary sku is enabled for the Network Interface resource. + */ +public final class NetworkInterfaceAuxiliarySku extends ExpandableStringEnum { + /** + * Static value None for NetworkInterfaceAuxiliarySku. + */ + public static final NetworkInterfaceAuxiliarySku NONE = fromString("None"); + + /** + * Static value A1 for NetworkInterfaceAuxiliarySku. + */ + public static final NetworkInterfaceAuxiliarySku A1 = fromString("A1"); + + /** + * Static value A2 for NetworkInterfaceAuxiliarySku. + */ + public static final NetworkInterfaceAuxiliarySku A2 = fromString("A2"); + + /** + * Static value A4 for NetworkInterfaceAuxiliarySku. + */ + public static final NetworkInterfaceAuxiliarySku A4 = fromString("A4"); + + /** + * Static value A8 for NetworkInterfaceAuxiliarySku. + */ + public static final NetworkInterfaceAuxiliarySku A8 = fromString("A8"); + + /** + * Creates a new instance of NetworkInterfaceAuxiliarySku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkInterfaceAuxiliarySku() { + } + + /** + * Creates or finds a NetworkInterfaceAuxiliarySku from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceAuxiliarySku. + */ + @JsonCreator + public static NetworkInterfaceAuxiliarySku fromString(String name) { + return fromString(name, NetworkInterfaceAuxiliarySku.class); + } + + /** + * Gets known NetworkInterfaceAuxiliarySku values. + * + * @return known NetworkInterfaceAuxiliarySku values. + */ + public static Collection values() { + return values(NetworkInterfaceAuxiliarySku.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OSImageNotificationProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OSImageNotificationProfile.java new file mode 100644 index 000000000000..be57352efd18 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OSImageNotificationProfile.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OSImageNotificationProfile model. + */ +@Fluent +public final class OSImageNotificationProfile { + /* + * Length of time a Virtual Machine being reimaged or having its OS upgraded will have to potentially approve the OS Image Scheduled Event before the event is auto approved (timed out). The configuration is specified in ISO 8601 format, and the value must be 15 minutes (PT15M) + */ + @JsonProperty(value = "notBeforeTimeout") + private String notBeforeTimeout; + + /* + * Specifies whether the OS Image Scheduled event is enabled or disabled. + */ + @JsonProperty(value = "enable") + private Boolean enable; + + /** + * Creates an instance of OSImageNotificationProfile class. + */ + public OSImageNotificationProfile() { + } + + /** + * Get the notBeforeTimeout property: Length of time a Virtual Machine being reimaged or having its OS upgraded will + * have to potentially approve the OS Image Scheduled Event before the event is auto approved (timed out). The + * configuration is specified in ISO 8601 format, and the value must be 15 minutes (PT15M). + * + * @return the notBeforeTimeout value. + */ + public String notBeforeTimeout() { + return this.notBeforeTimeout; + } + + /** + * Set the notBeforeTimeout property: Length of time a Virtual Machine being reimaged or having its OS upgraded will + * have to potentially approve the OS Image Scheduled Event before the event is auto approved (timed out). The + * configuration is specified in ISO 8601 format, and the value must be 15 minutes (PT15M). + * + * @param notBeforeTimeout the notBeforeTimeout value to set. + * @return the OSImageNotificationProfile object itself. + */ + public OSImageNotificationProfile withNotBeforeTimeout(String notBeforeTimeout) { + this.notBeforeTimeout = notBeforeTimeout; + return this; + } + + /** + * Get the enable property: Specifies whether the OS Image Scheduled event is enabled or disabled. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: Specifies whether the OS Image Scheduled event is enabled or disabled. + * + * @param enable the enable value to set. + * @return the OSImageNotificationProfile object itself. + */ + public OSImageNotificationProfile withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OperatingSystemTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OperatingSystemTypes.java new file mode 100644 index 000000000000..c3d464773387 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OperatingSystemTypes.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image + * or a specialized VHD. Possible values are: **Windows,** **Linux.**. + */ +public enum OperatingSystemTypes { + /** + * Enum value Windows. + */ + WINDOWS("Windows"), + + /** + * Enum value Linux. + */ + LINUX("Linux"); + + /** + * The actual serialized value for a OperatingSystemTypes instance. + */ + private final String value; + + OperatingSystemTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OperatingSystemTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed OperatingSystemTypes object, or null if unable to parse. + */ + @JsonCreator + public static OperatingSystemTypes fromString(String value) { + if (value == null) { + return null; + } + OperatingSystemTypes[] items = OperatingSystemTypes.values(); + for (OperatingSystemTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Operation.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Operation.java new file mode 100644 index 000000000000..88598bdc29d6 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.resourcemanager.azurefleet.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.azurefleet.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OperationDisplay.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OperationDisplay.java new file mode 100644 index 000000000000..0e5808e7ebdf --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OperationDisplay.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Localized display information for this particular operation. + */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OperationListResult.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OperationListResult.java new file mode 100644 index 000000000000..65fe6b7ff94f --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/OperationListResult.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurefleet.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Operations.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Operations.java new file mode 100644 index 000000000000..213f1a2eac63 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the provider. + * + * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @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 list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Origin.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Origin.java new file mode 100644 index 000000000000..6d52da824ebf --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Origin.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Static value user for Origin. + */ + public static final Origin USER = fromString("user"); + + /** + * Static value system for Origin. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Static value user,system for Origin. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PassNames.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PassNames.java new file mode 100644 index 000000000000..f8222becbdc3 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PassNames.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The pass name. Currently, the only allowable value is OobeSystem. + */ +public enum PassNames { + /** + * Enum value OobeSystem. + */ + OOBE_SYSTEM("OobeSystem"); + + /** + * The actual serialized value for a PassNames instance. + */ + private final String value; + + PassNames(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PassNames instance. + * + * @param value the serialized value to parse. + * @return the parsed PassNames object, or null if unable to parse. + */ + @JsonCreator + public static PassNames fromString(String value) { + if (value == null) { + return null; + } + PassNames[] items = PassNames.values(); + for (PassNames item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PatchSettings.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PatchSettings.java new file mode 100644 index 000000000000..ac8d913a50a8 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PatchSettings.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies settings related to VM Guest Patching on Windows. + */ +@Fluent +public final class PatchSettings { + /* + * Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

Possible values are:

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

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

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

Possible values are:

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

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. + */ + @JsonProperty(value = "assessmentMode") + private WindowsPatchAssessmentMode assessmentMode; + + /* + * Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows. + */ + @JsonProperty(value = "automaticByPlatformSettings") + private WindowsVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings; + + /** + * Creates an instance of PatchSettings class. + */ + public PatchSettings() { + } + + /** + * Get the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **Manual** - You control the application of patches to a virtual machine. You + * do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property + * WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> **AutomaticByOS** - The virtual + * machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be + * true. <br /><br /> **AutomaticByPlatform** - the virtual machine will automatically updated by the + * platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. + * + * @return the patchMode value. + */ + public WindowsVMGuestPatchMode patchMode() { + return this.patchMode; + } + + /** + * Set the patchMode property: Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines + * associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible + * values are:<br /><br /> **Manual** - You control the application of patches to a virtual machine. You + * do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property + * WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> **AutomaticByOS** - The virtual + * machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be + * true. <br /><br /> **AutomaticByPlatform** - the virtual machine will automatically updated by the + * platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. + * + * @param patchMode the patchMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withPatchMode(WindowsVMGuestPatchMode patchMode) { + this.patchMode = patchMode; + return this; + } + + /** + * Get the enableHotpatching property: Enables customers to patch their Azure VMs without requiring a reboot. For + * enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to + * 'AutomaticByPlatform'. + * + * @return the enableHotpatching value. + */ + public Boolean enableHotpatching() { + return this.enableHotpatching; + } + + /** + * Set the enableHotpatching property: Enables customers to patch their Azure VMs without requiring a reboot. For + * enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to + * 'AutomaticByPlatform'. + * + * @param enableHotpatching the enableHotpatching value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withEnableHotpatching(Boolean enableHotpatching) { + this.enableHotpatching = enableHotpatching; + return this; + } + + /** + * Get the assessmentMode property: Specifies the mode of VM Guest patch assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine.<br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @return the assessmentMode value. + */ + public WindowsPatchAssessmentMode assessmentMode() { + return this.assessmentMode; + } + + /** + * Set the assessmentMode property: Specifies the mode of VM Guest patch assessment for the IaaS virtual + * machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the + * timing of patch assessments on a virtual machine.<br /><br /> **AutomaticByPlatform** - The platform + * will trigger periodic patch assessments. The property provisionVMAgent must be true. + * + * @param assessmentMode the assessmentMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withAssessmentMode(WindowsPatchAssessmentMode assessmentMode) { + this.assessmentMode = assessmentMode; + return this; + } + + /** + * Get the automaticByPlatformSettings property: Specifies additional settings for patch mode AutomaticByPlatform in + * VM Guest Patching on Windows. + * + * @return the automaticByPlatformSettings value. + */ + public WindowsVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings() { + return this.automaticByPlatformSettings; + } + + /** + * Set the automaticByPlatformSettings property: Specifies additional settings for patch mode AutomaticByPlatform in + * VM Guest Patching on Windows. + * + * @param automaticByPlatformSettings the automaticByPlatformSettings value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings + withAutomaticByPlatformSettings(WindowsVMGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings) { + this.automaticByPlatformSettings = automaticByPlatformSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (automaticByPlatformSettings() != null) { + automaticByPlatformSettings().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Plan.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Plan.java new file mode 100644 index 000000000000..83e6530259a6 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/Plan.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Plan for the resource. + */ +@Fluent +public final class Plan { + /* + * A user defined name of the 3rd Party Artifact that is being procured. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + */ + @JsonProperty(value = "product", required = true) + private String product; + + /* + * A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /* + * The version of the desired product/artifact. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Creates an instance of Plan class. + */ + public Plan() { + } + + /** + * Get the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @param name the name value to set. + * @return the Plan object itself. + */ + public Plan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @param publisher the publisher value to set. + * @return the Plan object itself. + */ + public Plan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @param product the product value to set. + * @return the Plan object itself. + */ + public Plan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @param promotionCode the promotionCode value to set. + * @return the Plan object itself. + */ + public Plan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version property: The version of the desired product/artifact. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the desired product/artifact. + * + * @param version the version value to set. + * @return the Plan object itself. + */ + public Plan withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Plan")); + } + if (publisher() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property publisher in model Plan")); + } + if (product() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property product in model Plan")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Plan.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ProtocolTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ProtocolTypes.java new file mode 100644 index 000000000000..5e30c9c9335a --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ProtocolTypes.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Specifies the protocol of WinRM listener. Possible values are: **http,** **https.**. + */ +public enum ProtocolTypes { + /** + * Enum value Http. + */ + HTTP("Http"), + + /** + * Enum value Https. + */ + HTTPS("Https"); + + /** + * The actual serialized value for a ProtocolTypes instance. + */ + private final String value; + + ProtocolTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProtocolTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed ProtocolTypes object, or null if unable to parse. + */ + @JsonCreator + public static ProtocolTypes fromString(String value) { + if (value == null) { + return null; + } + ProtocolTypes[] items = ProtocolTypes.values(); + for (ProtocolTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ProvisioningState.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ProvisioningState.java new file mode 100644 index 000000000000..ff34efb307c1 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ProvisioningState.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.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The status of the current operation. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Creating for ProvisioningState. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for ProvisioningState. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ProvisioningState. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Migrating for ProvisioningState. + */ + public static final ProvisioningState MIGRATING = fromString("Migrating"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ProxyAgentSettings.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ProxyAgentSettings.java new file mode 100644 index 000000000000..ec0eaba66ce1 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ProxyAgentSettings.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2023-09-01. + */ +@Fluent +public final class ProxyAgentSettings { + /* + * Specifies whether ProxyAgent feature should be enabled on the virtual machine or virtual machine scale set. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent will start to audit or monitor but not enforce access control over requests to host endpoints in Audit mode, while in Enforce mode it will enforce access control. The default value is Enforce mode. + */ + @JsonProperty(value = "mode") + private Mode mode; + + /* + * Increase the value of this property allows user to reset the key used for securing communication channel between guest and host. + */ + @JsonProperty(value = "keyIncarnationId") + private Integer keyIncarnationId; + + /** + * Creates an instance of ProxyAgentSettings class. + */ + public ProxyAgentSettings() { + } + + /** + * Get the enabled property: Specifies whether ProxyAgent feature should be enabled on the virtual machine or + * virtual machine scale set. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether ProxyAgent feature should be enabled on the virtual machine or + * virtual machine scale set. + * + * @param enabled the enabled value to set. + * @return the ProxyAgentSettings object itself. + */ + public ProxyAgentSettings withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the mode property: Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent + * will start to audit or monitor but not enforce access control over requests to host endpoints in Audit mode, + * while in Enforce mode it will enforce access control. The default value is Enforce mode. + * + * @return the mode value. + */ + public Mode mode() { + return this.mode; + } + + /** + * Set the mode property: Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent + * will start to audit or monitor but not enforce access control over requests to host endpoints in Audit mode, + * while in Enforce mode it will enforce access control. The default value is Enforce mode. + * + * @param mode the mode value to set. + * @return the ProxyAgentSettings object itself. + */ + public ProxyAgentSettings withMode(Mode mode) { + this.mode = mode; + return this; + } + + /** + * Get the keyIncarnationId property: Increase the value of this property allows user to reset the key used for + * securing communication channel between guest and host. + * + * @return the keyIncarnationId value. + */ + public Integer keyIncarnationId() { + return this.keyIncarnationId; + } + + /** + * Set the keyIncarnationId property: Increase the value of this property allows user to reset the key used for + * securing communication channel between guest and host. + * + * @param keyIncarnationId the keyIncarnationId value to set. + * @return the ProxyAgentSettings object itself. + */ + public ProxyAgentSettings withKeyIncarnationId(Integer keyIncarnationId) { + this.keyIncarnationId = keyIncarnationId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PublicIpAddressSku.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PublicIpAddressSku.java new file mode 100644 index 000000000000..b40e9e35bd7d --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PublicIpAddressSku.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + */ +@Fluent +public final class PublicIpAddressSku { + /* + * Specify public IP sku name + */ + @JsonProperty(value = "name") + private PublicIpAddressSkuName name; + + /* + * Specify public IP sku tier + */ + @JsonProperty(value = "tier") + private PublicIpAddressSkuTier tier; + + /** + * Creates an instance of PublicIpAddressSku class. + */ + public PublicIpAddressSku() { + } + + /** + * Get the name property: Specify public IP sku name. + * + * @return the name value. + */ + public PublicIpAddressSkuName name() { + return this.name; + } + + /** + * Set the name property: Specify public IP sku name. + * + * @param name the name value to set. + * @return the PublicIpAddressSku object itself. + */ + public PublicIpAddressSku withName(PublicIpAddressSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Specify public IP sku tier. + * + * @return the tier value. + */ + public PublicIpAddressSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Specify public IP sku tier. + * + * @param tier the tier value to set. + * @return the PublicIpAddressSku object itself. + */ + public PublicIpAddressSku withTier(PublicIpAddressSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PublicIpAddressSkuName.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PublicIpAddressSkuName.java new file mode 100644 index 000000000000..ab8c324c2188 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PublicIpAddressSkuName.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specify public IP sku name. + */ +public final class PublicIpAddressSkuName extends ExpandableStringEnum { + /** + * Static value Basic for PublicIpAddressSkuName. + */ + public static final PublicIpAddressSkuName BASIC = fromString("Basic"); + + /** + * Static value Standard for PublicIpAddressSkuName. + */ + public static final PublicIpAddressSkuName STANDARD = fromString("Standard"); + + /** + * Creates a new instance of PublicIpAddressSkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicIpAddressSkuName() { + } + + /** + * Creates or finds a PublicIpAddressSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuName. + */ + @JsonCreator + public static PublicIpAddressSkuName fromString(String name) { + return fromString(name, PublicIpAddressSkuName.class); + } + + /** + * Gets known PublicIpAddressSkuName values. + * + * @return known PublicIpAddressSkuName values. + */ + public static Collection values() { + return values(PublicIpAddressSkuName.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PublicIpAddressSkuTier.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PublicIpAddressSkuTier.java new file mode 100644 index 000000000000..f08b7708ee8f --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/PublicIpAddressSkuTier.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specify public IP sku tier. + */ +public final class PublicIpAddressSkuTier extends ExpandableStringEnum { + /** + * Static value Regional for PublicIpAddressSkuTier. + */ + public static final PublicIpAddressSkuTier REGIONAL = fromString("Regional"); + + /** + * Static value Global for PublicIpAddressSkuTier. + */ + public static final PublicIpAddressSkuTier GLOBAL = fromString("Global"); + + /** + * Creates a new instance of PublicIpAddressSkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicIpAddressSkuTier() { + } + + /** + * Creates or finds a PublicIpAddressSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuTier. + */ + @JsonCreator + public static PublicIpAddressSkuTier fromString(String name) { + return fromString(name, PublicIpAddressSkuTier.class); + } + + /** + * Gets known PublicIpAddressSkuTier values. + * + * @return known PublicIpAddressSkuTier values. + */ + public static Collection values() { + return values(PublicIpAddressSkuTier.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/RegularPriorityAllocationStrategy.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/RegularPriorityAllocationStrategy.java new file mode 100644 index 000000000000..e4ee355209b1 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/RegularPriorityAllocationStrategy.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Regular VM Allocation strategy types for Compute Fleet. + */ +public final class RegularPriorityAllocationStrategy extends ExpandableStringEnum { + /** + * Static value LowestPrice for RegularPriorityAllocationStrategy. + */ + public static final RegularPriorityAllocationStrategy LOWEST_PRICE = fromString("LowestPrice"); + + /** + * Static value Prioritized for RegularPriorityAllocationStrategy. + */ + public static final RegularPriorityAllocationStrategy PRIORITIZED = fromString("Prioritized"); + + /** + * Creates a new instance of RegularPriorityAllocationStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RegularPriorityAllocationStrategy() { + } + + /** + * Creates or finds a RegularPriorityAllocationStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding RegularPriorityAllocationStrategy. + */ + @JsonCreator + public static RegularPriorityAllocationStrategy fromString(String name) { + return fromString(name, RegularPriorityAllocationStrategy.class); + } + + /** + * Gets known RegularPriorityAllocationStrategy values. + * + * @return known RegularPriorityAllocationStrategy values. + */ + public static Collection values() { + return values(RegularPriorityAllocationStrategy.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/RegularPriorityProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/RegularPriorityProfile.java new file mode 100644 index 000000000000..c8f796a73102 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/RegularPriorityProfile.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configuration Options for Regular instances in Compute Fleet. + */ +@Fluent +public final class RegularPriorityProfile { + /* + * Total capacity to achieve. It is currently in terms of number of VMs. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /* + * Minimum capacity to achieve which cannot be updated. If we will not be able to "guarantee" minimum capacity, we will reject the request in the sync path itself. + */ + @JsonProperty(value = "minCapacity") + private Integer minCapacity; + + /* + * Allocation strategy to follow when determining the VM sizes distribution for Regular VMs. + */ + @JsonProperty(value = "allocationStrategy") + private RegularPriorityAllocationStrategy allocationStrategy; + + /** + * Creates an instance of RegularPriorityProfile class. + */ + public RegularPriorityProfile() { + } + + /** + * Get the capacity property: Total capacity to achieve. It is currently in terms of number of VMs. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Total capacity to achieve. It is currently in terms of number of VMs. + * + * @param capacity the capacity value to set. + * @return the RegularPriorityProfile object itself. + */ + public RegularPriorityProfile withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the minCapacity property: Minimum capacity to achieve which cannot be updated. If we will not be able to + * "guarantee" minimum capacity, we will reject the request in the sync path itself. + * + * @return the minCapacity value. + */ + public Integer minCapacity() { + return this.minCapacity; + } + + /** + * Set the minCapacity property: Minimum capacity to achieve which cannot be updated. If we will not be able to + * "guarantee" minimum capacity, we will reject the request in the sync path itself. + * + * @param minCapacity the minCapacity value to set. + * @return the RegularPriorityProfile object itself. + */ + public RegularPriorityProfile withMinCapacity(Integer minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * Get the allocationStrategy property: Allocation strategy to follow when determining the VM sizes distribution for + * Regular VMs. + * + * @return the allocationStrategy value. + */ + public RegularPriorityAllocationStrategy allocationStrategy() { + return this.allocationStrategy; + } + + /** + * Set the allocationStrategy property: Allocation strategy to follow when determining the VM sizes distribution for + * Regular VMs. + * + * @param allocationStrategy the allocationStrategy value to set. + * @return the RegularPriorityProfile object itself. + */ + public RegularPriorityProfile withAllocationStrategy(RegularPriorityAllocationStrategy allocationStrategy) { + this.allocationStrategy = allocationStrategy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ResourcePlanUpdate.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ResourcePlanUpdate.java new file mode 100644 index 000000000000..fcf8f8864235 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ResourcePlanUpdate.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The template for adding optional properties. + */ +@Fluent +public final class ResourcePlanUpdate { + /* + * A user defined name of the 3rd Party Artifact that is being procured. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + */ + @JsonProperty(value = "product") + private String product; + + /* + * A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /* + * The version of the desired product/artifact. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Creates an instance of ResourcePlanUpdate class. + */ + public ResourcePlanUpdate() { + } + + /** + * Get the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @param name the name value to set. + * @return the ResourcePlanUpdate object itself. + */ + public ResourcePlanUpdate withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @param publisher the publisher value to set. + * @return the ResourcePlanUpdate object itself. + */ + public ResourcePlanUpdate withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @param product the product value to set. + * @return the ResourcePlanUpdate object itself. + */ + public ResourcePlanUpdate withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @param promotionCode the promotionCode value to set. + * @return the ResourcePlanUpdate object itself. + */ + public ResourcePlanUpdate withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version property: The version of the desired product/artifact. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the desired product/artifact. + * + * @param version the version value to set. + * @return the ResourcePlanUpdate object itself. + */ + public ResourcePlanUpdate withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ResourceWithOptionalLocation.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ResourceWithOptionalLocation.java new file mode 100644 index 000000000000..0bc3657ca674 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ResourceWithOptionalLocation.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import java.util.Map; + +/** + * The Resource model definition with location property as optional. + */ +@Fluent +public class ResourceWithOptionalLocation extends Resource { + /** + * Creates an instance of ResourceWithOptionalLocation class. + */ + public ResourceWithOptionalLocation() { + } + + /** + * {@inheritDoc} + */ + @Override + public ResourceWithOptionalLocation withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ResourceWithOptionalLocation withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ScheduledEventsProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ScheduledEventsProfile.java new file mode 100644 index 000000000000..2c5f005c2159 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ScheduledEventsProfile.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ScheduledEventsProfile model. + */ +@Fluent +public final class ScheduledEventsProfile { + /* + * Specifies Terminate Scheduled Event related configurations. + */ + @JsonProperty(value = "terminateNotificationProfile") + private TerminateNotificationProfile terminateNotificationProfile; + + /* + * Specifies OS Image Scheduled Event related configurations. + */ + @JsonProperty(value = "osImageNotificationProfile") + private OSImageNotificationProfile osImageNotificationProfile; + + /** + * Creates an instance of ScheduledEventsProfile class. + */ + public ScheduledEventsProfile() { + } + + /** + * Get the terminateNotificationProfile property: Specifies Terminate Scheduled Event related configurations. + * + * @return the terminateNotificationProfile value. + */ + public TerminateNotificationProfile terminateNotificationProfile() { + return this.terminateNotificationProfile; + } + + /** + * Set the terminateNotificationProfile property: Specifies Terminate Scheduled Event related configurations. + * + * @param terminateNotificationProfile the terminateNotificationProfile value to set. + * @return the ScheduledEventsProfile object itself. + */ + public ScheduledEventsProfile + withTerminateNotificationProfile(TerminateNotificationProfile terminateNotificationProfile) { + this.terminateNotificationProfile = terminateNotificationProfile; + return this; + } + + /** + * Get the osImageNotificationProfile property: Specifies OS Image Scheduled Event related configurations. + * + * @return the osImageNotificationProfile value. + */ + public OSImageNotificationProfile osImageNotificationProfile() { + return this.osImageNotificationProfile; + } + + /** + * Set the osImageNotificationProfile property: Specifies OS Image Scheduled Event related configurations. + * + * @param osImageNotificationProfile the osImageNotificationProfile value to set. + * @return the ScheduledEventsProfile object itself. + */ + public ScheduledEventsProfile + withOsImageNotificationProfile(OSImageNotificationProfile osImageNotificationProfile) { + this.osImageNotificationProfile = osImageNotificationProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (terminateNotificationProfile() != null) { + terminateNotificationProfile().validate(); + } + if (osImageNotificationProfile() != null) { + osImageNotificationProfile().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityEncryptionTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityEncryptionTypes.java new file mode 100644 index 000000000000..cb9479cb5428 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityEncryptionTypes.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed + * disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM + * for not persisting firmware state in the VMGuestState blob.. **Note:** It can be set for only Confidential VMs. + */ +public final class SecurityEncryptionTypes extends ExpandableStringEnum { + /** + * Static value VMGuestStateOnly for SecurityEncryptionTypes. + */ + public static final SecurityEncryptionTypes VMGUEST_STATE_ONLY = fromString("VMGuestStateOnly"); + + /** + * Static value DiskWithVMGuestState for SecurityEncryptionTypes. + */ + public static final SecurityEncryptionTypes DISK_WITH_VMGUEST_STATE = fromString("DiskWithVMGuestState"); + + /** + * Static value NonPersistedTPM for SecurityEncryptionTypes. + */ + public static final SecurityEncryptionTypes NON_PERSISTED_TPM = fromString("NonPersistedTPM"); + + /** + * Creates a new instance of SecurityEncryptionTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityEncryptionTypes() { + } + + /** + * Creates or finds a SecurityEncryptionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityEncryptionTypes. + */ + @JsonCreator + public static SecurityEncryptionTypes fromString(String name) { + return fromString(name, SecurityEncryptionTypes.class); + } + + /** + * Gets known SecurityEncryptionTypes values. + * + * @return known SecurityEncryptionTypes values. + */ + public static Collection values() { + return values(SecurityEncryptionTypes.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityPostureReference.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityPostureReference.java new file mode 100644 index 000000000000..706bbd4276a4 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityPostureReference.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01. + */ +@Fluent +public final class SecurityPostureReference { + /* + * The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest + */ + @JsonProperty(value = "id") + private String id; + + /* + * List of virtual machine extensions to exclude when applying the Security Posture. + */ + @JsonProperty(value = "excludeExtensions") + private List excludeExtensions; + + /** + * Creates an instance of SecurityPostureReference class. + */ + public SecurityPostureReference() { + } + + /** + * Get the id property: The security posture reference id in the form of + * /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The security posture reference id in the form of + * /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. + * + * @param id the id value to set. + * @return the SecurityPostureReference object itself. + */ + public SecurityPostureReference withId(String id) { + this.id = id; + return this; + } + + /** + * Get the excludeExtensions property: List of virtual machine extensions to exclude when applying the Security + * Posture. + * + * @return the excludeExtensions value. + */ + public List excludeExtensions() { + return this.excludeExtensions; + } + + /** + * Set the excludeExtensions property: List of virtual machine extensions to exclude when applying the Security + * Posture. + * + * @param excludeExtensions the excludeExtensions value to set. + * @return the SecurityPostureReference object itself. + */ + public SecurityPostureReference withExcludeExtensions(List excludeExtensions) { + this.excludeExtensions = excludeExtensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (excludeExtensions() != null) { + excludeExtensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityProfile.java new file mode 100644 index 000000000000..71eefb5e70a0 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityProfile.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the Security profile settings for the virtual machine or virtual machine scale set. + */ +@Fluent +public final class SecurityProfile { + /* + * Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum api-version: 2020-12-01. + */ + @JsonProperty(value = "uefiSettings") + private UefiSettings uefiSettings; + + /* + * This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. The default behavior is: The Encryption at host will be disabled unless this property is set to true for the resource. + */ + @JsonProperty(value = "encryptionAtHost") + private Boolean encryptionAtHost; + + /* + * Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this property is set. + */ + @JsonProperty(value = "securityType") + private SecurityTypes securityType; + + /* + * Specifies the Managed Identity used by ADE to get access token for keyvault operations. + */ + @JsonProperty(value = "encryptionIdentity") + private EncryptionIdentity encryptionIdentity; + + /* + * Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2023-09-01. + */ + @JsonProperty(value = "proxyAgentSettings") + private ProxyAgentSettings proxyAgentSettings; + + /** + * Creates an instance of SecurityProfile class. + */ + public SecurityProfile() { + } + + /** + * Get the uefiSettings property: Specifies the security settings like secure boot and vTPM used while creating the + * virtual machine. Minimum api-version: 2020-12-01. + * + * @return the uefiSettings value. + */ + public UefiSettings uefiSettings() { + return this.uefiSettings; + } + + /** + * Set the uefiSettings property: Specifies the security settings like secure boot and vTPM used while creating the + * virtual machine. Minimum api-version: 2020-12-01. + * + * @param uefiSettings the uefiSettings value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withUefiSettings(UefiSettings uefiSettings) { + this.uefiSettings = uefiSettings; + return this; + } + + /** + * Get the encryptionAtHost property: This property can be used by user in the request to enable or disable the Host + * Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the + * disks including Resource/Temp disk at host itself. The default behavior is: The Encryption at host will be + * disabled unless this property is set to true for the resource. + * + * @return the encryptionAtHost value. + */ + public Boolean encryptionAtHost() { + return this.encryptionAtHost; + } + + /** + * Set the encryptionAtHost property: This property can be used by user in the request to enable or disable the Host + * Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the + * disks including Resource/Temp disk at host itself. The default behavior is: The Encryption at host will be + * disabled unless this property is set to true for the resource. + * + * @param encryptionAtHost the encryptionAtHost value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withEncryptionAtHost(Boolean encryptionAtHost) { + this.encryptionAtHost = encryptionAtHost; + return this; + } + + /** + * Get the securityType property: Specifies the SecurityType of the virtual machine. It has to be set to any + * specified value to enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this + * property is set. + * + * @return the securityType value. + */ + public SecurityTypes securityType() { + return this.securityType; + } + + /** + * Set the securityType property: Specifies the SecurityType of the virtual machine. It has to be set to any + * specified value to enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this + * property is set. + * + * @param securityType the securityType value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withSecurityType(SecurityTypes securityType) { + this.securityType = securityType; + return this; + } + + /** + * Get the encryptionIdentity property: Specifies the Managed Identity used by ADE to get access token for keyvault + * operations. + * + * @return the encryptionIdentity value. + */ + public EncryptionIdentity encryptionIdentity() { + return this.encryptionIdentity; + } + + /** + * Set the encryptionIdentity property: Specifies the Managed Identity used by ADE to get access token for keyvault + * operations. + * + * @param encryptionIdentity the encryptionIdentity value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withEncryptionIdentity(EncryptionIdentity encryptionIdentity) { + this.encryptionIdentity = encryptionIdentity; + return this; + } + + /** + * Get the proxyAgentSettings property: Specifies ProxyAgent settings while creating the virtual machine. Minimum + * api-version: 2023-09-01. + * + * @return the proxyAgentSettings value. + */ + public ProxyAgentSettings proxyAgentSettings() { + return this.proxyAgentSettings; + } + + /** + * Set the proxyAgentSettings property: Specifies ProxyAgent settings while creating the virtual machine. Minimum + * api-version: 2023-09-01. + * + * @param proxyAgentSettings the proxyAgentSettings value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withProxyAgentSettings(ProxyAgentSettings proxyAgentSettings) { + this.proxyAgentSettings = proxyAgentSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (uefiSettings() != null) { + uefiSettings().validate(); + } + if (encryptionIdentity() != null) { + encryptionIdentity().validate(); + } + if (proxyAgentSettings() != null) { + proxyAgentSettings().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityTypes.java new file mode 100644 index 000000000000..71635309ab73 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SecurityTypes.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. + * The default behavior is: UefiSettings will not be enabled unless this property is set. + */ +public final class SecurityTypes extends ExpandableStringEnum { + /** + * Static value TrustedLaunch for SecurityTypes. + */ + public static final SecurityTypes TRUSTED_LAUNCH = fromString("TrustedLaunch"); + + /** + * Static value ConfidentialVM for SecurityTypes. + */ + public static final SecurityTypes CONFIDENTIAL_VM = fromString("ConfidentialVM"); + + /** + * Creates a new instance of SecurityTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityTypes() { + } + + /** + * Creates or finds a SecurityTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityTypes. + */ + @JsonCreator + public static SecurityTypes fromString(String name) { + return fromString(name, SecurityTypes.class); + } + + /** + * Gets known SecurityTypes values. + * + * @return known SecurityTypes values. + */ + public static Collection values() { + return values(SecurityTypes.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ServiceArtifactReference.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ServiceArtifactReference.java new file mode 100644 index 000000000000..cb4ee5e95041 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/ServiceArtifactReference.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.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set + * when using 'latest' image version. Minimum api-version: 2022-11-01. + */ +@Fluent +public final class ServiceArtifactReference { + /* + * The service artifact reference id in the form of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} + */ + @JsonProperty(value = "id") + private String id; + + /** + * Creates an instance of ServiceArtifactReference class. + */ + public ServiceArtifactReference() { + } + + /** + * Get the id property: The service artifact reference id in the form of + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The service artifact reference id in the form of + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. + * + * @param id the id value to set. + * @return the ServiceArtifactReference object itself. + */ + public ServiceArtifactReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SettingNames.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SettingNames.java new file mode 100644 index 000000000000..882b48f31a9b --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SettingNames.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and + * AutoLogon. + */ +public enum SettingNames { + /** + * Enum value AutoLogon. + */ + AUTO_LOGON("AutoLogon"), + + /** + * Enum value FirstLogonCommands. + */ + FIRST_LOGON_COMMANDS("FirstLogonCommands"); + + /** + * The actual serialized value for a SettingNames instance. + */ + private final String value; + + SettingNames(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SettingNames instance. + * + * @param value the serialized value to parse. + * @return the parsed SettingNames object, or null if unable to parse. + */ + @JsonCreator + public static SettingNames fromString(String value) { + if (value == null) { + return null; + } + SettingNames[] items = SettingNames.values(); + for (SettingNames item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SpotAllocationStrategy.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SpotAllocationStrategy.java new file mode 100644 index 000000000000..547f9a4d257a --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SpotAllocationStrategy.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Spot allocation strategy types for Compute Fleet. + */ +public final class SpotAllocationStrategy extends ExpandableStringEnum { + /** + * Static value PriceCapacityOptimized for SpotAllocationStrategy. + */ + public static final SpotAllocationStrategy PRICE_CAPACITY_OPTIMIZED = fromString("PriceCapacityOptimized"); + + /** + * Static value LowestPrice for SpotAllocationStrategy. + */ + public static final SpotAllocationStrategy LOWEST_PRICE = fromString("LowestPrice"); + + /** + * Static value CapacityOptimized for SpotAllocationStrategy. + */ + public static final SpotAllocationStrategy CAPACITY_OPTIMIZED = fromString("CapacityOptimized"); + + /** + * Creates a new instance of SpotAllocationStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SpotAllocationStrategy() { + } + + /** + * Creates or finds a SpotAllocationStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding SpotAllocationStrategy. + */ + @JsonCreator + public static SpotAllocationStrategy fromString(String name) { + return fromString(name, SpotAllocationStrategy.class); + } + + /** + * Gets known SpotAllocationStrategy values. + * + * @return known SpotAllocationStrategy values. + */ + public static Collection values() { + return values(SpotAllocationStrategy.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SpotPriorityProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SpotPriorityProfile.java new file mode 100644 index 000000000000..f094d4432e7a --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SpotPriorityProfile.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.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Configuration Options for Spot instances in Compute Fleet. + */ +@Fluent +public final class SpotPriorityProfile { + /* + * Total capacity to achieve. It is currently in terms of number of VMs. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /* + * Minimum capacity to achieve which cannot be updated. If we will not be able to "guarantee" minimum capacity, we will reject the request in the sync path itself. + */ + @JsonProperty(value = "minCapacity") + private Integer minCapacity; + + /* + * Price per hour of each Spot VM will never exceed this. + */ + @JsonProperty(value = "maxPricePerVM") + private Float maxPricePerVM; + + /* + * Eviction Policy to follow when evicting Spot VMs. + */ + @JsonProperty(value = "evictionPolicy") + private EvictionPolicy evictionPolicy; + + /* + * Allocation strategy to follow when determining the VM sizes distribution for Spot VMs. + */ + @JsonProperty(value = "allocationStrategy") + private SpotAllocationStrategy allocationStrategy; + + /* + * Flag to enable/disable continuous goal seeking for the desired capacity and restoration of evicted Spot VMs. + * If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs (if VMs are evicted deleted) + * or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate due to capacity constraint) in order to achieve the desired capacity. + * Maintain is enabled by default. + */ + @JsonProperty(value = "maintain") + private Boolean maintain; + + /** + * Creates an instance of SpotPriorityProfile class. + */ + public SpotPriorityProfile() { + } + + /** + * Get the capacity property: Total capacity to achieve. It is currently in terms of number of VMs. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Total capacity to achieve. It is currently in terms of number of VMs. + * + * @param capacity the capacity value to set. + * @return the SpotPriorityProfile object itself. + */ + public SpotPriorityProfile withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the minCapacity property: Minimum capacity to achieve which cannot be updated. If we will not be able to + * "guarantee" minimum capacity, we will reject the request in the sync path itself. + * + * @return the minCapacity value. + */ + public Integer minCapacity() { + return this.minCapacity; + } + + /** + * Set the minCapacity property: Minimum capacity to achieve which cannot be updated. If we will not be able to + * "guarantee" minimum capacity, we will reject the request in the sync path itself. + * + * @param minCapacity the minCapacity value to set. + * @return the SpotPriorityProfile object itself. + */ + public SpotPriorityProfile withMinCapacity(Integer minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * Get the maxPricePerVM property: Price per hour of each Spot VM will never exceed this. + * + * @return the maxPricePerVM value. + */ + public Float maxPricePerVM() { + return this.maxPricePerVM; + } + + /** + * Set the maxPricePerVM property: Price per hour of each Spot VM will never exceed this. + * + * @param maxPricePerVM the maxPricePerVM value to set. + * @return the SpotPriorityProfile object itself. + */ + public SpotPriorityProfile withMaxPricePerVM(Float maxPricePerVM) { + this.maxPricePerVM = maxPricePerVM; + return this; + } + + /** + * Get the evictionPolicy property: Eviction Policy to follow when evicting Spot VMs. + * + * @return the evictionPolicy value. + */ + public EvictionPolicy evictionPolicy() { + return this.evictionPolicy; + } + + /** + * Set the evictionPolicy property: Eviction Policy to follow when evicting Spot VMs. + * + * @param evictionPolicy the evictionPolicy value to set. + * @return the SpotPriorityProfile object itself. + */ + public SpotPriorityProfile withEvictionPolicy(EvictionPolicy evictionPolicy) { + this.evictionPolicy = evictionPolicy; + return this; + } + + /** + * Get the allocationStrategy property: Allocation strategy to follow when determining the VM sizes distribution for + * Spot VMs. + * + * @return the allocationStrategy value. + */ + public SpotAllocationStrategy allocationStrategy() { + return this.allocationStrategy; + } + + /** + * Set the allocationStrategy property: Allocation strategy to follow when determining the VM sizes distribution for + * Spot VMs. + * + * @param allocationStrategy the allocationStrategy value to set. + * @return the SpotPriorityProfile object itself. + */ + public SpotPriorityProfile withAllocationStrategy(SpotAllocationStrategy allocationStrategy) { + this.allocationStrategy = allocationStrategy; + return this; + } + + /** + * Get the maintain property: Flag to enable/disable continuous goal seeking for the desired capacity and + * restoration of evicted Spot VMs. + * If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs (if VMs are + * evicted deleted) + * or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate due to capacity + * constraint) in order to achieve the desired capacity. + * Maintain is enabled by default. + * + * @return the maintain value. + */ + public Boolean maintain() { + return this.maintain; + } + + /** + * Set the maintain property: Flag to enable/disable continuous goal seeking for the desired capacity and + * restoration of evicted Spot VMs. + * If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs (if VMs are + * evicted deleted) + * or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate due to capacity + * constraint) in order to achieve the desired capacity. + * Maintain is enabled by default. + * + * @param maintain the maintain value to set. + * @return the SpotPriorityProfile object itself. + */ + public SpotPriorityProfile withMaintain(Boolean maintain) { + this.maintain = maintain; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SshConfiguration.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SshConfiguration.java new file mode 100644 index 000000000000..ac50be7f8c20 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SshConfiguration.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * SSH configuration for Linux based VMs running on Azure. + */ +@Fluent +public final class SshConfiguration { + /* + * The list of SSH public keys used to authenticate with linux based VMs. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Creates an instance of SshConfiguration class. + */ + public SshConfiguration() { + } + + /** + * Get the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. + * + * @param publicKeys the publicKeys value to set. + * @return the SshConfiguration object itself. + */ + public SshConfiguration withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicKeys() != null) { + publicKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SshPublicKey.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SshPublicKey.java new file mode 100644 index 000000000000..4f3a73631b6c --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SshPublicKey.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. + */ +@Fluent +public final class SshPublicKey { + /* + * Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys + */ + @JsonProperty(value = "path") + private String path; + + /* + * SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + */ + @JsonProperty(value = "keyData") + private String keyData; + + /** + * Creates an instance of SshPublicKey class. + */ + public SshPublicKey() { + } + + /** + * Get the path property: Specifies the full path on the created VM where ssh public key is stored. If the file + * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Specifies the full path on the created VM where ssh public key is stored. If the file + * already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + * + * @param path the path value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs + * to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, see [Create SSH keys on Linux and Mac for + * Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + * + * @return the keyData value. + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs + * to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, see [Create SSH keys on Linux and Mac for + * Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + * + * @param keyData the keyData value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/StatusLevelTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/StatusLevelTypes.java new file mode 100644 index 000000000000..01df36cdc49a --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/StatusLevelTypes.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The level code. + */ +public enum StatusLevelTypes { + /** + * Enum value Info. + */ + INFO("Info"), + + /** + * Enum value Warning. + */ + WARNING("Warning"), + + /** + * Enum value Error. + */ + ERROR("Error"); + + /** + * The actual serialized value for a StatusLevelTypes instance. + */ + private final String value; + + StatusLevelTypes(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StatusLevelTypes instance. + * + * @param value the serialized value to parse. + * @return the parsed StatusLevelTypes object, or null if unable to parse. + */ + @JsonCreator + public static StatusLevelTypes fromString(String value) { + if (value == null) { + return null; + } + StatusLevelTypes[] items = StatusLevelTypes.values(); + for (StatusLevelTypes item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/StorageAccountTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/StorageAccountTypes.java new file mode 100644 index 000000000000..dd8c2fa15ced --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/StorageAccountTypes.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when + * you create the scale set. NOTE: UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. + * Standard_LRS uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS uses Premium SSD. UltraSSD_LRS uses + * Ultra disk. Premium_ZRS uses Premium SSD zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant + * storage. For more information regarding disks supported for Windows Virtual Machines, refer to + * https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to + * https://docs.microsoft.com/azure/virtual-machines/linux/disks-types. + */ +public final class StorageAccountTypes extends ExpandableStringEnum { + /** + * Static value Standard_LRS for StorageAccountTypes. + */ + public static final StorageAccountTypes STANDARD_LRS = fromString("Standard_LRS"); + + /** + * Static value Premium_LRS for StorageAccountTypes. + */ + public static final StorageAccountTypes PREMIUM_LRS = fromString("Premium_LRS"); + + /** + * Static value StandardSSD_LRS for StorageAccountTypes. + */ + public static final StorageAccountTypes STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** + * Static value UltraSSD_LRS for StorageAccountTypes. + */ + public static final StorageAccountTypes ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); + + /** + * Static value Premium_ZRS for StorageAccountTypes. + */ + public static final StorageAccountTypes PREMIUM_ZRS = fromString("Premium_ZRS"); + + /** + * Static value StandardSSD_ZRS for StorageAccountTypes. + */ + public static final StorageAccountTypes STANDARD_SSD_ZRS = fromString("StandardSSD_ZRS"); + + /** + * Static value PremiumV2_LRS for StorageAccountTypes. + */ + public static final StorageAccountTypes PREMIUM_V2_LRS = fromString("PremiumV2_LRS"); + + /** + * Creates a new instance of StorageAccountTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageAccountTypes() { + } + + /** + * Creates or finds a StorageAccountTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageAccountTypes. + */ + @JsonCreator + public static StorageAccountTypes fromString(String name) { + return fromString(name, StorageAccountTypes.class); + } + + /** + * Gets known StorageAccountTypes values. + * + * @return known StorageAccountTypes values. + */ + public static Collection values() { + return values(StorageAccountTypes.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SubResourceReadOnly.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SubResourceReadOnly.java new file mode 100644 index 000000000000..e9ef1c1a77c8 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/SubResourceReadOnly.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.azurefleet.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SubResourceReadOnly model. + */ +@Immutable +public class SubResourceReadOnly { + /* + * Resource Id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Creates an instance of SubResourceReadOnly class. + */ + public SubResourceReadOnly() { + } + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/TerminateNotificationProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/TerminateNotificationProfile.java new file mode 100644 index 000000000000..27798d7fd634 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/TerminateNotificationProfile.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The TerminateNotificationProfile model. + */ +@Fluent +public final class TerminateNotificationProfile { + /* + * Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M) + */ + @JsonProperty(value = "notBeforeTimeout") + private String notBeforeTimeout; + + /* + * Specifies whether the Terminate Scheduled event is enabled or disabled. + */ + @JsonProperty(value = "enable") + private Boolean enable; + + /** + * Creates an instance of TerminateNotificationProfile class. + */ + public TerminateNotificationProfile() { + } + + /** + * Get the notBeforeTimeout property: Configurable length of time a Virtual Machine being deleted will have to + * potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The + * configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M). + * + * @return the notBeforeTimeout value. + */ + public String notBeforeTimeout() { + return this.notBeforeTimeout; + } + + /** + * Set the notBeforeTimeout property: Configurable length of time a Virtual Machine being deleted will have to + * potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The + * configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M). + * + * @param notBeforeTimeout the notBeforeTimeout value to set. + * @return the TerminateNotificationProfile object itself. + */ + public TerminateNotificationProfile withNotBeforeTimeout(String notBeforeTimeout) { + this.notBeforeTimeout = notBeforeTimeout; + return this; + } + + /** + * Get the enable property: Specifies whether the Terminate Scheduled event is enabled or disabled. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: Specifies whether the Terminate Scheduled event is enabled or disabled. + * + * @param enable the enable value to set. + * @return the TerminateNotificationProfile object itself. + */ + public TerminateNotificationProfile withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/UefiSettings.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/UefiSettings.java new file mode 100644 index 000000000000..757bcc19d37e --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/UefiSettings.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum + * api-version: 2020-12-01. + */ +@Fluent +public final class UefiSettings { + /* + * Specifies whether secure boot should be enabled on the virtual machine. Minimum api-version: 2020-12-01. + */ + @JsonProperty(value = "secureBootEnabled") + private Boolean secureBootEnabled; + + /* + * Specifies whether vTPM should be enabled on the virtual machine. Minimum api-version: 2020-12-01. + */ + @JsonProperty(value = "vTpmEnabled") + private Boolean vTpmEnabled; + + /** + * Creates an instance of UefiSettings class. + */ + public UefiSettings() { + } + + /** + * Get the secureBootEnabled property: Specifies whether secure boot should be enabled on the virtual machine. + * Minimum api-version: 2020-12-01. + * + * @return the secureBootEnabled value. + */ + public Boolean secureBootEnabled() { + return this.secureBootEnabled; + } + + /** + * Set the secureBootEnabled property: Specifies whether secure boot should be enabled on the virtual machine. + * Minimum api-version: 2020-12-01. + * + * @param secureBootEnabled the secureBootEnabled value to set. + * @return the UefiSettings object itself. + */ + public UefiSettings withSecureBootEnabled(Boolean secureBootEnabled) { + this.secureBootEnabled = secureBootEnabled; + return this; + } + + /** + * Get the vTpmEnabled property: Specifies whether vTPM should be enabled on the virtual machine. Minimum + * api-version: 2020-12-01. + * + * @return the vTpmEnabled value. + */ + public Boolean vTpmEnabled() { + return this.vTpmEnabled; + } + + /** + * Set the vTpmEnabled property: Specifies whether vTPM should be enabled on the virtual machine. Minimum + * api-version: 2020-12-01. + * + * @param vTpmEnabled the vTpmEnabled value to set. + * @return the UefiSettings object itself. + */ + public UefiSettings withVTpmEnabled(Boolean vTpmEnabled) { + this.vTpmEnabled = vTpmEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/UserAssignedIdentity.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..daf8833bba25 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/UserAssignedIdentity.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VMDiskSecurityProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VMDiskSecurityProfile.java new file mode 100644 index 000000000000..71e9becdc3c7 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VMDiskSecurityProfile.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the security profile settings for the managed disk. **Note:** It can only be set for Confidential VMs. + */ +@Fluent +public final class VMDiskSecurityProfile { + /* + * Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. **Note:** It can be set for only Confidential VMs. + */ + @JsonProperty(value = "securityEncryptionType") + private SecurityEncryptionTypes securityEncryptionType; + + /* + * Specifies the customer managed disk encryption set resource id for the managed disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and VMGuest blob. + */ + @JsonProperty(value = "diskEncryptionSet") + private DiskEncryptionSetParameters diskEncryptionSet; + + /** + * Creates an instance of VMDiskSecurityProfile class. + */ + public VMDiskSecurityProfile() { + } + + /** + * Get the securityEncryptionType property: Specifies the EncryptionType of the managed disk. It is set to + * DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, VMGuestStateOnly for + * encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the + * VMGuestState blob.. **Note:** It can be set for only Confidential VMs. + * + * @return the securityEncryptionType value. + */ + public SecurityEncryptionTypes securityEncryptionType() { + return this.securityEncryptionType; + } + + /** + * Set the securityEncryptionType property: Specifies the EncryptionType of the managed disk. It is set to + * DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, VMGuestStateOnly for + * encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the + * VMGuestState blob.. **Note:** It can be set for only Confidential VMs. + * + * @param securityEncryptionType the securityEncryptionType value to set. + * @return the VMDiskSecurityProfile object itself. + */ + public VMDiskSecurityProfile withSecurityEncryptionType(SecurityEncryptionTypes securityEncryptionType) { + this.securityEncryptionType = securityEncryptionType; + return this; + } + + /** + * Get the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and VMGuest blob. + * + * @return the diskEncryptionSet value. + */ + public DiskEncryptionSetParameters diskEncryptionSet() { + return this.diskEncryptionSet; + } + + /** + * Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and VMGuest blob. + * + * @param diskEncryptionSet the diskEncryptionSet value to set. + * @return the VMDiskSecurityProfile object itself. + */ + public VMDiskSecurityProfile withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { + this.diskEncryptionSet = diskEncryptionSet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskEncryptionSet() != null) { + diskEncryptionSet().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VMGalleryApplication.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VMGalleryApplication.java new file mode 100644 index 000000000000..5b3c4367bc6f --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VMGalleryApplication.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the required information to reference a compute gallery application version. + */ +@Fluent +public final class VMGalleryApplication { + /* + * Optional, Specifies a passthrough value for more generic context. + */ + @JsonProperty(value = "tags") + private String tags; + + /* + * Optional, Specifies the order in which the packages have to be installed + */ + @JsonProperty(value = "order") + private Integer order; + + /* + * Specifies the GalleryApplicationVersion resource id on the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} + */ + @JsonProperty(value = "packageReferenceId", required = true) + private String packageReferenceId; + + /* + * Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided + */ + @JsonProperty(value = "configurationReference") + private String configurationReference; + + /* + * Optional, If true, any failure for any operation in the VmApplication will fail the deployment + */ + @JsonProperty(value = "treatFailureAsDeploymentFailure") + private Boolean treatFailureAsDeploymentFailure; + + /* + * If set to true, when a new Gallery Application version is available in PIR/SIG, it will be automatically updated for the VM/VMSS + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /** + * Creates an instance of VMGalleryApplication class. + */ + public VMGalleryApplication() { + } + + /** + * Get the tags property: Optional, Specifies a passthrough value for more generic context. + * + * @return the tags value. + */ + public String tags() { + return this.tags; + } + + /** + * Set the tags property: Optional, Specifies a passthrough value for more generic context. + * + * @param tags the tags value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withTags(String tags) { + this.tags = tags; + return this; + } + + /** + * Get the order property: Optional, Specifies the order in which the packages have to be installed. + * + * @return the order value. + */ + public Integer order() { + return this.order; + } + + /** + * Set the order property: Optional, Specifies the order in which the packages have to be installed. + * + * @param order the order value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withOrder(Integer order) { + this.order = order; + return this; + } + + /** + * Get the packageReferenceId property: Specifies the GalleryApplicationVersion resource id on the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. + * + * @return the packageReferenceId value. + */ + public String packageReferenceId() { + return this.packageReferenceId; + } + + /** + * Set the packageReferenceId property: Specifies the GalleryApplicationVersion resource id on the form of + * /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. + * + * @param packageReferenceId the packageReferenceId value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withPackageReferenceId(String packageReferenceId) { + this.packageReferenceId = packageReferenceId; + return this; + } + + /** + * Get the configurationReference property: Optional, Specifies the uri to an azure blob that will replace the + * default configuration for the package if provided. + * + * @return the configurationReference value. + */ + public String configurationReference() { + return this.configurationReference; + } + + /** + * Set the configurationReference property: Optional, Specifies the uri to an azure blob that will replace the + * default configuration for the package if provided. + * + * @param configurationReference the configurationReference value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withConfigurationReference(String configurationReference) { + this.configurationReference = configurationReference; + return this; + } + + /** + * Get the treatFailureAsDeploymentFailure property: Optional, If true, any failure for any operation in the + * VmApplication will fail the deployment. + * + * @return the treatFailureAsDeploymentFailure value. + */ + public Boolean treatFailureAsDeploymentFailure() { + return this.treatFailureAsDeploymentFailure; + } + + /** + * Set the treatFailureAsDeploymentFailure property: Optional, If true, any failure for any operation in the + * VmApplication will fail the deployment. + * + * @param treatFailureAsDeploymentFailure the treatFailureAsDeploymentFailure value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withTreatFailureAsDeploymentFailure(Boolean treatFailureAsDeploymentFailure) { + this.treatFailureAsDeploymentFailure = treatFailureAsDeploymentFailure; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: If set to true, when a new Gallery Application version is available in + * PIR/SIG, it will be automatically updated for the VM/VMSS. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: If set to true, when a new Gallery Application version is available in + * PIR/SIG, it will be automatically updated for the VM/VMSS. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VMGalleryApplication object itself. + */ + public VMGalleryApplication withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (packageReferenceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property packageReferenceId in model VMGalleryApplication")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VMGalleryApplication.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VMSizeProperties.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VMSizeProperties.java new file mode 100644 index 000000000000..f30049689035 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VMSizeProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies VM Size Property settings on the virtual machine. + */ +@Fluent +public final class VMSizeProperties { + /* + * Specifies the number of vCPUs available for the VM. When this property is not specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + */ + @JsonProperty(value = "vCPUsAvailable") + private Integer vCpusAvailable; + + /* + * Specifies the vCPU to physical core ratio. When this property is not specified in the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). **Setting this property to 1 also means that hyper-threading is disabled.** + */ + @JsonProperty(value = "vCPUsPerCore") + private Integer vCpusPerCore; + + /** + * Creates an instance of VMSizeProperties class. + */ + public VMSizeProperties() { + } + + /** + * Get the vCpusAvailable property: Specifies the number of vCPUs available for the VM. When this property is not + * specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size + * exposed in api response of [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + * + * @return the vCpusAvailable value. + */ + public Integer vCpusAvailable() { + return this.vCpusAvailable; + } + + /** + * Set the vCpusAvailable property: Specifies the number of vCPUs available for the VM. When this property is not + * specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size + * exposed in api response of [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + * + * @param vCpusAvailable the vCpusAvailable value to set. + * @return the VMSizeProperties object itself. + */ + public VMSizeProperties withVCpusAvailable(Integer vCpusAvailable) { + this.vCpusAvailable = vCpusAvailable; + return this; + } + + /** + * Get the vCpusPerCore property: Specifies the vCPU to physical core ratio. When this property is not specified in + * the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response + * of [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). **Setting this property to 1 also + * means that hyper-threading is disabled.**. + * + * @return the vCpusPerCore value. + */ + public Integer vCpusPerCore() { + return this.vCpusPerCore; + } + + /** + * Set the vCpusPerCore property: Specifies the vCPU to physical core ratio. When this property is not specified in + * the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response + * of [List all available virtual machine sizes in a + * region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). **Setting this property to 1 also + * means that hyper-threading is disabled.**. + * + * @param vCpusPerCore the vCpusPerCore value to set. + * @return the VMSizeProperties object itself. + */ + public VMSizeProperties withVCpusPerCore(Integer vCpusPerCore) { + this.vCpusPerCore = vCpusPerCore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VaultCertificate.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VaultCertificate.java new file mode 100644 index 000000000000..dc2d1df73701 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VaultCertificate.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. + */ +@Fluent +public final class VaultCertificate { + /* + * This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

{
"data":"",
"dataType":"pfx",
"password":""
}
To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + */ + @JsonProperty(value = "certificateUrl") + private String certificateUrl; + + /* + * For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. + */ + @JsonProperty(value = "certificateStore") + private String certificateStore; + + /** + * Creates an instance of VaultCertificate class. + */ + public VaultCertificate() { + } + + /** + * Get the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: + * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> + * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>} <br> To install certificates + * on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for + * Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @return the certificateUrl value. + */ + public String certificateUrl() { + return this.certificateUrl; + } + + /** + * Set the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: + * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> + * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>} <br> To install certificates + * on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for + * Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @param certificateUrl the certificateUrl value to set. + * @return the VaultCertificate object itself. + */ + public VaultCertificate withCertificateUrl(String certificateUrl) { + this.certificateUrl = certificateUrl; + return this; + } + + /** + * Get the certificateStore property: For Windows VMs, specifies the certificate store on the Virtual Machine to + * which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. + * For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name + * &lt;UppercaseThumbprint&gt;.crt for the X509 certificate file and &lt;UppercaseThumbprint&gt;.prv + * for private key. Both of these files are .pem formatted. + * + * @return the certificateStore value. + */ + public String certificateStore() { + return this.certificateStore; + } + + /** + * Set the certificateStore property: For Windows VMs, specifies the certificate store on the Virtual Machine to + * which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. + * For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name + * &lt;UppercaseThumbprint&gt;.crt for the X509 certificate file and &lt;UppercaseThumbprint&gt;.prv + * for private key. Both of these files are .pem formatted. + * + * @param certificateStore the certificateStore value to set. + * @return the VaultCertificate object itself. + */ + public VaultCertificate withCertificateStore(String certificateStore) { + this.certificateStore = certificateStore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VaultSecretGroup.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VaultSecretGroup.java new file mode 100644 index 000000000000..bcb2a3904aa4 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VaultSecretGroup.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a set of certificates which are all in the same Key Vault. + */ +@Fluent +public final class VaultSecretGroup { + /* + * The relative URL of the Key Vault containing all of the certificates in VaultCertificates. + */ + @JsonProperty(value = "sourceVault") + private SubResource sourceVault; + + /* + * The list of key vault references in SourceVault which contain certificates. + */ + @JsonProperty(value = "vaultCertificates") + private List vaultCertificates; + + /** + * Creates an instance of VaultSecretGroup class. + */ + public VaultSecretGroup() { + } + + /** + * Get the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @return the sourceVault value. + */ + public SubResource sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @param sourceVault the sourceVault value to set. + * @return the VaultSecretGroup object itself. + */ + public VaultSecretGroup withSourceVault(SubResource sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @return the vaultCertificates value. + */ + public List vaultCertificates() { + return this.vaultCertificates; + } + + /** + * Set the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @param vaultCertificates the vaultCertificates value to set. + * @return the VaultSecretGroup object itself. + */ + public VaultSecretGroup withVaultCertificates(List vaultCertificates) { + this.vaultCertificates = vaultCertificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vaultCertificates() != null) { + vaultCertificates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualHardDisk.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualHardDisk.java new file mode 100644 index 000000000000..5f27fbdf6060 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualHardDisk.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the uri of a disk. + */ +@Fluent +public final class VirtualHardDisk { + /* + * Specifies the virtual hard disk's uri. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * Creates an instance of VirtualHardDisk class. + */ + public VirtualHardDisk() { + } + + /** + * Get the uri property: Specifies the virtual hard disk's uri. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: Specifies the virtual hard disk's uri. + * + * @param uri the uri value to set. + * @return the VirtualHardDisk object itself. + */ + public VirtualHardDisk withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineEvictionPolicyTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineEvictionPolicyTypes.java new file mode 100644 index 000000000000..77f2a7c2e5a8 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineEvictionPolicyTypes.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the eviction policy for the Azure Spot VM/VMSS. + */ +public final class VirtualMachineEvictionPolicyTypes extends ExpandableStringEnum { + /** + * Static value Deallocate for VirtualMachineEvictionPolicyTypes. + */ + public static final VirtualMachineEvictionPolicyTypes DEALLOCATE = fromString("Deallocate"); + + /** + * Static value Delete for VirtualMachineEvictionPolicyTypes. + */ + public static final VirtualMachineEvictionPolicyTypes DELETE = fromString("Delete"); + + /** + * Creates a new instance of VirtualMachineEvictionPolicyTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineEvictionPolicyTypes() { + } + + /** + * Creates or finds a VirtualMachineEvictionPolicyTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineEvictionPolicyTypes. + */ + @JsonCreator + public static VirtualMachineEvictionPolicyTypes fromString(String name) { + return fromString(name, VirtualMachineEvictionPolicyTypes.class); + } + + /** + * Gets known VirtualMachineEvictionPolicyTypes values. + * + * @return known VirtualMachineEvictionPolicyTypes values. + */ + public static Collection values() { + return values(VirtualMachineEvictionPolicyTypes.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineExtension.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineExtension.java new file mode 100644 index 000000000000..759b1496acd9 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineExtension.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineExtensionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * Describes a Virtual Machine Extension. + */ +@Fluent +public final class VirtualMachineExtension extends ResourceWithOptionalLocation { + /* + * Describes the properties of a Virtual Machine Extension. + */ + @JsonProperty(value = "properties") + private VirtualMachineExtensionProperties innerProperties; + + /** + * Creates an instance of VirtualMachineExtension class. + */ + public VirtualMachineExtension() { + } + + /** + * Get the innerProperties property: Describes the properties of a Virtual Machine Extension. + * + * @return the innerProperties value. + */ + private VirtualMachineExtensionProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualMachineExtension withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualMachineExtension withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withForceUpdateTag(String forceUpdateTag) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().settings(); + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withSettings(Object settings) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withProtectedSettings(Object protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The virtual machine extension instance view. + * + * @return the instanceView value. + */ + public VirtualMachineExtensionInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Set the instanceView property: The virtual machine extension instance view. + * + * @param instanceView the instanceView value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withInstanceView(VirtualMachineExtensionInstanceView instanceView) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withInstanceView(instanceView); + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.innerProperties() == null ? null : this.innerProperties().suppressFailures(); + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withSuppressFailures(Boolean suppressFailures) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withSuppressFailures(suppressFailures); + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettingsFromKeyVault(); + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension + withProtectedSettingsFromKeyVault(KeyVaultSecretReference protectedSettingsFromKeyVault) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } + + /** + * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + public List provisionAfterExtensions() { + return this.innerProperties() == null ? null : this.innerProperties().provisionAfterExtensions(); + } + + /** + * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @param provisionAfterExtensions the provisionAfterExtensions value to set. + * @return the VirtualMachineExtension object itself. + */ + public VirtualMachineExtension withProvisionAfterExtensions(List provisionAfterExtensions) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineExtensionProperties(); + } + this.innerProperties().withProvisionAfterExtensions(provisionAfterExtensions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineExtensionInstanceView.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineExtensionInstanceView.java new file mode 100644 index 000000000000..c0ce76d38de4 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineExtensionInstanceView.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The instance view of a virtual machine extension. + */ +@Fluent +public final class VirtualMachineExtensionInstanceView { + /* + * The virtual machine extension name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the type of the extension; an example is "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /* + * The resource status information. + */ + @JsonProperty(value = "substatuses") + private List substatuses; + + /* + * The resource status information. + */ + @JsonProperty(value = "statuses") + private List statuses; + + /** + * Creates an instance of VirtualMachineExtensionInstanceView class. + */ + public VirtualMachineExtensionInstanceView() { + } + + /** + * Get the name property: The virtual machine extension name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The virtual machine extension name. + * + * @param name the name value to set. + * @return the VirtualMachineExtensionInstanceView object itself. + */ + public VirtualMachineExtensionInstanceView withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineExtensionInstanceView object itself. + */ + public VirtualMachineExtensionInstanceView withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineExtensionInstanceView object itself. + */ + public VirtualMachineExtensionInstanceView withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the substatuses property: The resource status information. + * + * @return the substatuses value. + */ + public List substatuses() { + return this.substatuses; + } + + /** + * Set the substatuses property: The resource status information. + * + * @param substatuses the substatuses value to set. + * @return the VirtualMachineExtensionInstanceView object itself. + */ + public VirtualMachineExtensionInstanceView withSubstatuses(List substatuses) { + this.substatuses = substatuses; + return this; + } + + /** + * Get the statuses property: The resource status information. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * Set the statuses property: The resource status information. + * + * @param statuses the statuses value to set. + * @return the VirtualMachineExtensionInstanceView object itself. + */ + public VirtualMachineExtensionInstanceView withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (substatuses() != null) { + substatuses().forEach(e -> e.validate()); + } + if (statuses() != null) { + statuses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachinePriorityTypes.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachinePriorityTypes.java new file mode 100644 index 000000000000..3a9b99647fa3 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachinePriorityTypes.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the priority for a standalone virtual machine or the virtual machines in the scale set. 'Low' enum will be + * deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot VM/VMSS. + */ +public final class VirtualMachinePriorityTypes extends ExpandableStringEnum { + /** + * Static value Regular for VirtualMachinePriorityTypes. + */ + public static final VirtualMachinePriorityTypes REGULAR = fromString("Regular"); + + /** + * Static value Low for VirtualMachinePriorityTypes. + */ + public static final VirtualMachinePriorityTypes LOW = fromString("Low"); + + /** + * Static value Spot for VirtualMachinePriorityTypes. + */ + public static final VirtualMachinePriorityTypes SPOT = fromString("Spot"); + + /** + * Creates a new instance of VirtualMachinePriorityTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachinePriorityTypes() { + } + + /** + * Creates or finds a VirtualMachinePriorityTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachinePriorityTypes. + */ + @JsonCreator + public static VirtualMachinePriorityTypes fromString(String name) { + return fromString(name, VirtualMachinePriorityTypes.class); + } + + /** + * Gets known VirtualMachinePriorityTypes values. + * + * @return known VirtualMachinePriorityTypes values. + */ + public static Collection values() { + return values(VirtualMachinePriorityTypes.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSet.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSet.java new file mode 100644 index 000000000000..42df23c0c415 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSet.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner; + +/** + * An immutable client-side representation of VirtualMachineScaleSet. + */ +public interface VirtualMachineScaleSet { + /** + * Gets the name property: The name of the virtualMachineScaleSet. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The compute RP resource id of the virtualMachineScaleSet + * "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}". + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Type of the virtualMachineScaleSet. + * + * @return the type value. + */ + String type(); + + /** + * Gets the operationStatus property: This represents the operationStatus of the VMSS in response to the last + * operation that was performed on it by Azure Fleet resource. + * + * @return the operationStatus value. + */ + ProvisioningState operationStatus(); + + /** + * Gets the error property: Error Information when `operationStatus` is `Failed`. + * + * @return the error value. + */ + ApiError error(); + + /** + * Gets the inner com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner object. + * + * @return the inner object. + */ + VirtualMachineScaleSetInner innerModel(); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetDataDisk.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetDataDisk.java new file mode 100644 index 000000000000..96692cd81536 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetDataDisk.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a virtual machine scale set data disk. + */ +@Fluent +public final class VirtualMachineScaleSetDataDisk { + /* + * The disk name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. + */ + @JsonProperty(value = "lun", required = true) + private int lun; + + /* + * Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.** + */ + @JsonProperty(value = "caching") + private CachingTypes caching; + + /* + * Specifies whether writeAccelerator should be enabled or disabled on the disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + + /* + * The create option. + */ + @JsonProperty(value = "createOption", required = true) + private DiskCreateOptionTypes createOption; + + /* + * Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023. + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * The managed disk parameters. + */ + @JsonProperty(value = "managedDisk") + private VirtualMachineScaleSetManagedDiskParameters managedDisk; + + /* + * Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + */ + @JsonProperty(value = "diskIOPSReadWrite") + private Long diskIopsReadWrite; + + /* + * Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + */ + @JsonProperty(value = "diskMBpsReadWrite") + private Long diskMBpsReadWrite; + + /* + * Specifies whether data disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with Flexible OrchestrationMode only).

Possible values:

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

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

The default value is set to **Delete**. + */ + @JsonProperty(value = "deleteOption") + private DiskDeleteOptionTypes deleteOption; + + /** + * Creates an instance of VirtualMachineScaleSetDataDisk class. + */ + public VirtualMachineScaleSetDataDisk() { + } + + /** + * Get the name property: The disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The disk name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withName(String name) { + this.name = name; + return this; + } + + /** + * Get the lun property: Specifies the logical unit number of the data disk. This value is used to identify data + * disks within the VM and therefore must be unique for each data disk attached to a VM. + * + * @return the lun value. + */ + public int lun() { + return this.lun; + } + + /** + * Set the lun property: Specifies the logical unit number of the data disk. This value is used to identify data + * disks within the VM and therefore must be unique for each data disk attached to a VM. + * + * @param lun the lun value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withLun(int lun) { + this.lun = lun; + return this; + } + + /** + * Get the caching property: Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.**. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Set the caching property: Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.**. + * + * @param caching the caching value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withCaching(CachingTypes caching) { + this.caching = caching; + return this; + } + + /** + * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @return the writeAcceleratorEnabled value. + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + + /** + * Get the createOption property: The create option. + * + * @return the createOption value. + */ + public DiskCreateOptionTypes createOption() { + return this.createOption; + } + + /** + * Set the createOption property: The create option. + * + * @param createOption the createOption value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withCreateOption(DiskCreateOptionTypes createOption) { + this.createOption = createOption; + return this; + } + + /** + * Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. The property diskSizeGB is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. The property diskSizeGB is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the managedDisk property: The managed disk parameters. + * + * @return the managedDisk value. + */ + public VirtualMachineScaleSetManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withManagedDisk(VirtualMachineScaleSetManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk. Should be used only when + * StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + * + * @return the diskIopsReadWrite value. + */ + public Long diskIopsReadWrite() { + return this.diskIopsReadWrite; + } + + /** + * Set the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk. Should be used only when + * StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + * + * @param diskIopsReadWrite the diskIopsReadWrite value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withDiskIopsReadWrite(Long diskIopsReadWrite) { + this.diskIopsReadWrite = diskIopsReadWrite; + return this; + } + + /** + * Get the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk. Should be used + * only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on + * diskSizeGB. + * + * @return the diskMBpsReadWrite value. + */ + public Long diskMBpsReadWrite() { + return this.diskMBpsReadWrite; + } + + /** + * Set the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk. Should be used + * only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on + * diskSizeGB. + * + * @param diskMBpsReadWrite the diskMBpsReadWrite value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withDiskMBpsReadWrite(Long diskMBpsReadWrite) { + this.diskMBpsReadWrite = diskMBpsReadWrite; + return this; + } + + /** + * Get the deleteOption property: Specifies whether data disk should be deleted or detached upon VMSS Flex deletion + * (This feature is available for VMSS with Flexible OrchestrationMode only).<br><br> Possible values: + * <br><br> **Delete** If this value is used, the data disk is deleted when the VMSS Flex VM is + * deleted.<br><br> **Detach** If this value is used, the data disk is retained after VMSS Flex VM is + * deleted.<br><br> The default value is set to **Delete**. + * + * @return the deleteOption value. + */ + public DiskDeleteOptionTypes deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specifies whether data disk should be deleted or detached upon VMSS Flex deletion + * (This feature is available for VMSS with Flexible OrchestrationMode only).<br><br> Possible values: + * <br><br> **Delete** If this value is used, the data disk is deleted when the VMSS Flex VM is + * deleted.<br><br> **Detach** If this value is used, the data disk is retained after VMSS Flex VM is + * deleted.<br><br> The default value is set to **Delete**. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetDataDisk object itself. + */ + public VirtualMachineScaleSetDataDisk withDeleteOption(DiskDeleteOptionTypes deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (createOption() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property createOption in model VirtualMachineScaleSetDataDisk")); + } + if (managedDisk() != null) { + managedDisk().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetDataDisk.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetExtension.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetExtension.java new file mode 100644 index 000000000000..79c269551830 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetExtension.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetExtensionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a Virtual Machine Scale Set Extension. + */ +@Fluent +public final class VirtualMachineScaleSetExtension extends SubResourceReadOnly { + /* + * The name of the extension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Describes the properties of a Virtual Machine Scale Set Extension. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetExtensionProperties innerProperties; + + /** + * Creates an instance of VirtualMachineScaleSetExtension class. + */ + public VirtualMachineScaleSetExtension() { + } + + /** + * Get the name property: The name of the extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extension. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Describes the properties of a Virtual Machine Scale Set Extension. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetExtensionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension withForceUpdateTag(String forceUpdateTag) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version of the extension available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.innerProperties() == null ? null : this.innerProperties().settings(); + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension withSettings(Object settings) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension withProtectedSettings(Object protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + public List provisionAfterExtensions() { + return this.innerProperties() == null ? null : this.innerProperties().provisionAfterExtensions(); + } + + /** + * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @param provisionAfterExtensions the provisionAfterExtensions value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension withProvisionAfterExtensions(List provisionAfterExtensions) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withProvisionAfterExtensions(provisionAfterExtensions); + return this; + } + + /** + * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @return the suppressFailures value. + */ + public Boolean suppressFailures() { + return this.innerProperties() == null ? null : this.innerProperties().suppressFailures(); + } + + /** + * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The + * default is false. + * + * @param suppressFailures the suppressFailures value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension withSuppressFailures(Boolean suppressFailures) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withSuppressFailures(suppressFailures); + return this; + } + + /** + * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @return the protectedSettingsFromKeyVault value. + */ + public KeyVaultSecretReference protectedSettingsFromKeyVault() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettingsFromKeyVault(); + } + + /** + * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, + * and consumed from key vault. + * + * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. + * @return the VirtualMachineScaleSetExtension object itself. + */ + public VirtualMachineScaleSetExtension + withProtectedSettingsFromKeyVault(KeyVaultSecretReference protectedSettingsFromKeyVault) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetExtensionProperties(); + } + this.innerProperties().withProtectedSettingsFromKeyVault(protectedSettingsFromKeyVault); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetExtensionProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetExtensionProfile.java new file mode 100644 index 000000000000..09d62a6561e8 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetExtensionProfile.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machine scale set extension profile. + */ +@Fluent +public final class VirtualMachineScaleSetExtensionProfile { + /* + * The virtual machine scale set child extension resources. + */ + @JsonProperty(value = "extensions") + private List extensions; + + /* + * Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). Minimum api-version: 2020-06-01. + */ + @JsonProperty(value = "extensionsTimeBudget") + private String extensionsTimeBudget; + + /** + * Creates an instance of VirtualMachineScaleSetExtensionProfile class. + */ + public VirtualMachineScaleSetExtensionProfile() { + } + + /** + * Get the extensions property: The virtual machine scale set child extension resources. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: The virtual machine scale set child extension resources. + * + * @param extensions the extensions value to set. + * @return the VirtualMachineScaleSetExtensionProfile object itself. + */ + public VirtualMachineScaleSetExtensionProfile withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default + * value is 90 minutes (PT1H30M). Minimum api-version: 2020-06-01. + * + * @return the extensionsTimeBudget value. + */ + public String extensionsTimeBudget() { + return this.extensionsTimeBudget; + } + + /** + * Set the extensionsTimeBudget property: Specifies the time alloted for all extensions to start. The time duration + * should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default + * value is 90 minutes (PT1H30M). Minimum api-version: 2020-06-01. + * + * @param extensionsTimeBudget the extensionsTimeBudget value to set. + * @return the VirtualMachineScaleSetExtensionProfile object itself. + */ + public VirtualMachineScaleSetExtensionProfile withExtensionsTimeBudget(String extensionsTimeBudget) { + this.extensionsTimeBudget = extensionsTimeBudget; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensions() != null) { + extensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetHardwareProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetHardwareProfile.java new file mode 100644 index 000000000000..6b0b1758e023 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetHardwareProfile.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the hardware settings for the virtual machine scale set. + */ +@Fluent +public final class VirtualMachineScaleSetHardwareProfile { + /* + * Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01. Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details. + */ + @JsonProperty(value = "vmSizeProperties") + private VMSizeProperties vmSizeProperties; + + /** + * Creates an instance of VirtualMachineScaleSetHardwareProfile class. + */ + public VirtualMachineScaleSetHardwareProfile() { + } + + /** + * Get the vmSizeProperties property: Specifies the properties for customizing the size of the virtual machine. + * Minimum api-version: 2021-11-01. Please follow the instructions in [VM + * Customization](https://aka.ms/vmcustomization) for more details. + * + * @return the vmSizeProperties value. + */ + public VMSizeProperties vmSizeProperties() { + return this.vmSizeProperties; + } + + /** + * Set the vmSizeProperties property: Specifies the properties for customizing the size of the virtual machine. + * Minimum api-version: 2021-11-01. Please follow the instructions in [VM + * Customization](https://aka.ms/vmcustomization) for more details. + * + * @param vmSizeProperties the vmSizeProperties value to set. + * @return the VirtualMachineScaleSetHardwareProfile object itself. + */ + public VirtualMachineScaleSetHardwareProfile withVmSizeProperties(VMSizeProperties vmSizeProperties) { + this.vmSizeProperties = vmSizeProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmSizeProperties() != null) { + vmSizeProperties().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetIpConfiguration.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetIpConfiguration.java new file mode 100644 index 000000000000..a2393ba51452 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetIpConfiguration.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetIpConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machine scale set network profile's IP configuration. + */ +@Fluent +public final class VirtualMachineScaleSetIpConfiguration { + /* + * The IP configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes a virtual machine scale set network profile's IP configuration properties. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetIpConfigurationProperties innerProperties; + + /** + * Creates an instance of VirtualMachineScaleSetIpConfiguration class. + */ + public VirtualMachineScaleSetIpConfiguration() { + } + + /** + * Get the name property: The IP configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The IP configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Describes a virtual machine scale set network profile's IP configuration + * properties. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetIpConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the subnet property: Specifies the identifier of the subnet. + * + * @return the subnet value. + */ + public ApiEntityReference subnet() { + return this.innerProperties() == null ? null : this.innerProperties().subnet(); + } + + /** + * Set the subnet property: Specifies the identifier of the subnet. + * + * @param subnet the subnet value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withSubnet(ApiEntityReference subnet) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withSubnet(subnet); + return this; + } + + /** + * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @return the primary value. + */ + public Boolean primary() { + return this.innerProperties() == null ? null : this.innerProperties().primary(); + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withPrimary(Boolean primary) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withPrimary(primary); + return this; + } + + /** + * Get the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @return the publicIpAddressConfiguration value. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressConfiguration(); + } + + /** + * Set the publicIpAddressConfiguration property: The publicIPAddressConfiguration. + * + * @param publicIpAddressConfiguration the publicIpAddressConfiguration value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withPublicIpAddressConfiguration( + VirtualMachineScaleSetPublicIpAddressConfiguration publicIpAddressConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withPublicIpAddressConfiguration(publicIpAddressConfiguration); + return this; + } + + /** + * Get the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the privateIpAddressVersion value. + */ + public IpVersion privateIpAddressVersion() { + return this.innerProperties() == null ? null : this.innerProperties().privateIpAddressVersion(); + } + + /** + * Set the privateIpAddressVersion property: Available from Api-Version 2017-03-30 onwards, it represents whether + * the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param privateIpAddressVersion the privateIpAddressVersion value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withPrivateIpAddressVersion(privateIpAddressVersion); + return this; + } + + /** + * Get the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A scale set can reference backend address pools of multiple application gateways. + * Multiple scale sets cannot use the same application gateway. + * + * @return the applicationGatewayBackendAddressPools value. + */ + public List applicationGatewayBackendAddressPools() { + return this.innerProperties() == null ? null : this.innerProperties().applicationGatewayBackendAddressPools(); + } + + /** + * Set the applicationGatewayBackendAddressPools property: Specifies an array of references to backend address pools + * of application gateways. A scale set can reference backend address pools of multiple application gateways. + * Multiple scale sets cannot use the same application gateway. + * + * @param applicationGatewayBackendAddressPools the applicationGatewayBackendAddressPools value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration + withApplicationGatewayBackendAddressPools(List applicationGatewayBackendAddressPools) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withApplicationGatewayBackendAddressPools(applicationGatewayBackendAddressPools); + return this; + } + + /** + * Get the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @return the applicationSecurityGroups value. + */ + public List applicationSecurityGroups() { + return this.innerProperties() == null ? null : this.innerProperties().applicationSecurityGroups(); + } + + /** + * Set the applicationSecurityGroups property: Specifies an array of references to application security group. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration + withApplicationSecurityGroups(List applicationSecurityGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withApplicationSecurityGroups(applicationSecurityGroups); + return this; + } + + /** + * Get the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A scale set can reference backend address pools of one public and one internal load balancer. + * Multiple scale sets cannot use the same basic sku load balancer. + * + * @return the loadBalancerBackendAddressPools value. + */ + public List loadBalancerBackendAddressPools() { + return this.innerProperties() == null ? null : this.innerProperties().loadBalancerBackendAddressPools(); + } + + /** + * Set the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of + * load balancers. A scale set can reference backend address pools of one public and one internal load balancer. + * Multiple scale sets cannot use the same basic sku load balancer. + * + * @param loadBalancerBackendAddressPools the loadBalancerBackendAddressPools value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration + withLoadBalancerBackendAddressPools(List loadBalancerBackendAddressPools) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withLoadBalancerBackendAddressPools(loadBalancerBackendAddressPools); + return this; + } + + /** + * Get the loadBalancerInboundNatPools property: Specifies an array of references to inbound Nat pools of the load + * balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple + * scale sets cannot use the same basic sku load balancer. + * + * @return the loadBalancerInboundNatPools value. + */ + public List loadBalancerInboundNatPools() { + return this.innerProperties() == null ? null : this.innerProperties().loadBalancerInboundNatPools(); + } + + /** + * Set the loadBalancerInboundNatPools property: Specifies an array of references to inbound Nat pools of the load + * balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple + * scale sets cannot use the same basic sku load balancer. + * + * @param loadBalancerInboundNatPools the loadBalancerInboundNatPools value to set. + * @return the VirtualMachineScaleSetIpConfiguration object itself. + */ + public VirtualMachineScaleSetIpConfiguration + withLoadBalancerInboundNatPools(List loadBalancerInboundNatPools) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetIpConfigurationProperties(); + } + this.innerProperties().withLoadBalancerInboundNatPools(loadBalancerInboundNatPools); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model VirtualMachineScaleSetIpConfiguration")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetIpConfiguration.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetIpTag.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetIpTag.java new file mode 100644 index 000000000000..fadb48329340 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetIpTag.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the IP tag associated with the public IP address. + */ +@Fluent +public final class VirtualMachineScaleSetIpTag { + /* + * IP tag type. Example: FirstPartyUsage. + */ + @JsonProperty(value = "ipTagType") + private String ipTagType; + + /* + * IP tag associated with the public IP. Example: SQL, Storage etc. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Creates an instance of VirtualMachineScaleSetIpTag class. + */ + public VirtualMachineScaleSetIpTag() { + } + + /** + * Get the ipTagType property: IP tag type. Example: FirstPartyUsage. + * + * @return the ipTagType value. + */ + public String ipTagType() { + return this.ipTagType; + } + + /** + * Set the ipTagType property: IP tag type. Example: FirstPartyUsage. + * + * @param ipTagType the ipTagType value to set. + * @return the VirtualMachineScaleSetIpTag object itself. + */ + public VirtualMachineScaleSetIpTag withIpTagType(String ipTagType) { + this.ipTagType = ipTagType; + return this; + } + + /** + * Get the tag property: IP tag associated with the public IP. Example: SQL, Storage etc. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: IP tag associated with the public IP. Example: SQL, Storage etc. + * + * @param tag the tag value to set. + * @return the VirtualMachineScaleSetIpTag object itself. + */ + public VirtualMachineScaleSetIpTag withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetListResult.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetListResult.java new file mode 100644 index 000000000000..36dba77b5924 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetListResult.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response of a VirtualMachineScaleSet list operation. + */ +@Fluent +public final class VirtualMachineScaleSetListResult { + /* + * The VirtualMachineScaleSet items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of VirtualMachineScaleSetListResult class. + */ + public VirtualMachineScaleSetListResult() { + } + + /** + * Get the value property: The VirtualMachineScaleSet items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The VirtualMachineScaleSet items on this page. + * + * @param value the value value to set. + * @return the VirtualMachineScaleSetListResult object itself. + */ + public VirtualMachineScaleSetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the VirtualMachineScaleSetListResult object itself. + */ + public VirtualMachineScaleSetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model VirtualMachineScaleSetListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetListResult.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetManagedDiskParameters.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetManagedDiskParameters.java new file mode 100644 index 000000000000..e15eec419301 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetManagedDiskParameters.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the parameters of a ScaleSet managed disk. + */ +@Fluent +public final class VirtualMachineScaleSetManagedDiskParameters { + /* + * Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. + */ + @JsonProperty(value = "storageAccountType") + private StorageAccountTypes storageAccountType; + + /* + * Specifies the customer managed disk encryption set resource id for the managed disk. + */ + @JsonProperty(value = "diskEncryptionSet") + private DiskEncryptionSetParameters diskEncryptionSet; + + /* + * Specifies the security profile for the managed disk. + */ + @JsonProperty(value = "securityProfile") + private VMDiskSecurityProfile securityProfile; + + /** + * Creates an instance of VirtualMachineScaleSetManagedDiskParameters class. + */ + public VirtualMachineScaleSetManagedDiskParameters() { + } + + /** + * Get the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. + * + * @return the storageAccountType value. + */ + public StorageAccountTypes storageAccountType() { + return this.storageAccountType; + } + + /** + * Set the storageAccountType property: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS + * can only be used with data disks, it cannot be used with OS Disk. + * + * @param storageAccountType the storageAccountType value to set. + * @return the VirtualMachineScaleSetManagedDiskParameters object itself. + */ + public VirtualMachineScaleSetManagedDiskParameters withStorageAccountType(StorageAccountTypes storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + + /** + * Get the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk. + * + * @return the diskEncryptionSet value. + */ + public DiskEncryptionSetParameters diskEncryptionSet() { + return this.diskEncryptionSet; + } + + /** + * Set the diskEncryptionSet property: Specifies the customer managed disk encryption set resource id for the + * managed disk. + * + * @param diskEncryptionSet the diskEncryptionSet value to set. + * @return the VirtualMachineScaleSetManagedDiskParameters object itself. + */ + public VirtualMachineScaleSetManagedDiskParameters + withDiskEncryptionSet(DiskEncryptionSetParameters diskEncryptionSet) { + this.diskEncryptionSet = diskEncryptionSet; + return this; + } + + /** + * Get the securityProfile property: Specifies the security profile for the managed disk. + * + * @return the securityProfile value. + */ + public VMDiskSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Specifies the security profile for the managed disk. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineScaleSetManagedDiskParameters object itself. + */ + public VirtualMachineScaleSetManagedDiskParameters withSecurityProfile(VMDiskSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskEncryptionSet() != null) { + diskEncryptionSet().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetNetworkConfiguration.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetNetworkConfiguration.java new file mode 100644 index 000000000000..d1787e3da04d --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetNetworkConfiguration.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.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetNetworkConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machine scale set network profile's network configurations. + */ +@Fluent +public final class VirtualMachineScaleSetNetworkConfiguration { + /* + * The network configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes a virtual machine scale set network profile's IP configuration. + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetNetworkConfigurationProperties innerProperties; + + /** + * Creates an instance of VirtualMachineScaleSetNetworkConfiguration class. + */ + public VirtualMachineScaleSetNetworkConfiguration() { + } + + /** + * Get the name property: The network configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The network configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Describes a virtual machine scale set network profile's IP configuration. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetNetworkConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @return the primary value. + */ + public Boolean primary() { + return this.innerProperties() == null ? null : this.innerProperties().primary(); + } + + /** + * Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1 + * network interface. + * + * @param primary the primary value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withPrimary(Boolean primary) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withPrimary(primary); + return this; + } + + /** + * Get the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.innerProperties() == null ? null : this.innerProperties().enableAcceleratedNetworking(); + } + + /** + * Set the enableAcceleratedNetworking property: Specifies whether the network interface is accelerated + * networking-enabled. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration + withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + /** + * Get the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @return the disableTcpStateTracking value. + */ + public Boolean disableTcpStateTracking() { + return this.innerProperties() == null ? null : this.innerProperties().disableTcpStateTracking(); + } + + /** + * Set the disableTcpStateTracking property: Specifies whether the network interface is disabled for tcp state + * tracking. + * + * @param disableTcpStateTracking the disableTcpStateTracking value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withDisableTcpStateTracking(Boolean disableTcpStateTracking) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withDisableTcpStateTracking(disableTcpStateTracking); + return this; + } + + /** + * Get the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @return the enableFpga value. + */ + public Boolean enableFpga() { + return this.innerProperties() == null ? null : this.innerProperties().enableFpga(); + } + + /** + * Set the enableFpga property: Specifies whether the network interface is FPGA networking-enabled. + * + * @param enableFpga the enableFpga value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withEnableFpga(Boolean enableFpga) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withEnableFpga(enableFpga); + return this; + } + + /** + * Get the networkSecurityGroup property: The network security group. + * + * @return the networkSecurityGroup value. + */ + public SubResource networkSecurityGroup() { + return this.innerProperties() == null ? null : this.innerProperties().networkSecurityGroup(); + } + + /** + * Set the networkSecurityGroup property: The network security group. + * + * @param networkSecurityGroup the networkSecurityGroup value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withNetworkSecurityGroup(SubResource networkSecurityGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @return the dnsSettings value. + */ + public VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the network interfaces. + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration + withDnsSettings(VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withDnsSettings(dnsSettings); + return this; + } + + /** + * Get the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); + } + + /** + * Set the ipConfigurations property: Specifies the IP configurations of the network interface. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration + withIpConfigurations(List ipConfigurations) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withIpConfigurations(ipConfigurations); + return this; + } + + /** + * Get the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @return the enableIpForwarding value. + */ + public Boolean enableIpForwarding() { + return this.innerProperties() == null ? null : this.innerProperties().enableIpForwarding(); + } + + /** + * Set the enableIpForwarding property: Whether IP forwarding enabled on this NIC. + * + * @param enableIpForwarding the enableIpForwarding value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withEnableIpForwarding(Boolean enableIpForwarding) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withEnableIpForwarding(enableIpForwarding); + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.innerProperties() == null ? null : this.innerProperties().deleteOption(); + } + + /** + * Set the deleteOption property: Specify what happens to the network interface when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withDeleteOption(DeleteOptions deleteOption) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withDeleteOption(deleteOption); + return this; + } + + /** + * Get the auxiliaryMode property: Specifies whether the Auxiliary mode is enabled for the Network Interface + * resource. + * + * @return the auxiliaryMode value. + */ + public NetworkInterfaceAuxiliaryMode auxiliaryMode() { + return this.innerProperties() == null ? null : this.innerProperties().auxiliaryMode(); + } + + /** + * Set the auxiliaryMode property: Specifies whether the Auxiliary mode is enabled for the Network Interface + * resource. + * + * @param auxiliaryMode the auxiliaryMode value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withAuxiliaryMode(NetworkInterfaceAuxiliaryMode auxiliaryMode) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withAuxiliaryMode(auxiliaryMode); + return this; + } + + /** + * Get the auxiliarySku property: Specifies whether the Auxiliary sku is enabled for the Network Interface resource. + * + * @return the auxiliarySku value. + */ + public NetworkInterfaceAuxiliarySku auxiliarySku() { + return this.innerProperties() == null ? null : this.innerProperties().auxiliarySku(); + } + + /** + * Set the auxiliarySku property: Specifies whether the Auxiliary sku is enabled for the Network Interface resource. + * + * @param auxiliarySku the auxiliarySku value to set. + * @return the VirtualMachineScaleSetNetworkConfiguration object itself. + */ + public VirtualMachineScaleSetNetworkConfiguration withAuxiliarySku(NetworkInterfaceAuxiliarySku auxiliarySku) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetNetworkConfigurationProperties(); + } + this.innerProperties().withAuxiliarySku(auxiliarySku); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model VirtualMachineScaleSetNetworkConfiguration")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetNetworkConfiguration.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java new file mode 100644 index 000000000000..d3d9e6a5b909 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetNetworkConfigurationDnsSettings.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machines scale sets network configuration's DNS settings. + */ +@Fluent +public final class VirtualMachineScaleSetNetworkConfigurationDnsSettings { + /* + * List of DNS servers IP addresses + */ + @JsonProperty(value = "dnsServers") + private List dnsServers; + + /** + * Creates an instance of VirtualMachineScaleSetNetworkConfigurationDnsSettings class. + */ + public VirtualMachineScaleSetNetworkConfigurationDnsSettings() { + } + + /** + * Get the dnsServers property: List of DNS servers IP addresses. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: List of DNS servers IP addresses. + * + * @param dnsServers the dnsServers value to set. + * @return the VirtualMachineScaleSetNetworkConfigurationDnsSettings object itself. + */ + public VirtualMachineScaleSetNetworkConfigurationDnsSettings withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetNetworkProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetNetworkProfile.java new file mode 100644 index 000000000000..ee7ff9d102b5 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetNetworkProfile.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machine scale set network profile. + */ +@Fluent +public final class VirtualMachineScaleSetNetworkProfile { + /* + * A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + */ + @JsonProperty(value = "healthProbe") + private ApiEntityReference healthProbe; + + /* + * The list of network configurations. + */ + @JsonProperty(value = "networkInterfaceConfigurations") + private List networkInterfaceConfigurations; + + /* + * specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible' + */ + @JsonProperty(value = "networkApiVersion") + private NetworkApiVersion networkApiVersion; + + /** + * Creates an instance of VirtualMachineScaleSetNetworkProfile class. + */ + public VirtualMachineScaleSetNetworkProfile() { + } + + /** + * Get the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in + * the virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @return the healthProbe value. + */ + public ApiEntityReference healthProbe() { + return this.healthProbe; + } + + /** + * Set the healthProbe property: A reference to a load balancer probe used to determine the health of an instance in + * the virtual machine scale set. The reference will be in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + * + * @param healthProbe the healthProbe value to set. + * @return the VirtualMachineScaleSetNetworkProfile object itself. + */ + public VirtualMachineScaleSetNetworkProfile withHealthProbe(ApiEntityReference healthProbe) { + this.healthProbe = healthProbe; + return this; + } + + /** + * Get the networkInterfaceConfigurations property: The list of network configurations. + * + * @return the networkInterfaceConfigurations value. + */ + public List networkInterfaceConfigurations() { + return this.networkInterfaceConfigurations; + } + + /** + * Set the networkInterfaceConfigurations property: The list of network configurations. + * + * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. + * @return the VirtualMachineScaleSetNetworkProfile object itself. + */ + public VirtualMachineScaleSetNetworkProfile withNetworkInterfaceConfigurations( + List networkInterfaceConfigurations) { + this.networkInterfaceConfigurations = networkInterfaceConfigurations; + return this; + } + + /** + * Get the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode + * 'Flexible'. + * + * @return the networkApiVersion value. + */ + public NetworkApiVersion networkApiVersion() { + return this.networkApiVersion; + } + + /** + * Set the networkApiVersion property: specifies the Microsoft.Network API version used when creating networking + * resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode + * 'Flexible'. + * + * @param networkApiVersion the networkApiVersion value to set. + * @return the VirtualMachineScaleSetNetworkProfile object itself. + */ + public VirtualMachineScaleSetNetworkProfile withNetworkApiVersion(NetworkApiVersion networkApiVersion) { + this.networkApiVersion = networkApiVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (healthProbe() != null) { + healthProbe().validate(); + } + if (networkInterfaceConfigurations() != null) { + networkInterfaceConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetOSDisk.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetOSDisk.java new file mode 100644 index 000000000000..dc0fb2e81720 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetOSDisk.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machine scale set operating system disk. + */ +@Fluent +public final class VirtualMachineScaleSetOSDisk { + /* + * The disk name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.** + */ + @JsonProperty(value = "caching") + private CachingTypes caching; + + /* + * Specifies whether writeAccelerator should be enabled or disabled on the disk. + */ + @JsonProperty(value = "writeAcceleratorEnabled") + private Boolean writeAcceleratorEnabled; + + /* + * Specifies how the virtual machines in the scale set should be created. The only allowed value is: **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. + */ + @JsonProperty(value = "createOption", required = true) + private DiskCreateOptionTypes createOption; + + /* + * Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. + */ + @JsonProperty(value = "diffDiskSettings") + private DiffDiskSettings diffDiskSettings; + + /* + * Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023. + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /* + * This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.** + */ + @JsonProperty(value = "osType") + private OperatingSystemTypes osType; + + /* + * Specifies information about the unmanaged user image to base the scale set on. + */ + @JsonProperty(value = "image") + private VirtualHardDisk image; + + /* + * Specifies the container urls that are used to store operating system disks for the scale set. + */ + @JsonProperty(value = "vhdContainers") + private List vhdContainers; + + /* + * The managed disk parameters. + */ + @JsonProperty(value = "managedDisk") + private VirtualMachineScaleSetManagedDiskParameters managedDisk; + + /* + * Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with Flexible OrchestrationMode only).

Possible values:

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

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

The default value is set to **Delete**. For an Ephemeral OS Disk, the default value is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. + */ + @JsonProperty(value = "deleteOption") + private DiskDeleteOptionTypes deleteOption; + + /** + * Creates an instance of VirtualMachineScaleSetOSDisk class. + */ + public VirtualMachineScaleSetOSDisk() { + } + + /** + * Get the name property: The disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The disk name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withName(String name) { + this.name = name; + return this; + } + + /** + * Get the caching property: Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.**. + * + * @return the caching value. + */ + public CachingTypes caching() { + return this.caching; + } + + /** + * Set the caching property: Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** + * **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.**. + * + * @param caching the caching value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withCaching(CachingTypes caching) { + this.caching = caching; + return this; + } + + /** + * Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @return the writeAcceleratorEnabled value. + */ + public Boolean writeAcceleratorEnabled() { + return this.writeAcceleratorEnabled; + } + + /** + * Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the + * disk. + * + * @param writeAcceleratorEnabled the writeAcceleratorEnabled value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled) { + this.writeAcceleratorEnabled = writeAcceleratorEnabled; + return this; + } + + /** + * Get the createOption property: Specifies how the virtual machines in the scale set should be created. The only + * allowed value is: **FromImage.** This value is used when you are using an image to create the virtual machine. If + * you are using a platform image, you also use the imageReference element described above. If you are using a + * marketplace image, you also use the plan element previously described. + * + * @return the createOption value. + */ + public DiskCreateOptionTypes createOption() { + return this.createOption; + } + + /** + * Set the createOption property: Specifies how the virtual machines in the scale set should be created. The only + * allowed value is: **FromImage.** This value is used when you are using an image to create the virtual machine. If + * you are using a platform image, you also use the imageReference element described above. If you are using a + * marketplace image, you also use the plan element previously described. + * + * @param createOption the createOption value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withCreateOption(DiskCreateOptionTypes createOption) { + this.createOption = createOption; + return this; + } + + /** + * Get the diffDiskSettings property: Specifies the ephemeral disk Settings for the operating system disk used by + * the virtual machine scale set. + * + * @return the diffDiskSettings value. + */ + public DiffDiskSettings diffDiskSettings() { + return this.diffDiskSettings; + } + + /** + * Set the diffDiskSettings property: Specifies the ephemeral disk Settings for the operating system disk used by + * the virtual machine scale set. + * + * @param diffDiskSettings the diffDiskSettings value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withDiffDiskSettings(DiffDiskSettings diffDiskSettings) { + this.diffDiskSettings = diffDiskSettings; + return this; + } + + /** + * Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. This element can be used to + * overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x + * 1024^3 for the disk and the value cannot be larger than 1023. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the osType property: This property allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**. + * + * @return the osType value. + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the osType property: This property allows you to specify the type of the OS that is included in the disk if + * creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**. + * + * @param osType the osType value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the image property: Specifies information about the unmanaged user image to base the scale set on. + * + * @return the image value. + */ + public VirtualHardDisk image() { + return this.image; + } + + /** + * Set the image property: Specifies information about the unmanaged user image to base the scale set on. + * + * @param image the image value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withImage(VirtualHardDisk image) { + this.image = image; + return this; + } + + /** + * Get the vhdContainers property: Specifies the container urls that are used to store operating system disks for + * the scale set. + * + * @return the vhdContainers value. + */ + public List vhdContainers() { + return this.vhdContainers; + } + + /** + * Set the vhdContainers property: Specifies the container urls that are used to store operating system disks for + * the scale set. + * + * @param vhdContainers the vhdContainers value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withVhdContainers(List vhdContainers) { + this.vhdContainers = vhdContainers; + return this; + } + + /** + * Get the managedDisk property: The managed disk parameters. + * + * @return the managedDisk value. + */ + public VirtualMachineScaleSetManagedDiskParameters managedDisk() { + return this.managedDisk; + } + + /** + * Set the managedDisk property: The managed disk parameters. + * + * @param managedDisk the managedDisk value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withManagedDisk(VirtualMachineScaleSetManagedDiskParameters managedDisk) { + this.managedDisk = managedDisk; + return this; + } + + /** + * Get the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion + * (This feature is available for VMSS with Flexible OrchestrationMode only). <br><br> Possible values: + * <br><br> **Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is + * deleted.<br><br> **Detach** If this value is used, the OS disk is retained after VMSS Flex VM is + * deleted. <br><br> The default value is set to **Delete**. For an Ephemeral OS Disk, the default value + * is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. + * + * @return the deleteOption value. + */ + public DiskDeleteOptionTypes deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion + * (This feature is available for VMSS with Flexible OrchestrationMode only). <br><br> Possible values: + * <br><br> **Delete** If this value is used, the OS disk is deleted when VMSS Flex VM is + * deleted.<br><br> **Detach** If this value is used, the OS disk is retained after VMSS Flex VM is + * deleted. <br><br> The default value is set to **Delete**. For an Ephemeral OS Disk, the default value + * is set to **Delete**. User cannot change the delete option for Ephemeral OS Disk. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetOSDisk object itself. + */ + public VirtualMachineScaleSetOSDisk withDeleteOption(DiskDeleteOptionTypes deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (createOption() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property createOption in model VirtualMachineScaleSetOSDisk")); + } + if (diffDiskSettings() != null) { + diffDiskSettings().validate(); + } + if (image() != null) { + image().validate(); + } + if (managedDisk() != null) { + managedDisk().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineScaleSetOSDisk.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetOSProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetOSProfile.java new file mode 100644 index 000000000000..1a2dca2187b9 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetOSProfile.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machine scale set OS profile. + */ +@Fluent +public final class VirtualMachineScaleSetOSProfile { + /* + * Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long. + */ + @JsonProperty(value = "computerNamePrefix") + private String computerNamePrefix; + + /* + * Specifies the name of the administrator account.

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

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

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

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

**Max-length (Windows):** 20 characters + */ + @JsonProperty(value = "adminUsername") + private String adminUsername; + + /* + * Specifies the password of the administrator account.

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

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

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

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

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

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

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

For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + */ + @JsonProperty(value = "adminPassword") + private String adminPassword; + + /* + * Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + */ + @JsonProperty(value = "customData") + private String customData; + + /* + * Specifies Windows operating system settings on the virtual machine. + */ + @JsonProperty(value = "windowsConfiguration") + private WindowsConfiguration windowsConfiguration; + + /* + * Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + */ + @JsonProperty(value = "linuxConfiguration") + private LinuxConfiguration linuxConfiguration; + + /* + * Specifies set of certificates that should be installed onto the virtual machines in the scale set. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + */ + @JsonProperty(value = "secrets") + private List secrets; + + /* + * Specifies whether extension operations should be allowed on the virtual machine scale set. This may only be set to False when no extensions are present on the virtual machine scale set. + */ + @JsonProperty(value = "allowExtensionOperations") + private Boolean allowExtensionOperations; + + /* + * Optional property which must either be set to True or omitted. + */ + @JsonProperty(value = "requireGuestProvisionSignal") + private Boolean requireGuestProvisionSignal; + + /** + * Creates an instance of VirtualMachineScaleSetOSProfile class. + */ + public VirtualMachineScaleSetOSProfile() { + } + + /** + * Get the computerNamePrefix property: Specifies the computer name prefix for all of the virtual machines in the + * scale set. Computer name prefixes must be 1 to 15 characters long. + * + * @return the computerNamePrefix value. + */ + public String computerNamePrefix() { + return this.computerNamePrefix; + } + + /** + * Set the computerNamePrefix property: Specifies the computer name prefix for all of the virtual machines in the + * scale set. Computer name prefixes must be 1 to 15 characters long. + * + * @param computerNamePrefix the computerNamePrefix value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withComputerNamePrefix(String computerNamePrefix) { + this.computerNamePrefix = computerNamePrefix; + return this; + } + + /** + * Get the adminUsername property: Specifies the name of the administrator account. <br><br> + * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", + * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 + * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length + * (Windows):** 20 characters. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: Specifies the name of the administrator account. <br><br> + * **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", + * "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + * "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", + * "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 + * character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length + * (Windows):** 20 characters. + * + * @param adminUsername the adminUsername value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", + * "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its + * login password in a Windows VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) + * <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure + * Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", + * "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its + * login password in a Windows VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) + * <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure + * Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @param adminPassword the adminPassword value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array + * is 65535 bytes. For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @return the customData value. + */ + public String customData() { + return this.customData; + } + + /** + * Set the customData property: Specifies a base-64 encoded string of custom data. The base-64 encoded string is + * decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array + * is 65535 bytes. For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during + * creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init). + * + * @param customData the customData value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withCustomData(String customData) { + this.customData = customData; + return this; + } + + /** + * Get the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. + * + * @return the windowsConfiguration value. + */ + public WindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set the windowsConfiguration property: Specifies Windows operating system settings on the virtual machine. + * + * @param windowsConfiguration the windowsConfiguration value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withWindowsConfiguration(WindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Get the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + * + * @return the linuxConfiguration value. + */ + public LinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: Specifies the Linux operating system settings on the virtual machine. For a + * list of supported Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withLinuxConfiguration(LinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + + /** + * Get the secrets property: Specifies set of certificates that should be installed onto the virtual machines in the + * scale set. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual + * machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the + * [Azure Key Vault virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Specifies set of certificates that should be installed onto the virtual machines in the + * scale set. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual + * machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the + * [Azure Key Vault virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @param secrets the secrets value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the allowExtensionOperations property: Specifies whether extension operations should be allowed on the + * virtual machine scale set. This may only be set to False when no extensions are present on the virtual machine + * scale set. + * + * @return the allowExtensionOperations value. + */ + public Boolean allowExtensionOperations() { + return this.allowExtensionOperations; + } + + /** + * Set the allowExtensionOperations property: Specifies whether extension operations should be allowed on the + * virtual machine scale set. This may only be set to False when no extensions are present on the virtual machine + * scale set. + * + * @param allowExtensionOperations the allowExtensionOperations value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withAllowExtensionOperations(Boolean allowExtensionOperations) { + this.allowExtensionOperations = allowExtensionOperations; + return this; + } + + /** + * Get the requireGuestProvisionSignal property: Optional property which must either be set to True or omitted. + * + * @return the requireGuestProvisionSignal value. + */ + public Boolean requireGuestProvisionSignal() { + return this.requireGuestProvisionSignal; + } + + /** + * Set the requireGuestProvisionSignal property: Optional property which must either be set to True or omitted. + * + * @param requireGuestProvisionSignal the requireGuestProvisionSignal value to set. + * @return the VirtualMachineScaleSetOSProfile object itself. + */ + public VirtualMachineScaleSetOSProfile withRequireGuestProvisionSignal(Boolean requireGuestProvisionSignal) { + this.requireGuestProvisionSignal = requireGuestProvisionSignal; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (windowsConfiguration() != null) { + windowsConfiguration().validate(); + } + if (linuxConfiguration() != null) { + linuxConfiguration().validate(); + } + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java new file mode 100644 index 000000000000..f5ab112ed396 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetPublicIpAddressConfiguration.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetPublicIpAddressConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration. + */ +@Fluent +public final class VirtualMachineScaleSetPublicIpAddressConfiguration { + /* + * The publicIP address configuration name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration + */ + @JsonProperty(value = "properties") + private VirtualMachineScaleSetPublicIpAddressConfigurationProperties innerProperties; + + /* + * Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + */ + @JsonProperty(value = "sku") + private PublicIpAddressSku sku; + + /** + * Creates an instance of VirtualMachineScaleSetPublicIpAddressConfiguration class. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration() { + } + + /** + * Get the name property: The publicIP address configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The publicIP address configuration name. + * + * @param name the name value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Describes a virtual machines scale set IP Configuration's PublicIPAddress + * configuration. + * + * @return the innerProperties value. + */ + private VirtualMachineScaleSetPublicIpAddressConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + * + * @return the sku value. + */ + public PublicIpAddressSku sku() { + return this.sku; + } + + /** + * Set the sku property: Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. + * + * @param sku the sku value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withSku(PublicIpAddressSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().idleTimeoutInMinutes(); + } + + /** + * Set the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + /** + * Get the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @return the dnsSettings value. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); + } + + /** + * Set the dnsSettings property: The dns settings to be applied on the publicIP addresses . + * + * @param dnsSettings the dnsSettings value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration + withDnsSettings(VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings dnsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withDnsSettings(dnsSettings); + return this; + } + + /** + * Get the ipTags property: The list of IP tags associated with the public IP address. + * + * @return the ipTags value. + */ + public List ipTags() { + return this.innerProperties() == null ? null : this.innerProperties().ipTags(); + } + + /** + * Set the ipTags property: The list of IP tags associated with the public IP address. + * + * @param ipTags the ipTags value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withIpTags(List ipTags) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withIpTags(ipTags); + return this; + } + + /** + * Get the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @return the publicIpPrefix value. + */ + public SubResource publicIpPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpPrefix(); + } + + /** + * Set the publicIpPrefix property: The PublicIPPrefix from which to allocate publicIP addresses. + * + * @param publicIpPrefix the publicIpPrefix value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withPublicIpPrefix(SubResource publicIpPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withPublicIpPrefix(publicIpPrefix); + return this; + } + + /** + * Get the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @return the publicIpAddressVersion value. + */ + public IpVersion publicIpAddressVersion() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddressVersion(); + } + + /** + * Set the publicIpAddressVersion property: Available from Api-Version 2019-07-01 onwards, it represents whether the + * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + * + * @param publicIpAddressVersion the publicIpAddressVersion value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration + withPublicIpAddressVersion(IpVersion publicIpAddressVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withPublicIpAddressVersion(publicIpAddressVersion); + return this; + } + + /** + * Get the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @return the deleteOption value. + */ + public DeleteOptions deleteOption() { + return this.innerProperties() == null ? null : this.innerProperties().deleteOption(); + } + + /** + * Set the deleteOption property: Specify what happens to the public IP when the VM is deleted. + * + * @param deleteOption the deleteOption value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfiguration object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfiguration withDeleteOption(DeleteOptions deleteOption) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineScaleSetPublicIpAddressConfigurationProperties(); + } + this.innerProperties().withDeleteOption(deleteOption); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model VirtualMachineScaleSetPublicIpAddressConfiguration")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(VirtualMachineScaleSetPublicIpAddressConfiguration.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java new file mode 100644 index 000000000000..c3d29032724b --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a virtual machines scale sets network configuration's DNS settings. + */ +@Fluent +public final class VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings { + /* + * The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created + */ + @JsonProperty(value = "domainNameLabel", required = true) + private String domainNameLabel; + + /* + * The Domain name label scope.The concatenation of the hashed domain name label that generated according to the policy from domain name label scope and vm index will be the domain name labels of the PublicIPAddress resources that will be created + */ + @JsonProperty(value = "domainNameLabelScope") + private DomainNameLabelScopeTypes domainNameLabelScope; + + /** + * Creates an instance of VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings class. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings() { + } + + /** + * Get the domainNameLabel property: The Domain name label.The concatenation of the domain name label and vm index + * will be the domain name labels of the PublicIPAddress resources that will be created. + * + * @return the domainNameLabel value. + */ + public String domainNameLabel() { + return this.domainNameLabel; + } + + /** + * Set the domainNameLabel property: The Domain name label.The concatenation of the domain name label and vm index + * will be the domain name labels of the PublicIPAddress resources that will be created. + * + * @param domainNameLabel the domainNameLabel value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings withDomainNameLabel(String domainNameLabel) { + this.domainNameLabel = domainNameLabel; + return this; + } + + /** + * Get the domainNameLabelScope property: The Domain name label scope.The concatenation of the hashed domain name + * label that generated according to the policy from domain name label scope and vm index will be the domain name + * labels of the PublicIPAddress resources that will be created. + * + * @return the domainNameLabelScope value. + */ + public DomainNameLabelScopeTypes domainNameLabelScope() { + return this.domainNameLabelScope; + } + + /** + * Set the domainNameLabelScope property: The Domain name label scope.The concatenation of the hashed domain name + * label that generated according to the policy from domain name label scope and vm index will be the domain name + * labels of the PublicIPAddress resources that will be created. + * + * @param domainNameLabelScope the domainNameLabelScope value to set. + * @return the VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings object itself. + */ + public VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings + withDomainNameLabelScope(DomainNameLabelScopeTypes domainNameLabelScope) { + this.domainNameLabelScope = domainNameLabelScope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domainNameLabel() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property domainNameLabel in model VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings")); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetStorageProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetStorageProfile.java new file mode 100644 index 000000000000..fdbbff780d0a --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetStorageProfile.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes a virtual machine scale set storage profile. + */ +@Fluent +public final class VirtualMachineScaleSetStorageProfile { + /* + * Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. + */ + @JsonProperty(value = "imageReference") + private ImageReference imageReference; + + /* + * Specifies information about the operating system disk used by the virtual machines in the scale set. For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "osDisk") + private VirtualMachineScaleSetOSDisk osDisk; + + /* + * Specifies the parameters that are used to add data disks to the virtual machines in the scale set. For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /* + * The diskControllerType property. + */ + @JsonProperty(value = "diskControllerType") + private String diskControllerType; + + /** + * Creates an instance of VirtualMachineScaleSetStorageProfile class. + */ + public VirtualMachineScaleSetStorageProfile() { + } + + /** + * Get the imageReference property: Specifies information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element is required when you want to use a + * platform image, marketplace image, or virtual machine image, but is not used in other creation operations. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: Specifies information about the image to use. You can specify information about + * platform images, marketplace images, or virtual machine images. This element is required when you want to use a + * platform image, marketplace image, or virtual machine image, but is not used in other creation operations. + * + * @param imageReference the imageReference value to set. + * @return the VirtualMachineScaleSetStorageProfile object itself. + */ + public VirtualMachineScaleSetStorageProfile withImageReference(ImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the osDisk property: Specifies information about the operating system disk used by the virtual machines in + * the scale set. For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the osDisk value. + */ + public VirtualMachineScaleSetOSDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: Specifies information about the operating system disk used by the virtual machines in + * the scale set. For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param osDisk the osDisk value to set. + * @return the VirtualMachineScaleSetStorageProfile object itself. + */ + public VirtualMachineScaleSetStorageProfile withOsDisk(VirtualMachineScaleSetOSDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: Specifies the parameters that are used to add data disks to the virtual machines in + * the scale set. For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: Specifies the parameters that are used to add data disks to the virtual machines in + * the scale set. For more information about disks, see [About disks and VHDs for Azure virtual + * machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + * + * @param dataDisks the dataDisks value to set. + * @return the VirtualMachineScaleSetStorageProfile object itself. + */ + public VirtualMachineScaleSetStorageProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Get the diskControllerType property: The diskControllerType property. + * + * @return the diskControllerType value. + */ + public String diskControllerType() { + return this.diskControllerType; + } + + /** + * Set the diskControllerType property: The diskControllerType property. + * + * @param diskControllerType the diskControllerType value to set. + * @return the VirtualMachineScaleSetStorageProfile object itself. + */ + public VirtualMachineScaleSetStorageProfile withDiskControllerType(String diskControllerType) { + this.diskControllerType = diskControllerType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageReference() != null) { + imageReference().validate(); + } + if (osDisk() != null) { + osDisk().validate(); + } + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetVMProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetVMProfile.java new file mode 100644 index 000000000000..1b1f5471a6f3 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSetVMProfile.java @@ -0,0 +1,578 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Describes a virtual machine scale set virtual machine profile. + */ +@Fluent +public final class VirtualMachineScaleSetVMProfile { + /* + * Specifies the operating system settings for the virtual machines in the scale set. + */ + @JsonProperty(value = "osProfile") + private VirtualMachineScaleSetOSProfile osProfile; + + /* + * Specifies the storage settings for the virtual machine disks. + */ + @JsonProperty(value = "storageProfile") + private VirtualMachineScaleSetStorageProfile storageProfile; + + /* + * Specifies properties of the network interfaces of the virtual machines in the scale set. + */ + @JsonProperty(value = "networkProfile") + private VirtualMachineScaleSetNetworkProfile networkProfile; + + /* + * Specifies the Security related profile settings for the virtual machines in the scale set. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /* + * Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. + */ + @JsonProperty(value = "diagnosticsProfile") + private DiagnosticsProfile diagnosticsProfile; + + /* + * Specifies a collection of settings for extensions installed on virtual machines in the scale set. + */ + @JsonProperty(value = "extensionProfile") + private VirtualMachineScaleSetExtensionProfile extensionProfile; + + /* + * Specifies that the image or disk that is being used was licensed on-premises.

Possible values for Windows Server operating system are:

Windows_Client

Windows_Server

Possible values for Linux Server operating system are:

RHEL_BYOS (for RHEL)

SLES_BYOS (for SUSE)

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

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

Minimum api-version: 2015-06-15 + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /* + * Specifies the priority for the virtual machines in the scale set. Minimum api-version: 2017-10-30-preview. + */ + @JsonProperty(value = "priority") + private VirtualMachinePriorityTypes priority; + + /* + * Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. + */ + @JsonProperty(value = "evictionPolicy") + private VirtualMachineEvictionPolicyTypes evictionPolicy; + + /* + * Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. + */ + @JsonProperty(value = "billingProfile") + private BillingProfile billingProfile; + + /* + * Specifies Scheduled Event related configurations. + */ + @JsonProperty(value = "scheduledEventsProfile") + private ScheduledEventsProfile scheduledEventsProfile; + + /* + * UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. + */ + @JsonProperty(value = "userData") + private String userData; + + /* + * Specifies the capacity reservation related details of a scale set. Minimum api-version: 2021-04-01. + */ + @JsonProperty(value = "capacityReservation") + private CapacityReservationProfile capacityReservation; + + /* + * Specifies the gallery applications that should be made available to the VM/VMSS + */ + @JsonProperty(value = "applicationProfile") + private ApplicationProfile applicationProfile; + + /* + * Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. + */ + @JsonProperty(value = "hardwareProfile") + private VirtualMachineScaleSetHardwareProfile hardwareProfile; + + /* + * Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01 + */ + @JsonProperty(value = "serviceArtifactReference") + private ServiceArtifactReference serviceArtifactReference; + + /* + * Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01 + */ + @JsonProperty(value = "securityPostureReference") + private SecurityPostureReference securityPostureReference; + + /* + * Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. Minimum API version for this property is 2023-09-01. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile with minimum api-version 2023-09-01. + */ + @JsonProperty(value = "timeCreated", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timeCreated; + + /** + * Creates an instance of VirtualMachineScaleSetVMProfile class. + */ + public VirtualMachineScaleSetVMProfile() { + } + + /** + * Get the osProfile property: Specifies the operating system settings for the virtual machines in the scale set. + * + * @return the osProfile value. + */ + public VirtualMachineScaleSetOSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings for the virtual machines in the scale set. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withOsProfile(VirtualMachineScaleSetOSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @return the storageProfile value. + */ + public VirtualMachineScaleSetStorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Specifies the storage settings for the virtual machine disks. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withStorageProfile(VirtualMachineScaleSetStorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the networkProfile property: Specifies properties of the network interfaces of the virtual machines in the + * scale set. + * + * @return the networkProfile value. + */ + public VirtualMachineScaleSetNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Specifies properties of the network interfaces of the virtual machines in the + * scale set. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withNetworkProfile(VirtualMachineScaleSetNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the securityProfile property: Specifies the Security related profile settings for the virtual machines in the + * scale set. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Specifies the Security related profile settings for the virtual machines in the + * scale set. + * + * @param securityProfile the securityProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the diagnosticsProfile property: Specifies the boot diagnostic settings state. Minimum api-version: + * 2015-06-15. + * + * @return the diagnosticsProfile value. + */ + public DiagnosticsProfile diagnosticsProfile() { + return this.diagnosticsProfile; + } + + /** + * Set the diagnosticsProfile property: Specifies the boot diagnostic settings state. Minimum api-version: + * 2015-06-15. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withDiagnosticsProfile(DiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + + /** + * Get the extensionProfile property: Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @return the extensionProfile value. + */ + public VirtualMachineScaleSetExtensionProfile extensionProfile() { + return this.extensionProfile; + } + + /** + * Set the extensionProfile property: Specifies a collection of settings for extensions installed on virtual + * machines in the scale set. + * + * @param extensionProfile the extensionProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile + withExtensionProfile(VirtualMachineScaleSetExtensionProfile extensionProfile) { + this.extensionProfile = extensionProfile; + return this; + } + + /** + * Get the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @return the licenseType value. + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: Specifies that the image or disk that is being used was licensed on-premises. + * <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client + * <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: + * <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more + * information, see [Azure Hybrid Use Benefit for Windows + * Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + * <br><br> [Azure Hybrid Use Benefit for Linux + * Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> + * Minimum api-version: 2015-06-15. + * + * @param licenseType the licenseType value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the priority property: Specifies the priority for the virtual machines in the scale set. Minimum api-version: + * 2017-10-30-preview. + * + * @return the priority value. + */ + public VirtualMachinePriorityTypes priority() { + return this.priority; + } + + /** + * Set the priority property: Specifies the priority for the virtual machines in the scale set. Minimum api-version: + * 2017-10-30-preview. + * + * @param priority the priority value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withPriority(VirtualMachinePriorityTypes priority) { + this.priority = priority; + return this; + } + + /** + * Get the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum + * api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the + * minimum api-version is 2017-10-30-preview. + * + * @return the evictionPolicy value. + */ + public VirtualMachineEvictionPolicyTypes evictionPolicy() { + return this.evictionPolicy; + } + + /** + * Set the evictionPolicy property: Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot + * scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum + * api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the + * minimum api-version is 2017-10-30-preview. + * + * @param evictionPolicy the evictionPolicy value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withEvictionPolicy(VirtualMachineEvictionPolicyTypes evictionPolicy) { + this.evictionPolicy = evictionPolicy; + return this; + } + + /** + * Get the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: + * 2019-03-01. + * + * @return the billingProfile value. + */ + public BillingProfile billingProfile() { + return this.billingProfile; + } + + /** + * Set the billingProfile property: Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: + * 2019-03-01. + * + * @param billingProfile the billingProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withBillingProfile(BillingProfile billingProfile) { + this.billingProfile = billingProfile; + return this; + } + + /** + * Get the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @return the scheduledEventsProfile value. + */ + public ScheduledEventsProfile scheduledEventsProfile() { + return this.scheduledEventsProfile; + } + + /** + * Set the scheduledEventsProfile property: Specifies Scheduled Event related configurations. + * + * @param scheduledEventsProfile the scheduledEventsProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withScheduledEventsProfile(ScheduledEventsProfile scheduledEventsProfile) { + this.scheduledEventsProfile = scheduledEventsProfile; + return this; + } + + /** + * Get the userData property: UserData for the virtual machines in the scale set, which must be base-64 encoded. + * Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: UserData for the virtual machines in the scale set, which must be base-64 encoded. + * Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. + * + * @param userData the userData value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the capacityReservation property: Specifies the capacity reservation related details of a scale set. Minimum + * api-version: 2021-04-01. + * + * @return the capacityReservation value. + */ + public CapacityReservationProfile capacityReservation() { + return this.capacityReservation; + } + + /** + * Set the capacityReservation property: Specifies the capacity reservation related details of a scale set. Minimum + * api-version: 2021-04-01. + * + * @param capacityReservation the capacityReservation value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withCapacityReservation(CapacityReservationProfile capacityReservation) { + this.capacityReservation = capacityReservation; + return this; + } + + /** + * Get the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @return the applicationProfile value. + */ + public ApplicationProfile applicationProfile() { + return this.applicationProfile; + } + + /** + * Set the applicationProfile property: Specifies the gallery applications that should be made available to the + * VM/VMSS. + * + * @param applicationProfile the applicationProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withApplicationProfile(ApplicationProfile applicationProfile) { + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get the hardwareProfile property: Specifies the hardware profile related details of a scale set. Minimum + * api-version: 2021-11-01. + * + * @return the hardwareProfile value. + */ + public VirtualMachineScaleSetHardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: Specifies the hardware profile related details of a scale set. Minimum + * api-version: 2021-11-01. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile withHardwareProfile(VirtualMachineScaleSetHardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the serviceArtifactReference property: Specifies the service artifact reference id used to set same image + * version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: + * 2022-11-01. + * + * @return the serviceArtifactReference value. + */ + public ServiceArtifactReference serviceArtifactReference() { + return this.serviceArtifactReference; + } + + /** + * Set the serviceArtifactReference property: Specifies the service artifact reference id used to set same image + * version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: + * 2022-11-01. + * + * @param serviceArtifactReference the serviceArtifactReference value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile + withServiceArtifactReference(ServiceArtifactReference serviceArtifactReference) { + this.serviceArtifactReference = serviceArtifactReference; + return this; + } + + /** + * Get the securityPostureReference property: Specifies the security posture to be used for all virtual machines in + * the scale set. Minimum api-version: 2023-03-01. + * + * @return the securityPostureReference value. + */ + public SecurityPostureReference securityPostureReference() { + return this.securityPostureReference; + } + + /** + * Set the securityPostureReference property: Specifies the security posture to be used for all virtual machines in + * the scale set. Minimum api-version: 2023-03-01. + * + * @param securityPostureReference the securityPostureReference value to set. + * @return the VirtualMachineScaleSetVMProfile object itself. + */ + public VirtualMachineScaleSetVMProfile + withSecurityPostureReference(SecurityPostureReference securityPostureReference) { + this.securityPostureReference = securityPostureReference; + return this; + } + + /** + * Get the timeCreated property: Specifies the time in which this VM profile for the Virtual Machine Scale Set was + * created. Minimum API version for this property is 2023-09-01. This value will be added to VMSS Flex VM tags when + * creating/updating the VMSS VM Profile with minimum api-version 2023-09-01. + * + * @return the timeCreated value. + */ + public OffsetDateTime timeCreated() { + return this.timeCreated; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osProfile() != null) { + osProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + if (extensionProfile() != null) { + extensionProfile().validate(); + } + if (billingProfile() != null) { + billingProfile().validate(); + } + if (scheduledEventsProfile() != null) { + scheduledEventsProfile().validate(); + } + if (capacityReservation() != null) { + capacityReservation().validate(); + } + if (applicationProfile() != null) { + applicationProfile().validate(); + } + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (serviceArtifactReference() != null) { + serviceArtifactReference().validate(); + } + if (securityPostureReference() != null) { + securityPostureReference().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSets.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSets.java new file mode 100644 index 000000000000..29a8c36e22fb --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VirtualMachineScaleSets.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of VirtualMachineScaleSets. + */ +public interface VirtualMachineScaleSets { + /** + * List VirtualMachineScaleSet resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Fleet. + * @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 response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFleet(String resourceGroupName, String name); + + /** + * List VirtualMachineScaleSet resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Fleet. + * @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 response of a VirtualMachineScaleSet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFleet(String resourceGroupName, String name, Context context); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VmSizeProfile.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VmSizeProfile.java new file mode 100644 index 000000000000..f927ba6872af --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/VmSizeProfile.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications about a VM Size. This will also contain the corresponding rank and weight in future. + */ +@Fluent +public final class VmSizeProfile { + /* + * The Sku name (e.g. 'Standard_DS1_v2') + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The rank of the VM size. This is used with 'RegularPriorityAllocationStrategy.Prioritized' + * The lower the number, the higher the priority. Starting with 0. + */ + @JsonProperty(value = "rank") + private Integer rank; + + /** + * Creates an instance of VmSizeProfile class. + */ + public VmSizeProfile() { + } + + /** + * Get the name property: The Sku name (e.g. 'Standard_DS1_v2'). + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The Sku name (e.g. 'Standard_DS1_v2'). + * + * @param name the name value to set. + * @return the VmSizeProfile object itself. + */ + public VmSizeProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the rank property: The rank of the VM size. This is used with 'RegularPriorityAllocationStrategy.Prioritized' + * The lower the number, the higher the priority. Starting with 0. + * + * @return the rank value. + */ + public Integer rank() { + return this.rank; + } + + /** + * Set the rank property: The rank of the VM size. This is used with 'RegularPriorityAllocationStrategy.Prioritized' + * The lower the number, the higher the priority. Starting with 0. + * + * @param rank the rank value to set. + * @return the VmSizeProfile object itself. + */ + public VmSizeProfile withRank(Integer rank) { + this.rank = rank; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model VmSizeProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VmSizeProfile.class); +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WinRMConfiguration.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WinRMConfiguration.java new file mode 100644 index 000000000000..09af5103daa0 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WinRMConfiguration.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Describes Windows Remote Management configuration of the VM. + */ +@Fluent +public final class WinRMConfiguration { + /* + * The list of Windows Remote Management listeners + */ + @JsonProperty(value = "listeners") + private List listeners; + + /** + * Creates an instance of WinRMConfiguration class. + */ + public WinRMConfiguration() { + } + + /** + * Get the listeners property: The list of Windows Remote Management listeners. + * + * @return the listeners value. + */ + public List listeners() { + return this.listeners; + } + + /** + * Set the listeners property: The list of Windows Remote Management listeners. + * + * @param listeners the listeners value to set. + * @return the WinRMConfiguration object itself. + */ + public WinRMConfiguration withListeners(List listeners) { + this.listeners = listeners; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (listeners() != null) { + listeners().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WinRMListener.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WinRMListener.java new file mode 100644 index 000000000000..c006746edb6d --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WinRMListener.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes Protocol and thumbprint of Windows Remote Management listener. + */ +@Fluent +public final class WinRMListener { + /* + * Specifies the protocol of WinRM listener. Possible values are: **http,** **https.** + */ + @JsonProperty(value = "protocol") + private ProtocolTypes protocol; + + /* + * This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be the Base64 encoding of the following JSON Object which is encoded in UTF-8:

{
"data":"",
"dataType":"pfx",
"password":""
}
To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + */ + @JsonProperty(value = "certificateUrl") + private String certificateUrl; + + /** + * Creates an instance of WinRMListener class. + */ + public WinRMListener() { + } + + /** + * Get the protocol property: Specifies the protocol of WinRM listener. Possible values are: **http,** **https.**. + * + * @return the protocol value. + */ + public ProtocolTypes protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Specifies the protocol of WinRM listener. Possible values are: **http,** **https.**. + * + * @param protocol the protocol value to set. + * @return the WinRMListener object itself. + */ + public WinRMListener withProtocol(ProtocolTypes protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be the Base64 encoding of the following JSON Object which is encoded in UTF-8: <br><br> + * {<br> "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + * "password":"<pfx-file-password>"<br>} <br> To install certificates on a virtual machine it is + * recommended to use the [Azure Key Vault virtual machine extension for + * Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @return the certificateUrl value. + */ + public String certificateUrl() { + return this.certificateUrl; + } + + /** + * Set the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be the Base64 encoding of the following JSON Object which is encoded in UTF-8: <br><br> + * {<br> "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + * "password":"<pfx-file-password>"<br>} <br> To install certificates on a virtual machine it is + * recommended to use the [Azure Key Vault virtual machine extension for + * Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault + * virtual machine extension for + * Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + * + * @param certificateUrl the certificateUrl value to set. + * @return the WinRMListener object itself. + */ + public WinRMListener withCertificateUrl(String certificateUrl) { + this.certificateUrl = certificateUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsConfiguration.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsConfiguration.java new file mode 100644 index 000000000000..0c4353e6546d --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsConfiguration.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Specifies Windows operating system settings on the virtual machine. + */ +@Fluent +public final class WindowsConfiguration { + /* + * Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, it is set to true by default. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. + */ + @JsonProperty(value = "provisionVMAgent") + private Boolean provisionVMAgent; + + /* + * Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. + */ + @JsonProperty(value = "enableAutomaticUpdates") + private Boolean enableAutomaticUpdates; + + /* + * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /* + * Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. + */ + @JsonProperty(value = "additionalUnattendContent") + private List additionalUnattendContent; + + /* + * [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + */ + @JsonProperty(value = "patchSettings") + private PatchSettings patchSettings; + + /* + * Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. + */ + @JsonProperty(value = "winRM") + private WinRMConfiguration winRM; + + /* + * Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. + */ + @JsonProperty(value = "enableVMAgentPlatformUpdates") + private Boolean enableVMAgentPlatformUpdates; + + /** + * Creates an instance of WindowsConfiguration class. + */ + public WindowsConfiguration() { + } + + /** + * Get the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual + * machine. When this property is not specified in the request body, it is set to true by default. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to the VM later. + * + * @return the provisionVMAgent value. + */ + public Boolean provisionVMAgent() { + return this.provisionVMAgent; + } + + /** + * Set the provisionVMAgent property: Indicates whether virtual machine agent should be provisioned on the virtual + * machine. When this property is not specified in the request body, it is set to true by default. This will ensure + * that VM Agent is installed on the VM so that extensions can be added to the VM later. + * + * @param provisionVMAgent the provisionVMAgent value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withProvisionVMAgent(Boolean provisionVMAgent) { + this.provisionVMAgent = provisionVMAgent; + return this; + } + + /** + * Get the enableAutomaticUpdates property: Indicates whether Automatic Updates is enabled for the Windows virtual + * machine. Default value is true. For virtual machine scale sets, this property can be updated and updates will + * take effect on OS reprovisioning. + * + * @return the enableAutomaticUpdates value. + */ + public Boolean enableAutomaticUpdates() { + return this.enableAutomaticUpdates; + } + + /** + * Set the enableAutomaticUpdates property: Indicates whether Automatic Updates is enabled for the Windows virtual + * machine. Default value is true. For virtual machine scale sets, this property can be updated and updates will + * take effect on OS reprovisioning. + * + * @param enableAutomaticUpdates the enableAutomaticUpdates value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withEnableAutomaticUpdates(Boolean enableAutomaticUpdates) { + this.enableAutomaticUpdates = enableAutomaticUpdates; + return this; + } + + /** + * Get the timeZone property: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible + * values can be + * [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value + * from time zones returned by + * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible + * values can be + * [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value + * from time zones returned by + * [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + * + * @param timeZone the timeZone value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the additionalUnattendContent property: Specifies additional base-64 encoded XML formatted information that + * can be included in the Unattend.xml file, which is used by Windows Setup. + * + * @return the additionalUnattendContent value. + */ + public List additionalUnattendContent() { + return this.additionalUnattendContent; + } + + /** + * Set the additionalUnattendContent property: Specifies additional base-64 encoded XML formatted information that + * can be included in the Unattend.xml file, which is used by Windows Setup. + * + * @param additionalUnattendContent the additionalUnattendContent value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration + withAdditionalUnattendContent(List additionalUnattendContent) { + this.additionalUnattendContent = additionalUnattendContent; + return this; + } + + /** + * Get the patchSettings property: [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + * + * @return the patchSettings value. + */ + public PatchSettings patchSettings() { + return this.patchSettings; + } + + /** + * Set the patchSettings property: [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + * + * @param patchSettings the patchSettings value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withPatchSettings(PatchSettings patchSettings) { + this.patchSettings = patchSettings; + return this; + } + + /** + * Get the winRM property: Specifies the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @return the winRM value. + */ + public WinRMConfiguration winRM() { + return this.winRM; + } + + /** + * Set the winRM property: Specifies the Windows Remote Management listeners. This enables remote Windows + * PowerShell. + * + * @param winRM the winRM value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withWinRM(WinRMConfiguration winRM) { + this.winRM = winRM; + return this; + } + + /** + * Get the enableVMAgentPlatformUpdates property: Indicates whether VMAgent Platform Updates is enabled for the + * Windows virtual machine. Default value is false. + * + * @return the enableVMAgentPlatformUpdates value. + */ + public Boolean enableVMAgentPlatformUpdates() { + return this.enableVMAgentPlatformUpdates; + } + + /** + * Set the enableVMAgentPlatformUpdates property: Indicates whether VMAgent Platform Updates is enabled for the + * Windows virtual machine. Default value is false. + * + * @param enableVMAgentPlatformUpdates the enableVMAgentPlatformUpdates value to set. + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withEnableVMAgentPlatformUpdates(Boolean enableVMAgentPlatformUpdates) { + this.enableVMAgentPlatformUpdates = enableVMAgentPlatformUpdates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (additionalUnattendContent() != null) { + additionalUnattendContent().forEach(e -> e.validate()); + } + if (patchSettings() != null) { + patchSettings().validate(); + } + if (winRM() != null) { + winRM().validate(); + } + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsPatchAssessmentMode.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsPatchAssessmentMode.java new file mode 100644 index 000000000000..059c193211d4 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsPatchAssessmentMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.<br /><br /> Possible values + * are:<br /><br /> **ImageDefault** - You control the timing of patch assessments on a virtual + * machine.<br /><br /> **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The + * property provisionVMAgent must be true. + */ +public final class WindowsPatchAssessmentMode extends ExpandableStringEnum { + /** + * Static value ImageDefault for WindowsPatchAssessmentMode. + */ + public static final WindowsPatchAssessmentMode IMAGE_DEFAULT = fromString("ImageDefault"); + + /** + * Static value AutomaticByPlatform for WindowsPatchAssessmentMode. + */ + public static final WindowsPatchAssessmentMode AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates a new instance of WindowsPatchAssessmentMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WindowsPatchAssessmentMode() { + } + + /** + * Creates or finds a WindowsPatchAssessmentMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding WindowsPatchAssessmentMode. + */ + @JsonCreator + public static WindowsPatchAssessmentMode fromString(String name) { + return fromString(name, WindowsPatchAssessmentMode.class); + } + + /** + * Gets known WindowsPatchAssessmentMode values. + * + * @return known WindowsPatchAssessmentMode values. + */ + public static Collection values() { + return values(WindowsPatchAssessmentMode.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java new file mode 100644 index 000000000000..987755d5bf46 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsVMGuestPatchAutomaticByPlatformRebootSetting.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + */ +public final class WindowsVMGuestPatchAutomaticByPlatformRebootSetting + extends ExpandableStringEnum { + /** + * Static value Unknown for WindowsVMGuestPatchAutomaticByPlatformRebootSetting. + */ + public static final WindowsVMGuestPatchAutomaticByPlatformRebootSetting UNKNOWN = fromString("Unknown"); + + /** + * Static value IfRequired for WindowsVMGuestPatchAutomaticByPlatformRebootSetting. + */ + public static final WindowsVMGuestPatchAutomaticByPlatformRebootSetting IF_REQUIRED = fromString("IfRequired"); + + /** + * Static value Never for WindowsVMGuestPatchAutomaticByPlatformRebootSetting. + */ + public static final WindowsVMGuestPatchAutomaticByPlatformRebootSetting NEVER = fromString("Never"); + + /** + * Static value Always for WindowsVMGuestPatchAutomaticByPlatformRebootSetting. + */ + public static final WindowsVMGuestPatchAutomaticByPlatformRebootSetting ALWAYS = fromString("Always"); + + /** + * Creates a new instance of WindowsVMGuestPatchAutomaticByPlatformRebootSetting value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WindowsVMGuestPatchAutomaticByPlatformRebootSetting() { + } + + /** + * Creates or finds a WindowsVMGuestPatchAutomaticByPlatformRebootSetting from its string representation. + * + * @param name a name to look for. + * @return the corresponding WindowsVMGuestPatchAutomaticByPlatformRebootSetting. + */ + @JsonCreator + public static WindowsVMGuestPatchAutomaticByPlatformRebootSetting fromString(String name) { + return fromString(name, WindowsVMGuestPatchAutomaticByPlatformRebootSetting.class); + } + + /** + * Gets known WindowsVMGuestPatchAutomaticByPlatformRebootSetting values. + * + * @return known WindowsVMGuestPatchAutomaticByPlatformRebootSetting values. + */ + public static Collection values() { + return values(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java new file mode 100644 index 000000000000..ccdca4c72d3e --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Windows patch + * settings. + */ +@Fluent +public final class WindowsVMGuestPatchAutomaticByPlatformSettings { + /* + * Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + */ + @JsonProperty(value = "rebootSetting") + private WindowsVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting; + + /* + * Enables customer to schedule patching without accidental upgrades + */ + @JsonProperty(value = "bypassPlatformSafetyChecksOnUserSchedule") + private Boolean bypassPlatformSafetyChecksOnUserSchedule; + + /** + * Creates an instance of WindowsVMGuestPatchAutomaticByPlatformSettings class. + */ + public WindowsVMGuestPatchAutomaticByPlatformSettings() { + } + + /** + * Get the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * operations. + * + * @return the rebootSetting value. + */ + public WindowsVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting() { + return this.rebootSetting; + } + + /** + * Set the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * operations. + * + * @param rebootSetting the rebootSetting value to set. + * @return the WindowsVMGuestPatchAutomaticByPlatformSettings object itself. + */ + public WindowsVMGuestPatchAutomaticByPlatformSettings + withRebootSetting(WindowsVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting) { + this.rebootSetting = rebootSetting; + return this; + } + + /** + * Get the bypassPlatformSafetyChecksOnUserSchedule property: Enables customer to schedule patching without + * accidental upgrades. + * + * @return the bypassPlatformSafetyChecksOnUserSchedule value. + */ + public Boolean bypassPlatformSafetyChecksOnUserSchedule() { + return this.bypassPlatformSafetyChecksOnUserSchedule; + } + + /** + * Set the bypassPlatformSafetyChecksOnUserSchedule property: Enables customer to schedule patching without + * accidental upgrades. + * + * @param bypassPlatformSafetyChecksOnUserSchedule the bypassPlatformSafetyChecksOnUserSchedule value to set. + * @return the WindowsVMGuestPatchAutomaticByPlatformSettings object itself. + */ + public WindowsVMGuestPatchAutomaticByPlatformSettings + withBypassPlatformSafetyChecksOnUserSchedule(Boolean bypassPlatformSafetyChecksOnUserSchedule) { + this.bypassPlatformSafetyChecksOnUserSchedule = bypassPlatformSafetyChecksOnUserSchedule; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsVMGuestPatchMode.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsVMGuestPatchMode.java new file mode 100644 index 000000000000..704e6d6df598 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/WindowsVMGuestPatchMode.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine + * scale set with OrchestrationMode as Flexible.<br /><br /> Possible values are:<br /><br /> + * **Manual** - You control the application of patches to a virtual machine. You do this by applying patches manually + * inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates + * must be false<br /><br /> **AutomaticByOS** - The virtual machine will automatically be updated by the + * OS. The property WindowsConfiguration.enableAutomaticUpdates must be true. <br /><br /> + * **AutomaticByPlatform** - the virtual machine will automatically updated by the platform. The properties + * provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. + */ +public final class WindowsVMGuestPatchMode extends ExpandableStringEnum { + /** + * Static value Manual for WindowsVMGuestPatchMode. + */ + public static final WindowsVMGuestPatchMode MANUAL = fromString("Manual"); + + /** + * Static value AutomaticByOS for WindowsVMGuestPatchMode. + */ + public static final WindowsVMGuestPatchMode AUTOMATIC_BY_OS = fromString("AutomaticByOS"); + + /** + * Static value AutomaticByPlatform for WindowsVMGuestPatchMode. + */ + public static final WindowsVMGuestPatchMode AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates a new instance of WindowsVMGuestPatchMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WindowsVMGuestPatchMode() { + } + + /** + * Creates or finds a WindowsVMGuestPatchMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding WindowsVMGuestPatchMode. + */ + @JsonCreator + public static WindowsVMGuestPatchMode fromString(String name) { + return fromString(name, WindowsVMGuestPatchMode.class); + } + + /** + * Gets known WindowsVMGuestPatchMode values. + * + * @return known WindowsVMGuestPatchMode values. + */ + public static Collection values() { + return values(WindowsVMGuestPatchMode.class); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/package-info.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/package-info.java new file mode 100644 index 000000000000..f168cd4aa145 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for MicrosoftAzureFleet. + * null. + */ +package com.azure.resourcemanager.azurefleet.models; diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/package-info.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/package-info.java new file mode 100644 index 000000000000..b51cf43e1e94 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/com/azure/resourcemanager/azurefleet/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for MicrosoftAzureFleet. + * null. + */ +package com.azure.resourcemanager.azurefleet; diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/module-info.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/module-info.java new file mode 100644 index 000000000000..6bb6a1472303 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/java/module-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.azurefleet { + requires transitive com.azure.core.management; + exports com.azure.resourcemanager.azurefleet; + exports com.azure.resourcemanager.azurefleet.fluent; + exports com.azure.resourcemanager.azurefleet.fluent.models; + exports com.azure.resourcemanager.azurefleet.models; + opens com.azure.resourcemanager.azurefleet.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.azurefleet.models to com.azure.core, com.fasterxml.jackson.databind; +} \ No newline at end of file diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurefleet/proxy-config.json b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurefleet/proxy-config.json new file mode 100644 index 000000000000..42edb6f168ca --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurefleet/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.azurefleet.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.azurefleet.implementation.FleetsClientImpl$FleetsService" ], [ "com.azure.resourcemanager.azurefleet.implementation.VirtualMachineScaleSetsClientImpl$VirtualMachineScaleSetsService" ] ] \ No newline at end of file diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurefleet/reflect-config.json b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurefleet/reflect-config.json new file mode 100644 index 000000000000..2d5aa8d27f63 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azurefleet/reflect-config.json @@ -0,0 +1,621 @@ +[ { + "name" : "com.azure.resourcemanager.azurefleet.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.FleetListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.fluent.models.FleetInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.fluent.models.FleetProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.SpotPriorityProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.RegularPriorityProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VmSizeProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ComputeProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetVMProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetOSProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.WindowsConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.AdditionalUnattendContent", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.PatchSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchAutomaticByPlatformSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.WinRMConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.WinRMListener", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.LinuxConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.SshConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.SshPublicKey", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.LinuxPatchSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchAutomaticByPlatformSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VaultSecretGroup", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VaultCertificate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetStorageProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ImageReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetOSDisk", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.DiffDiskSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualHardDisk", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetManagedDiskParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.DiskEncryptionSetParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VMDiskSecurityProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetDataDisk", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ApiEntityReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetNetworkConfigurationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetIpConfigurationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetPublicIpAddressConfigurationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpTag", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.PublicIpAddressSku", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.SecurityProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.UefiSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.EncryptionIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ProxyAgentSettings", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.DiagnosticsProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.BootDiagnostics", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetExtensionProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetExtension", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetExtensionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.KeyVaultSecretReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.SubResourceReadOnly", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.BillingProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ScheduledEventsProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.TerminateNotificationProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.OSImageNotificationProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.CapacityReservationProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ApplicationProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VMGalleryApplication", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetHardwareProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VMSizeProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ServiceArtifactReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.SecurityPostureReference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineExtension", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineExtensionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineExtensionInstanceView", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.InstanceViewStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ResourceWithOptionalLocation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.UserAssignedIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.Plan", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.FleetUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentityUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ResourcePlanUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.FleetPropertiesUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ComputeProfileUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.fluent.models.VirtualMachineScaleSetInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ApiError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ApiErrorBase", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.InnerError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.EvictionPolicy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.SpotAllocationStrategy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.RegularPriorityAllocationStrategy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.WindowsPatchAssessmentMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.LinuxPatchAssessmentMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.DiskCreateOptionTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.DiffDiskOptions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.DiffDiskPlacement", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.StorageAccountTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.SecurityEncryptionTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.DiskDeleteOptionTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.DomainNameLabelScopeTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.IpVersion", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.DeleteOptions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.PublicIpAddressSkuName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.PublicIpAddressSkuTier", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliaryMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliarySku", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.NetworkApiVersion", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.SecurityTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.Mode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachinePriorityTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.VirtualMachineEvictionPolicyTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.SettingNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ProtocolTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.CachingTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.OperatingSystemTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.StatusLevelTypes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.PassNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.azurefleet.models.ComponentNames", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsCreateOrUpdateSamples.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..3c568672e061 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsCreateOrUpdateSamples.java @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurefleet.models.AdditionalUnattendContent; +import com.azure.resourcemanager.azurefleet.models.ApiEntityReference; +import com.azure.resourcemanager.azurefleet.models.ApplicationProfile; +import com.azure.resourcemanager.azurefleet.models.BillingProfile; +import com.azure.resourcemanager.azurefleet.models.BootDiagnostics; +import com.azure.resourcemanager.azurefleet.models.CachingTypes; +import com.azure.resourcemanager.azurefleet.models.CapacityReservationProfile; +import com.azure.resourcemanager.azurefleet.models.ComponentNames; +import com.azure.resourcemanager.azurefleet.models.ComputeProfile; +import com.azure.resourcemanager.azurefleet.models.DeleteOptions; +import com.azure.resourcemanager.azurefleet.models.DiagnosticsProfile; +import com.azure.resourcemanager.azurefleet.models.DiffDiskOptions; +import com.azure.resourcemanager.azurefleet.models.DiffDiskPlacement; +import com.azure.resourcemanager.azurefleet.models.DiffDiskSettings; +import com.azure.resourcemanager.azurefleet.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.azurefleet.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.azurefleet.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.azurefleet.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.azurefleet.models.EncryptionIdentity; +import com.azure.resourcemanager.azurefleet.models.EvictionPolicy; +import com.azure.resourcemanager.azurefleet.models.ImageReference; +import com.azure.resourcemanager.azurefleet.models.InstanceViewStatus; +import com.azure.resourcemanager.azurefleet.models.IpVersion; +import com.azure.resourcemanager.azurefleet.models.KeyVaultSecretReference; +import com.azure.resourcemanager.azurefleet.models.LinuxConfiguration; +import com.azure.resourcemanager.azurefleet.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.azurefleet.models.LinuxPatchSettings; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentity; +import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurefleet.models.Mode; +import com.azure.resourcemanager.azurefleet.models.NetworkApiVersion; +import com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.azurefleet.models.OperatingSystemTypes; +import com.azure.resourcemanager.azurefleet.models.OSImageNotificationProfile; +import com.azure.resourcemanager.azurefleet.models.PassNames; +import com.azure.resourcemanager.azurefleet.models.PatchSettings; +import com.azure.resourcemanager.azurefleet.models.ProtocolTypes; +import com.azure.resourcemanager.azurefleet.models.ProxyAgentSettings; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSku; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSkuName; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSkuTier; +import com.azure.resourcemanager.azurefleet.models.RegularPriorityAllocationStrategy; +import com.azure.resourcemanager.azurefleet.models.RegularPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.ScheduledEventsProfile; +import com.azure.resourcemanager.azurefleet.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.azurefleet.models.SecurityPostureReference; +import com.azure.resourcemanager.azurefleet.models.SecurityProfile; +import com.azure.resourcemanager.azurefleet.models.SecurityTypes; +import com.azure.resourcemanager.azurefleet.models.ServiceArtifactReference; +import com.azure.resourcemanager.azurefleet.models.SettingNames; +import com.azure.resourcemanager.azurefleet.models.SpotAllocationStrategy; +import com.azure.resourcemanager.azurefleet.models.SpotPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.SshConfiguration; +import com.azure.resourcemanager.azurefleet.models.SshPublicKey; +import com.azure.resourcemanager.azurefleet.models.StatusLevelTypes; +import com.azure.resourcemanager.azurefleet.models.StorageAccountTypes; +import com.azure.resourcemanager.azurefleet.models.TerminateNotificationProfile; +import com.azure.resourcemanager.azurefleet.models.UefiSettings; +import com.azure.resourcemanager.azurefleet.models.UserAssignedIdentity; +import com.azure.resourcemanager.azurefleet.models.VaultCertificate; +import com.azure.resourcemanager.azurefleet.models.VaultSecretGroup; +import com.azure.resourcemanager.azurefleet.models.VirtualHardDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineExtension; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineExtensionInstanceView; +import com.azure.resourcemanager.azurefleet.models.VirtualMachinePriorityTypes; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetDataDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetExtension; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetExtensionProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetHardwareProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpTag; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetManagedDiskParameters; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetOSDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetOSProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetStorageProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetVMProfile; +import com.azure.resourcemanager.azurefleet.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.azurefleet.models.VMGalleryApplication; +import com.azure.resourcemanager.azurefleet.models.VmSizeProfile; +import com.azure.resourcemanager.azurefleet.models.VMSizeProperties; +import com.azure.resourcemanager.azurefleet.models.WindowsConfiguration; +import com.azure.resourcemanager.azurefleet.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchMode; +import com.azure.resourcemanager.azurefleet.models.WinRMConfiguration; +import com.azure.resourcemanager.azurefleet.models.WinRMListener; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Fleets CreateOrUpdate. + */ +public final class FleetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_CreateOrUpdate.json + */ + /** + * Sample code: Fleets_CreateOrUpdate. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsCreateOrUpdate(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) + throws IOException { + manager.fleets() + .define("testFleet") + .withRegion("westus") + .withExistingResourceGroup("rgazurefleet") + .withTags(mapOf("key3518", "fakeTokenPlaceholder")) + .withZones(Arrays.asList("zone1", "zone2")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("key9851", new UserAssignedIdentity()))) + .withSpotPriorityProfile(new SpotPriorityProfile().withCapacity(20) + .withMinCapacity(10) + .withMaxPricePerVM(0.00865F) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(SpotAllocationStrategy.PRICE_CAPACITY_OPTIMIZED) + .withMaintain(true)) + .withRegularPriorityProfile(new RegularPriorityProfile().withCapacity(20) + .withMinCapacity(10) + .withAllocationStrategy(RegularPriorityAllocationStrategy.LOWEST_PRICE)) + .withVmSizesProfile(Arrays.asList(new VmSizeProfile().withName("Standard_d1_v2").withRank(19225))) + .withComputeProfile(new ComputeProfile() + .withBaseVirtualMachineProfile( + new VirtualMachineScaleSetVMProfile() + .withOsProfile(new VirtualMachineScaleSetOSProfile().withComputerNamePrefix("o") + .withAdminUsername("nrgzqciiaaxjrqldbmjbqkyhntp") + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("xjjib") + .withWindowsConfiguration(new WindowsConfiguration().withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("hlyjiqcfksgrpjrct") + .withAdditionalUnattendContent(Arrays + .asList(new AdditionalUnattendContent().withPassName(PassNames.OOBE_SYSTEM) + .withComponentName(ComponentNames.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("bubmqbxjkj"))) + .withPatchSettings(new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.MANUAL) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings( + new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + WindowsVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withWinRM(new WinRMConfiguration() + .withListeners(Arrays.asList(new WinRMListener().withProtocol(ProtocolTypes.HTTP) + .withCertificateUrl("phwesineizrl")))) + .withEnableVMAgentPlatformUpdates(true)) + .withLinuxConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys(Arrays + .asList(new SshPublicKey().withPath("kmqz").withKeyData("fakeTokenPlaceholder")))) + .withProvisionVMAgent(true) + .withPatchSettings(new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT) + .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings(new LinuxVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withEnableVMAgentPlatformUpdates(true)) + .withSecrets( + Arrays.asList(new VaultSecretGroup().withSourceVault(new SubResource().withId("groxwd")) + .withVaultCertificates( + Arrays.asList(new VaultCertificate().withCertificateUrl("tyldwkzafmnkvpo") + .withCertificateStore("nlxrwavpzhueffxsshlun"))))) + .withAllowExtensionOperations(true) + .withRequireGuestProvisionSignal(true)) + .withStorageProfile(new VirtualMachineScaleSetStorageProfile() + .withImageReference(new ImageReference().withId("aiunknwgksu") + .withPublisher("mqxgwbiyjzmxavhbkd") + .withOffer("isxgumkarlkomp") + .withSku("eojmppqcrnpmxirtp") + .withVersion("wvpcqefgtmqdgltiuz") + .withSharedGalleryImageId("kmkgihoxwlawuuhcinfirktdwkmx") + .withCommunityGalleryImageId("vlqe")) + .withOsDisk(new VirtualMachineScaleSetOSDisk().withName("wfttw") + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withDiskSizeGB(14) + .withOsType(OperatingSystemTypes.WINDOWS) + .withImage(new VirtualHardDisk().withUri("thqceubivdrjs")) + .withVhdContainers(Arrays.asList("tkzcwddtinkfpnfklatw")) + .withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("vmatqblzjalbatdepyzqmnd")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("vmatqblzjalbatdepyzqmnd")))) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)) + .withDataDisks( + Arrays + .asList(new VirtualMachineScaleSetDataDisk().withName("eogiykmdmeikswxmigjws") + .withLun(14) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(6) + .withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("vmatqblzjalbatdepyzqmnd")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters() + .withId("vmatqblzjalbatdepyzqmnd")))) + .withDiskIopsReadWrite(27L) + .withDiskMBpsReadWrite(2L) + .withDeleteOption(DiskDeleteOptionTypes.DELETE))) + .withDiskControllerType("uzb")) + .withNetworkProfile(new VirtualMachineScaleSetNetworkProfile() + .withHealthProbe(new ApiEntityReference().withId("cmkfcjhmrwxwqtac")) + .withNetworkInterfaceConfigurations( + Arrays.asList(new VirtualMachineScaleSetNetworkConfiguration().withName("i") + .withPrimary(true) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .withEnableFpga(true) + .withNetworkSecurityGroup(new SubResource().withId("groxwd")) + .withDnsSettings(new VirtualMachineScaleSetNetworkConfigurationDnsSettings() + .withDnsServers(Arrays.asList("nxmmfolhclsesu"))) + .withIpConfigurations(Arrays.asList(new VirtualMachineScaleSetIpConfiguration() + .withName("oezqhkidfhyywlfzwuotilrpbqnjg") + .withSubnet(new ApiEntityReference().withId("cmkfcjhmrwxwqtac")) + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachineScaleSetPublicIpAddressConfiguration().withName("fvpqf") + .withSku(new PublicIpAddressSku().withName(PublicIpAddressSkuName.BASIC) + .withTier(PublicIpAddressSkuTier.REGIONAL)) + .withIdleTimeoutInMinutes(9) + .withDnsSettings( + new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings() + .withDomainNameLabel("ukrddzvmorpmfsczjwtbvp") + .withDomainNameLabelScope( + DomainNameLabelScopeTypes.TENANT_REUSE)) + .withIpTags(Arrays.asList( + new VirtualMachineScaleSetIpTag().withIpTagType("sddgsoemnzgqizale") + .withTag("wufmhrjsakbiaetyara"))) + .withPublicIpPrefix(new SubResource().withId("groxwd")) + .withPublicIpAddressVersion(IpVersion.IPV4) + .withDeleteOption(DeleteOptions.DELETE)) + .withPrivateIpAddressVersion(IpVersion.IPV4) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource().withId("groxwd"))) + .withApplicationSecurityGroups( + Arrays.asList(new SubResource().withId("groxwd"))) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource().withId("groxwd"))) + .withLoadBalancerInboundNatPools( + Arrays.asList(new SubResource().withId("groxwd"))))) + .withEnableIpForwarding(true) + .withDeleteOption(DeleteOptions.DELETE) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.NONE))) + .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) + .withEncryptionIdentity( + new EncryptionIdentity().withUserAssignedIdentityResourceId("qoersmt")) + .withProxyAgentSettings(new ProxyAgentSettings().withEnabled(true) + .withMode(Mode.AUDIT) + .withKeyIncarnationId(20))) + .withDiagnosticsProfile(new DiagnosticsProfile().withBootDiagnostics( + new BootDiagnostics().withEnabled(true).withStorageUri("rzamfwghybpx"))) + .withExtensionProfile(new VirtualMachineScaleSetExtensionProfile() + .withExtensions(Arrays.asList(new VirtualMachineScaleSetExtension().withName("bndxuxx") + .withForceUpdateTag("yhgxw") + .withPublisher("kpxtirxjfprhs") + .withTypePropertiesType("pgjilctjjwaa") + .withTypeHandlerVersion("zevivcoilxmbwlrihhhibq") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProvisionAfterExtensions(Arrays.asList("nftzosroolbcwmpupujzqwqe")) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("groxwd"))))) + .withExtensionsTimeBudget("mbhjahtdygwgyszdwjtvlvtgchdwil")) + .withLicenseType("v") + .withPriority(VirtualMachinePriorityTypes.REGULAR) + .withEvictionPolicy(VirtualMachineEvictionPolicyTypes.DEALLOCATE) + .withBillingProfile(new BillingProfile().withMaxPrice(2.0D)) + .withScheduledEventsProfile(new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("iljppmmw").withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("olbpadmevekyczfokodtfprxti") + .withEnable(true))) + .withUserData("s") + .withCapacityReservation(new CapacityReservationProfile() + .withCapacityReservationGroup(new SubResource().withId("groxwd"))) + .withApplicationProfile(new ApplicationProfile() + .withGalleryApplications(Arrays.asList(new VMGalleryApplication().withTags("eyrqjbib") + .withOrder(5) + .withPackageReferenceId("lfxqiadouhmbovcd") + .withConfigurationReference("ulztmiavpojpbpbddgnuuiimxcpau") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(true)))) + .withHardwareProfile(new VirtualMachineScaleSetHardwareProfile() + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(16).withVCpusPerCore(23))) + .withServiceArtifactReference(new ServiceArtifactReference().withId("qlkeeyskyr")) + .withSecurityPostureReference(new SecurityPostureReference() + .withId("mubredelfbshboaxrsxiajihahaa") + .withExcludeExtensions(Arrays.asList(new VirtualMachineExtension() + .withLocation("wrqxhbqaebwkzmcdmngyqmhogc") + .withTags(mapOf("key7356", "fakeTokenPlaceholder")) + .withForceUpdateTag("oriasdwawveilgusfrn") + .withPublisher("rxoajzb") + .withTypePropertiesType("vhrtgbaqdkbrrqxsdiiaqxksmqukl") + .withTypeHandlerVersion("bvzbiibps") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withInstanceView(new VirtualMachineExtensionInstanceView().withName("ip") + .withType("woadxvobquacooaujyg") + .withTypeHandlerVersion("ftkkqxdqiofgsusvxekdcpua") + .withSubstatuses( + Arrays.asList(new InstanceViewStatus().withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("pomenhgqjoelbxvsqwxxexqxv") + .withMessage("jxjjmlwbjylzvrislyyflhnmizhiu") + .withTime(OffsetDateTime.parse("2024-04-29T21:51:44.042Z")))) + .withStatuses( + Arrays.asList(new InstanceViewStatus().withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("pomenhgqjoelbxvsqwxxexqxv") + .withMessage("jxjjmlwbjylzvrislyyflhnmizhiu") + .withTime(OffsetDateTime.parse("2024-04-29T21:51:44.042Z"))))) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("groxwd"))) + .withProvisionAfterExtensions(Arrays.asList("lwsfavklrgzuwmyxscskt")))))) + .withComputeApiVersion("2023-07-01") + .withPlatformFaultDomainCount(1)) + .create(); + } + + // Use "Map.of" if available + @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; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsDeleteSamples.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsDeleteSamples.java new file mode 100644 index 000000000000..39c31bc9e1e9 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.generated; + +/** + * Samples for Fleets Delete. + */ +public final class FleetsDeleteSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Delete.json + */ + /** + * Sample code: Fleets_Delete. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsDelete(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.fleets().delete("rgazurefleet", "testFleet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsGetByResourceGroupSamples.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..21e9bec96943 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.generated; + +/** + * Samples for Fleets GetByResourceGroup. + */ +public final class FleetsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Get.json + */ + /** + * Sample code: Fleets_Get. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsGet(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.fleets().getByResourceGroupWithResponse("rgazurefleet", "testFleet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsListByResourceGroupSamples.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsListByResourceGroupSamples.java new file mode 100644 index 000000000000..cd84f8db55d9 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.generated; + +/** + * Samples for Fleets ListByResourceGroup. + */ +public final class FleetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_ListByResourceGroup.json + */ + /** + * Sample code: Fleets_ListByResourceGroup. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsListByResourceGroup(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.fleets().listByResourceGroup("rgazurefleet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsListSamples.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsListSamples.java new file mode 100644 index 000000000000..885bf4efda5c --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.generated; + +/** + * Samples for Fleets List. + */ +public final class FleetsListSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_ListBySubscription.json + */ + /** + * Sample code: Fleets_ListBySubscription. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsListBySubscription(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.fleets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsUpdateSamples.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsUpdateSamples.java new file mode 100644 index 000000000000..4319dc117df2 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/FleetsUpdateSamples.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.generated; + +import com.azure.core.management.SubResource; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurefleet.models.AdditionalUnattendContent; +import com.azure.resourcemanager.azurefleet.models.ApiEntityReference; +import com.azure.resourcemanager.azurefleet.models.ApplicationProfile; +import com.azure.resourcemanager.azurefleet.models.BillingProfile; +import com.azure.resourcemanager.azurefleet.models.BootDiagnostics; +import com.azure.resourcemanager.azurefleet.models.CachingTypes; +import com.azure.resourcemanager.azurefleet.models.CapacityReservationProfile; +import com.azure.resourcemanager.azurefleet.models.ComponentNames; +import com.azure.resourcemanager.azurefleet.models.ComputeProfileUpdate; +import com.azure.resourcemanager.azurefleet.models.DeleteOptions; +import com.azure.resourcemanager.azurefleet.models.DiagnosticsProfile; +import com.azure.resourcemanager.azurefleet.models.DiffDiskOptions; +import com.azure.resourcemanager.azurefleet.models.DiffDiskPlacement; +import com.azure.resourcemanager.azurefleet.models.DiffDiskSettings; +import com.azure.resourcemanager.azurefleet.models.DiskCreateOptionTypes; +import com.azure.resourcemanager.azurefleet.models.DiskDeleteOptionTypes; +import com.azure.resourcemanager.azurefleet.models.DiskEncryptionSetParameters; +import com.azure.resourcemanager.azurefleet.models.DomainNameLabelScopeTypes; +import com.azure.resourcemanager.azurefleet.models.EncryptionIdentity; +import com.azure.resourcemanager.azurefleet.models.EvictionPolicy; +import com.azure.resourcemanager.azurefleet.models.Fleet; +import com.azure.resourcemanager.azurefleet.models.FleetPropertiesUpdate; +import com.azure.resourcemanager.azurefleet.models.ImageReference; +import com.azure.resourcemanager.azurefleet.models.InstanceViewStatus; +import com.azure.resourcemanager.azurefleet.models.IpVersion; +import com.azure.resourcemanager.azurefleet.models.KeyVaultSecretReference; +import com.azure.resourcemanager.azurefleet.models.LinuxConfiguration; +import com.azure.resourcemanager.azurefleet.models.LinuxPatchAssessmentMode; +import com.azure.resourcemanager.azurefleet.models.LinuxPatchSettings; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.azurefleet.models.LinuxVMGuestPatchMode; +import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.azurefleet.models.ManagedServiceIdentityUpdate; +import com.azure.resourcemanager.azurefleet.models.Mode; +import com.azure.resourcemanager.azurefleet.models.NetworkApiVersion; +import com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.azurefleet.models.NetworkInterfaceAuxiliarySku; +import com.azure.resourcemanager.azurefleet.models.OperatingSystemTypes; +import com.azure.resourcemanager.azurefleet.models.OSImageNotificationProfile; +import com.azure.resourcemanager.azurefleet.models.PassNames; +import com.azure.resourcemanager.azurefleet.models.PatchSettings; +import com.azure.resourcemanager.azurefleet.models.ProtocolTypes; +import com.azure.resourcemanager.azurefleet.models.ProxyAgentSettings; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSku; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSkuName; +import com.azure.resourcemanager.azurefleet.models.PublicIpAddressSkuTier; +import com.azure.resourcemanager.azurefleet.models.RegularPriorityAllocationStrategy; +import com.azure.resourcemanager.azurefleet.models.RegularPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.ResourcePlanUpdate; +import com.azure.resourcemanager.azurefleet.models.ScheduledEventsProfile; +import com.azure.resourcemanager.azurefleet.models.SecurityEncryptionTypes; +import com.azure.resourcemanager.azurefleet.models.SecurityPostureReference; +import com.azure.resourcemanager.azurefleet.models.SecurityProfile; +import com.azure.resourcemanager.azurefleet.models.SecurityTypes; +import com.azure.resourcemanager.azurefleet.models.ServiceArtifactReference; +import com.azure.resourcemanager.azurefleet.models.SettingNames; +import com.azure.resourcemanager.azurefleet.models.SpotAllocationStrategy; +import com.azure.resourcemanager.azurefleet.models.SpotPriorityProfile; +import com.azure.resourcemanager.azurefleet.models.SshConfiguration; +import com.azure.resourcemanager.azurefleet.models.SshPublicKey; +import com.azure.resourcemanager.azurefleet.models.StatusLevelTypes; +import com.azure.resourcemanager.azurefleet.models.StorageAccountTypes; +import com.azure.resourcemanager.azurefleet.models.TerminateNotificationProfile; +import com.azure.resourcemanager.azurefleet.models.UefiSettings; +import com.azure.resourcemanager.azurefleet.models.VaultCertificate; +import com.azure.resourcemanager.azurefleet.models.VaultSecretGroup; +import com.azure.resourcemanager.azurefleet.models.VirtualHardDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineEvictionPolicyTypes; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineExtension; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineExtensionInstanceView; +import com.azure.resourcemanager.azurefleet.models.VirtualMachinePriorityTypes; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetDataDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetExtension; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetExtensionProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetHardwareProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetIpTag; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetManagedDiskParameters; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkConfigurationDnsSettings; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetNetworkProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetOSDisk; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetOSProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfiguration; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetStorageProfile; +import com.azure.resourcemanager.azurefleet.models.VirtualMachineScaleSetVMProfile; +import com.azure.resourcemanager.azurefleet.models.VMDiskSecurityProfile; +import com.azure.resourcemanager.azurefleet.models.VMGalleryApplication; +import com.azure.resourcemanager.azurefleet.models.VmSizeProfile; +import com.azure.resourcemanager.azurefleet.models.VMSizeProperties; +import com.azure.resourcemanager.azurefleet.models.WindowsConfiguration; +import com.azure.resourcemanager.azurefleet.models.WindowsPatchAssessmentMode; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchAutomaticByPlatformSettings; +import com.azure.resourcemanager.azurefleet.models.WindowsVMGuestPatchMode; +import com.azure.resourcemanager.azurefleet.models.WinRMConfiguration; +import com.azure.resourcemanager.azurefleet.models.WinRMListener; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Fleets Update. + */ +public final class FleetsUpdateSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Update.json + */ + /** + * Sample code: Fleets_Update. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void fleetsUpdate(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) throws IOException { + Fleet resource = manager.fleets() + .getByResourceGroupWithResponse("rgazurefleet", "testFleet", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentityUpdate().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf())) + .withPlan(new ResourcePlanUpdate().withName("jwgrcrnrtfoxn") + .withPublisher("iozjbiqqckqm") + .withProduct("cgopbyvdyqikahwyxfpzwaqk") + .withPromotionCode("fakeTokenPlaceholder") + .withVersion("wa")) + .withProperties(new FleetPropertiesUpdate() + .withSpotPriorityProfile(new SpotPriorityProfile().withCapacity(20) + .withMinCapacity(10) + .withMaxPricePerVM(0.00865F) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(SpotAllocationStrategy.PRICE_CAPACITY_OPTIMIZED) + .withMaintain(true)) + .withRegularPriorityProfile(new RegularPriorityProfile().withCapacity(20) + .withMinCapacity(10) + .withAllocationStrategy(RegularPriorityAllocationStrategy.LOWEST_PRICE)) + .withVmSizesProfile(Arrays.asList(new VmSizeProfile().withName("Standard_d1_v2").withRank(19225))) + .withComputeProfile(new ComputeProfileUpdate() + .withBaseVirtualMachineProfile(new VirtualMachineScaleSetVMProfile() + .withOsProfile(new VirtualMachineScaleSetOSProfile().withComputerNamePrefix("o") + .withAdminUsername("nrgzqciiaaxjrqldbmjbqkyhntp") + .withAdminPassword("fakeTokenPlaceholder") + .withCustomData("xjjib") + .withWindowsConfiguration(new WindowsConfiguration().withProvisionVMAgent(true) + .withEnableAutomaticUpdates(true) + .withTimeZone("hlyjiqcfksgrpjrct") + .withAdditionalUnattendContent(Arrays + .asList(new AdditionalUnattendContent().withPassName(PassNames.OOBE_SYSTEM) + .withComponentName(ComponentNames.MICROSOFT_WINDOWS_SHELL_SETUP) + .withSettingName(SettingNames.AUTO_LOGON) + .withContent("bubmqbxjkj"))) + .withPatchSettings(new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.MANUAL) + .withEnableHotpatching(true) + .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings( + new WindowsVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting( + WindowsVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withWinRM(new WinRMConfiguration() + .withListeners(Arrays.asList(new WinRMListener().withProtocol(ProtocolTypes.HTTP) + .withCertificateUrl("phwesineizrl")))) + .withEnableVMAgentPlatformUpdates(true)) + .withLinuxConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys(Arrays + .asList(new SshPublicKey().withPath("kmqz").withKeyData("fakeTokenPlaceholder")))) + .withProvisionVMAgent(true) + .withPatchSettings(new LinuxPatchSettings() + .withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT) + .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT) + .withAutomaticByPlatformSettings(new LinuxVMGuestPatchAutomaticByPlatformSettings() + .withRebootSetting(LinuxVMGuestPatchAutomaticByPlatformRebootSetting.UNKNOWN) + .withBypassPlatformSafetyChecksOnUserSchedule(true))) + .withEnableVMAgentPlatformUpdates(true)) + .withSecrets( + Arrays.asList(new VaultSecretGroup().withSourceVault(new SubResource().withId("groxwd")) + .withVaultCertificates( + Arrays.asList(new VaultCertificate().withCertificateUrl("tyldwkzafmnkvpo") + .withCertificateStore("nlxrwavpzhueffxsshlun"))))) + .withAllowExtensionOperations(true) + .withRequireGuestProvisionSignal(true)) + .withStorageProfile( + new VirtualMachineScaleSetStorageProfile() + .withImageReference(new ImageReference().withId("aiunknwgksu") + .withPublisher("mqxgwbiyjzmxavhbkd") + .withOffer("isxgumkarlkomp") + .withSku("eojmppqcrnpmxirtp") + .withVersion("wvpcqefgtmqdgltiuz") + .withSharedGalleryImageId("kmkgihoxwlawuuhcinfirktdwkmx") + .withCommunityGalleryImageId("vlqe")) + .withOsDisk( + new VirtualMachineScaleSetOSDisk().withName("wfttw") + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL) + .withPlacement(DiffDiskPlacement.CACHE_DISK)) + .withDiskSizeGB(14) + .withOsType(OperatingSystemTypes.WINDOWS) + .withImage(new VirtualHardDisk().withUri("thqceubivdrjs")) + .withVhdContainers(Arrays.asList("tkzcwddtinkfpnfklatw")) + .withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("vmatqblzjalbatdepyzqmnd")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters() + .withId("vmatqblzjalbatdepyzqmnd")))) + .withDeleteOption(DiskDeleteOptionTypes.DELETE)) + .withDataDisks( + Arrays.asList(new VirtualMachineScaleSetDataDisk().withName("eogiykmdmeikswxmigjws") + .withLun(14) + .withCaching(CachingTypes.NONE) + .withWriteAcceleratorEnabled(true) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDiskSizeGB(6) + .withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.STANDARD_LRS) + .withDiskEncryptionSet( + new DiskEncryptionSetParameters().withId("vmatqblzjalbatdepyzqmnd")) + .withSecurityProfile(new VMDiskSecurityProfile() + .withSecurityEncryptionType(SecurityEncryptionTypes.VMGUEST_STATE_ONLY) + .withDiskEncryptionSet(new DiskEncryptionSetParameters() + .withId("vmatqblzjalbatdepyzqmnd")))) + .withDiskIopsReadWrite(27L) + .withDiskMBpsReadWrite(2L) + .withDeleteOption(DiskDeleteOptionTypes.DELETE))) + .withDiskControllerType("uzb")) + .withNetworkProfile(new VirtualMachineScaleSetNetworkProfile() + .withHealthProbe(new ApiEntityReference().withId("cmkfcjhmrwxwqtac")) + .withNetworkInterfaceConfigurations( + Arrays.asList(new VirtualMachineScaleSetNetworkConfiguration().withName("i") + .withPrimary(true) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .withEnableFpga(true) + .withNetworkSecurityGroup(new SubResource().withId("groxwd")) + .withDnsSettings(new VirtualMachineScaleSetNetworkConfigurationDnsSettings() + .withDnsServers(Arrays.asList("nxmmfolhclsesu"))) + .withIpConfigurations(Arrays.asList(new VirtualMachineScaleSetIpConfiguration() + .withName("oezqhkidfhyywlfzwuotilrpbqnjg") + .withSubnet(new ApiEntityReference().withId("cmkfcjhmrwxwqtac")) + .withPrimary(true) + .withPublicIpAddressConfiguration( + new VirtualMachineScaleSetPublicIpAddressConfiguration().withName("fvpqf") + .withSku(new PublicIpAddressSku().withName(PublicIpAddressSkuName.BASIC) + .withTier(PublicIpAddressSkuTier.REGIONAL)) + .withIdleTimeoutInMinutes(9) + .withDnsSettings( + new VirtualMachineScaleSetPublicIpAddressConfigurationDnsSettings() + .withDomainNameLabel("ukrddzvmorpmfsczjwtbvp") + .withDomainNameLabelScope( + DomainNameLabelScopeTypes.TENANT_REUSE)) + .withIpTags(Arrays.asList( + new VirtualMachineScaleSetIpTag().withIpTagType("sddgsoemnzgqizale") + .withTag("wufmhrjsakbiaetyara"))) + .withPublicIpPrefix(new SubResource().withId("groxwd")) + .withPublicIpAddressVersion(IpVersion.IPV4) + .withDeleteOption(DeleteOptions.DELETE)) + .withPrivateIpAddressVersion(IpVersion.IPV4) + .withApplicationGatewayBackendAddressPools( + Arrays.asList(new SubResource().withId("groxwd"))) + .withApplicationSecurityGroups( + Arrays.asList(new SubResource().withId("groxwd"))) + .withLoadBalancerBackendAddressPools( + Arrays.asList(new SubResource().withId("groxwd"))) + .withLoadBalancerInboundNatPools( + Arrays.asList(new SubResource().withId("groxwd"))))) + .withEnableIpForwarding(true) + .withDeleteOption(DeleteOptions.DELETE) + .withAuxiliaryMode(NetworkInterfaceAuxiliaryMode.NONE) + .withAuxiliarySku(NetworkInterfaceAuxiliarySku.NONE))) + .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) + .withEncryptionIdentity( + new EncryptionIdentity().withUserAssignedIdentityResourceId("qoersmt")) + .withProxyAgentSettings(new ProxyAgentSettings().withEnabled(true) + .withMode(Mode.AUDIT) + .withKeyIncarnationId(20))) + .withDiagnosticsProfile(new DiagnosticsProfile().withBootDiagnostics( + new BootDiagnostics().withEnabled(true).withStorageUri("rzamfwghybpx"))) + .withExtensionProfile(new VirtualMachineScaleSetExtensionProfile() + .withExtensions(Arrays.asList(new VirtualMachineScaleSetExtension().withName("bndxuxx") + .withForceUpdateTag("yhgxw") + .withPublisher("kpxtirxjfprhs") + .withTypePropertiesType("pgjilctjjwaa") + .withTypeHandlerVersion("zevivcoilxmbwlrihhhibq") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProvisionAfterExtensions(Arrays.asList("nftzosroolbcwmpupujzqwqe")) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("groxwd"))))) + .withExtensionsTimeBudget("mbhjahtdygwgyszdwjtvlvtgchdwil")) + .withLicenseType("v") + .withPriority(VirtualMachinePriorityTypes.REGULAR) + .withEvictionPolicy(VirtualMachineEvictionPolicyTypes.DEALLOCATE) + .withBillingProfile(new BillingProfile().withMaxPrice(2.0D)) + .withScheduledEventsProfile(new ScheduledEventsProfile() + .withTerminateNotificationProfile( + new TerminateNotificationProfile().withNotBeforeTimeout("iljppmmw").withEnable(true)) + .withOsImageNotificationProfile( + new OSImageNotificationProfile().withNotBeforeTimeout("olbpadmevekyczfokodtfprxti") + .withEnable(true))) + .withUserData("s") + .withCapacityReservation(new CapacityReservationProfile() + .withCapacityReservationGroup(new SubResource().withId("groxwd"))) + .withApplicationProfile(new ApplicationProfile() + .withGalleryApplications(Arrays.asList(new VMGalleryApplication().withTags("eyrqjbib") + .withOrder(5) + .withPackageReferenceId("lfxqiadouhmbovcd") + .withConfigurationReference("ulztmiavpojpbpbddgnuuiimxcpau") + .withTreatFailureAsDeploymentFailure(true) + .withEnableAutomaticUpgrade(true)))) + .withHardwareProfile(new VirtualMachineScaleSetHardwareProfile() + .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(16).withVCpusPerCore(23))) + .withServiceArtifactReference(new ServiceArtifactReference().withId("qlkeeyskyr")) + .withSecurityPostureReference( + new SecurityPostureReference().withId("mubredelfbshboaxrsxiajihahaa") + .withExcludeExtensions(Arrays.asList(new VirtualMachineExtension() + .withLocation("wrqxhbqaebwkzmcdmngyqmhogc") + .withTags(mapOf()) + .withForceUpdateTag("oriasdwawveilgusfrn") + .withPublisher("rxoajzb") + .withTypePropertiesType("vhrtgbaqdkbrrqxsdiiaqxksmqukl") + .withTypeHandlerVersion("bvzbiibps") + .withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withProtectedSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withInstanceView(new VirtualMachineExtensionInstanceView().withName("ip") + .withType("woadxvobquacooaujyg") + .withTypeHandlerVersion("ftkkqxdqiofgsusvxekdcpua") + .withSubstatuses( + Arrays.asList(new InstanceViewStatus().withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("pomenhgqjoelbxvsqwxxexqxv") + .withMessage("jxjjmlwbjylzvrislyyflhnmizhiu") + .withTime(OffsetDateTime.parse("2024-04-29T21:51:44.042Z")))) + .withStatuses( + Arrays.asList(new InstanceViewStatus().withCode("fakeTokenPlaceholder") + .withLevel(StatusLevelTypes.INFO) + .withDisplayStatus("pomenhgqjoelbxvsqwxxexqxv") + .withMessage("jxjjmlwbjylzvrislyyflhnmizhiu") + .withTime(OffsetDateTime.parse("2024-04-29T21:51:44.042Z"))))) + .withSuppressFailures(true) + .withProtectedSettingsFromKeyVault( + new KeyVaultSecretReference().withSecretUrl("fakeTokenPlaceholder") + .withSourceVault(new SubResource().withId("groxwd"))) + .withProvisionAfterExtensions(Arrays.asList("lwsfavklrgzuwmyxscskt")))))) + .withComputeApiVersion("2023-07-01") + .withPlatformFaultDomainCount(1))) + .apply(); + } + + // Use "Map.of" if available + @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; + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/OperationsListSamples.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/OperationsListSamples.java new file mode 100644 index 000000000000..3509473d5c74 --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void operationsList(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/VirtualMachineScaleSetsListByFleetSamples.java b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/VirtualMachineScaleSetsListByFleetSamples.java new file mode 100644 index 000000000000..d2cd2135afcf --- /dev/null +++ b/sdk/azurefleet/azure-resourcemanager-azurefleet/src/samples/java/com/azure/resourcemanager/azurefleet/generated/VirtualMachineScaleSetsListByFleetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurefleet.generated; + +/** + * Samples for VirtualMachineScaleSets ListByFleet. + */ +public final class VirtualMachineScaleSetsListByFleetSamples { + /* + * x-ms-original-file: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/VirtualMachineScaleSets_ListByFleet.json + */ + /** + * Sample code: VirtualMachineScaleSets_ListByFleet. + * + * @param manager Entry point to AzurefleetManager. + */ + public static void + virtualMachineScaleSetsListByFleet(com.azure.resourcemanager.azurefleet.AzurefleetManager manager) { + manager.virtualMachineScaleSets().listByFleet("rgazurefleet", "myFleet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azurefleet/ci.yml b/sdk/azurefleet/ci.yml new file mode 100644 index 000000000000..0235a8cec780 --- /dev/null +++ b/sdk/azurefleet/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/azurefleet/ci.yml + - sdk/azurefleet/azure-resourcemanager-azurefleet/ + exclude: + - sdk/azurefleet/pom.xml + - sdk/azurefleet/azure-resourcemanager-azurefleet/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurefleet/ci.yml + - sdk/azurefleet/azure-resourcemanager-azurefleet/ + exclude: + - sdk/azurefleet/pom.xml + - sdk/azurefleet/azure-resourcemanager-azurefleet/pom.xml + +parameters: + - name: release_azureresourcemanagerazurefleet + displayName: azure-resourcemanager-azurefleet + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azurefleet + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-azurefleet + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerazurefleet + releaseInBatch: ${{ parameters.release_azureresourcemanagerazurefleet }} diff --git a/sdk/azurefleet/pom.xml b/sdk/azurefleet/pom.xml new file mode 100644 index 000000000000..c94f40dc5dc2 --- /dev/null +++ b/sdk/azurefleet/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-azurefleet-service + pom + 1.0.0 + + + azure-resourcemanager-azurefleet + +