diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/CHANGELOG.md b/sdk/computefleet/azure-resourcemanager-computefleet/CHANGELOG.md index e6bd243fd42b..c2af29b5fb58 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/CHANGELOG.md +++ b/sdk/computefleet/azure-resourcemanager-computefleet/CHANGELOG.md @@ -1,14 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2025-04-15) -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Azure Resource Manager Compute Fleet client library for Java. This package contains Microsoft Azure SDK for Compute Fleet Management SDK. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0 (2024-10-22) diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/README.md b/sdk/computefleet/azure-resourcemanager-computefleet/README.md index 0dee5ed27391..b9e4be19bea1 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/README.md +++ b/sdk/computefleet/azure-resourcemanager-computefleet/README.md @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ ComputeFleetManager manager = ComputeFleetManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -99,101 +99,60 @@ fleet = computeFleetManager.fleets() .define(fleetName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) - .withProperties( - new FleetProperties() - .withSpotPriorityProfile( - new SpotPriorityProfile() - .withMaintain(false) - .withCapacity(1) - .withEvictionPolicy(EvictionPolicy.DELETE) - .withAllocationStrategy(SpotAllocationStrategy.LOWEST_PRICE) - ) - .withVmSizesProfile( - Arrays.asList( - new VmSizeProfile().withName("Standard_D4s_v3") - ) - ) - .withComputeProfile( - new ComputeProfile() - .withBaseVirtualMachineProfile( - new BaseVirtualMachineProfile() - .withStorageProfile( - new VirtualMachineScaleSetStorageProfile() - .withImageReference( - new ImageReference() - .withPublisher("canonical") - .withOffer("ubuntu-24_04-lts") - .withSku("server") - .withVersion("latest") - ) - .withOsDisk( - new VirtualMachineScaleSetOSDisk() - .withManagedDisk( - new VirtualMachineScaleSetManagedDiskParameters() - .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS) - ) - .withOsType(OperatingSystemTypes.LINUX) - .withDiskSizeGB(30) - .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) - .withDeleteOption(DiskDeleteOptionTypes.DELETE) - .withCaching(CachingTypes.READ_WRITE) - ) - .withDiskControllerType(DiskControllerTypes.SCSI) - ) - .withOsProfile( - new VirtualMachineScaleSetOSProfile() - .withComputerNamePrefix(randomPadding()) - .withAdminUsername(adminUser) - .withAdminPassword(adminPwd) - .withLinuxConfiguration( - new LinuxConfiguration().withDisablePasswordAuthentication(false) - ) - ) - .withNetworkProfile( - new VirtualMachineScaleSetNetworkProfile() - .withNetworkInterfaceConfigurations( - Arrays.asList( - new VirtualMachineScaleSetNetworkConfiguration() - .withName(vmName) - .withProperties( - new VirtualMachineScaleSetNetworkConfigurationProperties() - .withPrimary(true) - .withEnableAcceleratedNetworking(false) - .withDeleteOption(DeleteOptions.DELETE) - .withIpConfigurations( - Arrays.asList( - new VirtualMachineScaleSetIPConfiguration() - .withName(vmName) - .withProperties( - new VirtualMachineScaleSetIPConfigurationProperties() - .withPrimary(true) - .withSubnet( - new ApiEntityReference() - .withId(network.subnets().get("default").id()) - ) - .withLoadBalancerBackendAddressPools( - loadBalancer.loadBalancingRules() - .get(loadBalancerName + "-lbrule") - .innerModel().backendAddressPools() - ) - ) - ) - ) - ) - ) - ) - .withNetworkApiVersion(NetworkApiVersion.fromString("2024-03-01")) - ) - ) - .withComputeApiVersion("2024-03-01") - .withPlatformFaultDomainCount(1) - ) - .withRegularPriorityProfile(new RegularPriorityProfile() - .withAllocationStrategy(RegularPriorityAllocationStrategy.LOWEST_PRICE) - .withMinCapacity(1) - .withCapacity(2) - ) - ) + .withProperties(new FleetProperties() + .withSpotPriorityProfile(new SpotPriorityProfile().withMaintain(false) + .withCapacity(1) + .withEvictionPolicy(EvictionPolicy.DELETE) + .withAllocationStrategy(SpotAllocationStrategy.LOWEST_PRICE)) + .withVmSizesProfile(Arrays.asList(new VmSizeProfile().withName("Standard_D4s_v3"))) + .withComputeProfile(new ComputeProfile() + .withBaseVirtualMachineProfile(new BaseVirtualMachineProfile() + .withStorageProfile(new VirtualMachineScaleSetStorageProfile() + .withImageReference(new ImageReference().withPublisher("canonical") + .withOffer("ubuntu-24_04-lts") + .withSku("server") + .withVersion("latest")) + .withOsDisk(new VirtualMachineScaleSetOSDisk() + .withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters() + .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)) + .withOsType(OperatingSystemTypes.LINUX) + .withDiskSizeGB(30) + .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) + .withDeleteOption(DiskDeleteOptionTypes.DELETE) + .withCaching(CachingTypes.READ_WRITE)) + .withDiskControllerType(DiskControllerTypes.SCSI)) + .withOsProfile(new VirtualMachineScaleSetOSProfile().withComputerNamePrefix(randomPadding()) + .withAdminUsername(adminUser) + .withAdminPassword(adminPwd) + .withLinuxConfiguration( + new LinuxConfiguration().withDisablePasswordAuthentication(false))) + .withNetworkProfile( + new VirtualMachineScaleSetNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays.asList(new VirtualMachineScaleSetNetworkConfiguration().withName(vmName) + .withProperties(new VirtualMachineScaleSetNetworkConfigurationProperties() + .withPrimary(true) + .withEnableAcceleratedNetworking(false) + .withDeleteOption(DeleteOptions.DELETE) + .withIpConfigurations(Arrays + .asList(new VirtualMachineScaleSetIPConfiguration().withName(vmName) + .withProperties( + new VirtualMachineScaleSetIPConfigurationProperties() + .withPrimary(true) + .withSubnet(new ApiEntityReference() + .withId(network.subnets().get("default").id())) + .withLoadBalancerBackendAddressPools( + loadBalancer.loadBalancingRules() + .get(loadBalancerName + "-lbrule") + .innerModel() + .backendAddressPools()))))))) + .withNetworkApiVersion(NetworkApiVersion.fromString("2024-03-01")))) + .withComputeApiVersion("2024-03-01") + .withPlatformFaultDomainCount(1)) + .withRegularPriorityProfile(new RegularPriorityProfile() + .withAllocationStrategy(RegularPriorityAllocationStrategy.LOWEST_PRICE) + .withMinCapacity(1) + .withCapacity(2))) .create(); ``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/computefleet/azure-resourcemanager-computefleet/SAMPLE.md) @@ -226,5 +185,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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/ - - diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/SAMPLE.md b/sdk/computefleet/azure-resourcemanager-computefleet/SAMPLE.md index df5eac7a8d92..94b2427bc8e4 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/SAMPLE.md +++ b/sdk/computefleet/azure-resourcemanager-computefleet/SAMPLE.md @@ -16,6 +16,70 @@ - [List](#operations_list) ### Fleets_CreateOrUpdate +```java +/** + * Samples for Fleets ListByResourceGroup. + */ +public final class FleetsListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-11-01/Fleets_ListByResourceGroup.json + */ + /** + * Sample code: Fleets_ListByResourceGroup. + * + * @param manager Entry point to ComputeFleetManager. + */ + public static void fleetsListByResourceGroup(com.azure.resourcemanager.computefleet.ComputeFleetManager manager) { + manager.fleets().listByResourceGroup("rgazurefleet", com.azure.core.util.Context.NONE); + } +} +``` + +### Fleets_Delete + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2024-11-01/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to ComputeFleetManager. + */ + public static void operationsList(com.azure.resourcemanager.computefleet.ComputeFleetManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Fleets_GetByResourceGroup + +```java +/** + * Samples for Fleets ListVirtualMachineScaleSets. + */ +public final class FleetsListVirtualMachineScaleSetsSamples { + /* + * x-ms-original-file: 2024-11-01/Fleets_ListVirtualMachineScaleSets.json + */ + /** + * Sample code: Fleets_ListVirtualMachineScaleSets. + * + * @param manager Entry point to ComputeFleetManager. + */ + public static void + fleetsListVirtualMachineScaleSets(com.azure.resourcemanager.computefleet.ComputeFleetManager manager) { + manager.fleets().listVirtualMachineScaleSets("rgazurefleet", "myFleet", com.azure.core.util.Context.NONE); + } +} +``` + +### Fleets_List + ```java import com.azure.core.management.SubResource; import com.azure.resourcemanager.computefleet.models.AdditionalUnattendContent; @@ -466,7 +530,7 @@ public final class FleetsCreateOrUpdateSamples { } ``` -### Fleets_Delete +### Fleets_ListByResourceGroup ```java /** @@ -487,28 +551,7 @@ public final class FleetsDeleteSamples { } ``` -### Fleets_GetByResourceGroup - -```java -/** - * Samples for Fleets GetByResourceGroup. - */ -public final class FleetsGetByResourceGroupSamples { - /* - * x-ms-original-file: 2024-11-01/Fleets_Get.json - */ - /** - * Sample code: Fleets_Get. - * - * @param manager Entry point to ComputeFleetManager. - */ - public static void fleetsGet(com.azure.resourcemanager.computefleet.ComputeFleetManager manager) { - manager.fleets().getByResourceGroupWithResponse("rgazurefleet", "testFleet", com.azure.core.util.Context.NONE); - } -} -``` - -### Fleets_List +### Fleets_ListVirtualMachineScaleSets ```java /** @@ -529,49 +572,6 @@ public final class FleetsListSamples { } ``` -### Fleets_ListByResourceGroup - -```java -/** - * Samples for Fleets ListByResourceGroup. - */ -public final class FleetsListByResourceGroupSamples { - /* - * x-ms-original-file: 2024-11-01/Fleets_ListByResourceGroup.json - */ - /** - * Sample code: Fleets_ListByResourceGroup. - * - * @param manager Entry point to ComputeFleetManager. - */ - public static void fleetsListByResourceGroup(com.azure.resourcemanager.computefleet.ComputeFleetManager manager) { - manager.fleets().listByResourceGroup("rgazurefleet", com.azure.core.util.Context.NONE); - } -} -``` - -### Fleets_ListVirtualMachineScaleSets - -```java -/** - * Samples for Fleets ListVirtualMachineScaleSets. - */ -public final class FleetsListVirtualMachineScaleSetsSamples { - /* - * x-ms-original-file: 2024-11-01/Fleets_ListVirtualMachineScaleSets.json - */ - /** - * Sample code: Fleets_ListVirtualMachineScaleSets. - * - * @param manager Entry point to ComputeFleetManager. - */ - public static void - fleetsListVirtualMachineScaleSets(com.azure.resourcemanager.computefleet.ComputeFleetManager manager) { - manager.fleets().listVirtualMachineScaleSets("rgazurefleet", "myFleet", com.azure.core.util.Context.NONE); - } -} -``` - ### Fleets_Update ```java @@ -963,19 +963,19 @@ public final class FleetsUpdateSamples { ```java /** - * Samples for Operations List. + * Samples for Fleets GetByResourceGroup. */ -public final class OperationsListSamples { +public final class FleetsGetByResourceGroupSamples { /* - * x-ms-original-file: 2024-11-01/Operations_List.json + * x-ms-original-file: 2024-11-01/Fleets_Get.json */ /** - * Sample code: Operations_List. + * Sample code: Fleets_Get. * * @param manager Entry point to ComputeFleetManager. */ - public static void operationsList(com.azure.resourcemanager.computefleet.ComputeFleetManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void fleetsGet(com.azure.resourcemanager.computefleet.ComputeFleetManager manager) { + manager.fleets().getByResourceGroupWithResponse("rgazurefleet", "testFleet", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/tsp-location.yaml b/sdk/computefleet/azure-resourcemanager-computefleet/tsp-location.yaml index 085e0b510664..1c7dec5c5074 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/tsp-location.yaml +++ b/sdk/computefleet/azure-resourcemanager-computefleet/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/azurefleet/AzureFleet.Management -commit: 6f175c9c006269a1d0f1928fbc768cacc6ac379a +commit: 6e702986ee542ebd38d0ab2e2f2c00ab48a50b45 repo: Azure/azure-rest-api-specs additionalDirectories: