From 6a9465a4e73ee0ac7105e0e9f6d0cba939a3730c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 8 Apr 2025 18:13:40 +0000 Subject: [PATCH] CodeGen from PR 33705 in Azure/azure-rest-api-specs Merge 52bb68f3a0021fbae9ac90dccfa9acb9972aa203 into 9a473897a3bb0592f70e6fd897b184d53b60183e --- .../CHANGELOG.md | 56 ++- .../README.md | 47 +- .../SAMPLE.md | 462 +++++++++--------- .../azure-resourcemanager-standbypool/pom.xml | 20 +- .../tsp-location.yaml | 2 +- 5 files changed, 338 insertions(+), 249 deletions(-) diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/CHANGELOG.md b/sdk/standbypool/azure-resourcemanager-standbypool/CHANGELOG.md index 62b558c58bc5..9804721f37fa 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/CHANGELOG.md +++ b/sdk/standbypool/azure-resourcemanager-standbypool/CHANGELOG.md @@ -1,14 +1,62 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2025-04-08) -### Features Added +- Azure Resource Manager Standby Pool client library for Java. This package contains Microsoft Azure SDK for Standby Pool Management SDK. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.PoolResourceStateCount` was removed + +#### `StandbyPoolManager` was modified + +* `fluent.StandbyPoolClient serviceClient()` -> `fluent.StandbyPoolManagementClient serviceClient()` + +### Features Added + +* `models.PoolVirtualMachineState` was added + +* `models.StandbyVirtualMachinePoolForecastValues` was added + +* `models.HealthStateCode` was added + +* `models.StandbyVirtualMachinePoolPrediction` was added + +* `models.PoolContainerGroupState` was added + +* `models.PoolContainerGroupStateCount` was added + +* `models.PoolStatus` was added + +* `models.PoolVirtualMachineStateCount` was added + +* `models.StandbyContainerGroupPoolForecastValues` was added + +* `models.StandbyContainerGroupPoolPrediction` was added + +#### `models.StandbyContainerGroupPoolResourceProperties` was modified + +* `zones()` was added +* `withZones(java.util.List)` was added + +#### `models.StandbyVirtualMachinePoolRuntimeViewResourceProperties` was modified + +* `status()` was added +* `prediction()` was added + +#### `models.ContainerGroupInstanceCountSummary` was modified + +* `zone()` was added + +#### `models.StandbyContainerGroupPoolResourceUpdateProperties` was modified + +* `withZones(java.util.List)` was added +* `zones()` was added + +#### `models.StandbyContainerGroupPoolRuntimeViewResourceProperties` was modified -### Other Changes +* `prediction()` was added +* `status()` was added ## 1.0.0 (2024-09-25) diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/README.md b/sdk/standbypool/azure-resourcemanager-standbypool/README.md index f7b0a5f5ed75..b5f8692c3ee1 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/README.md +++ b/sdk/standbypool/azure-resourcemanager-standbypool/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 @@ StandbyPoolManager manager = StandbyPoolManager .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. @@ -70,6 +70,47 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +```java +// reference https://learn.microsoft.com/azure/virtual-machine-scale-sets/standby-pools-create + +// Create virtual network and virtual machine scale set +virtualNetwork = this.computeManager.networkManager() + .networks() + .define("vmssvnet") + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withAddressSpace("10.0.0.0/27") + .withSubnet("default", "10.0.0.0/27") + .create(); + +virtualMachineScaleSet = computeManager.virtualMachineScaleSets() + .define("vmss") + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withFlexibleOrchestrationMode() + .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_A0) + .withExistingPrimaryNetworkSubnet(virtualNetwork, "default") + .withoutPrimaryInternetFacingLoadBalancer() + .withoutPrimaryInternalLoadBalancer() + .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_18_04_LTS) + .withRootUsername("Foo12") + .withSsh(sshPublicKey()) + .withVirtualMachinePublicIp() + .withCapacity(3L) + .create(); + +// create standby virtual machine pool +standbyVirtualMachinePool = standbyPoolManager.standbyVirtualMachinePools() + .define(poolName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withProperties(new StandbyVirtualMachinePoolResourceProperties() + .withAttachedVirtualMachineScaleSetId(virtualMachineScaleSet.id()) + .withVirtualMachineState(VirtualMachineState.DEALLOCATED) + .withElasticityProfile(new StandbyVirtualMachinePoolElasticityProfile().withMaxReadyCapacity(3L) + .withMinReadyCapacity(1L))) + .create(); +``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/standbypool/azure-resourcemanager-standbypool/SAMPLE.md) @@ -100,5 +141,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/standbypool/azure-resourcemanager-standbypool/SAMPLE.md b/sdk/standbypool/azure-resourcemanager-standbypool/SAMPLE.md index a1ef7ec93f86..092c7e1c3954 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/SAMPLE.md +++ b/sdk/standbypool/azure-resourcemanager-standbypool/SAMPLE.md @@ -39,113 +39,48 @@ - [ListByStandbyVirtualMachinePoolResource](#standbyvirtualmachines_listbystandbyvirtualmachinepoolresource) ### Operations_List -```java -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: 2024-03-01/Operations_List.json - */ - /** - * Sample code: Operations_List. - * - * @param manager Entry point to StandbyPoolManager. - */ - public static void operationsList(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} -``` - -### StandbyContainerGroupPoolRuntimeViews_Get - -```java -/** - * Samples for StandbyContainerGroupPoolRuntimeViews Get. - */ -public final class StandbyContainerGroupPoolRuntimeViewsGetSamples { - /* - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json - */ - /** - * Sample code: StandbyContainerGroupPoolRuntimeViews_Get. - * - * @param manager Entry point to StandbyPoolManager. - */ - public static void - standbyContainerGroupPoolRuntimeViewsGet(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyContainerGroupPoolRuntimeViews() - .getWithResponse("rgstandbypool", "pool", "latest", com.azure.core.util.Context.NONE); - } -} -``` - -### StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool - -```java -/** - * Samples for StandbyContainerGroupPoolRuntimeViews ListByStandbyPool. - */ -public final class StandbyContainerGroupPoolRuntimeViewsListByStandbyPoolSamples { - /* - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json - */ - /** - * Sample code: StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool. - * - * @param manager Entry point to StandbyPoolManager. - */ - public static void standbyContainerGroupPoolRuntimeViewsListByStandbyPool( - com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyContainerGroupPoolRuntimeViews() - .listByStandbyPool("rgstandbypool", "pool", com.azure.core.util.Context.NONE); - } -} -``` - -### StandbyContainerGroupPools_CreateOrUpdate - ```java import com.azure.resourcemanager.standbypool.models.ContainerGroupProfile; import com.azure.resourcemanager.standbypool.models.ContainerGroupProperties; import com.azure.resourcemanager.standbypool.models.RefillPolicy; import com.azure.resourcemanager.standbypool.models.StandbyContainerGroupPoolElasticityProfile; -import com.azure.resourcemanager.standbypool.models.StandbyContainerGroupPoolResourceProperties; +import com.azure.resourcemanager.standbypool.models.StandbyContainerGroupPoolResource; +import com.azure.resourcemanager.standbypool.models.StandbyContainerGroupPoolResourceUpdateProperties; import com.azure.resourcemanager.standbypool.models.Subnet; import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** - * Samples for StandbyContainerGroupPools CreateOrUpdate. + * Samples for StandbyContainerGroupPools Update. */ -public final class StandbyContainerGroupPoolsCreateOrUpdateSamples { +public final class StandbyContainerGroupPoolsUpdateSamples { /* - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_CreateOrUpdate.json + * x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_Update.json */ /** - * Sample code: StandbyContainerGroupPools_CreateOrUpdate. + * Sample code: StandbyContainerGroupPools_Update. * * @param manager Entry point to StandbyPoolManager. */ public static void - standbyContainerGroupPoolsCreateOrUpdate(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyContainerGroupPools() - .define("pool") - .withRegion("West US") - .withExistingResourceGroup("rgstandbypool") + standbyContainerGroupPoolsUpdate(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + StandbyContainerGroupPoolResource resource = manager.standbyContainerGroupPools() + .getByResourceGroupWithResponse("rgstandbypool", "pool", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf()) - .withProperties(new StandbyContainerGroupPoolResourceProperties() - .withElasticityProfile(new StandbyContainerGroupPoolElasticityProfile().withMaxReadyCapacity(688L) + .withProperties(new StandbyContainerGroupPoolResourceUpdateProperties() + .withElasticityProfile(new StandbyContainerGroupPoolElasticityProfile().withMaxReadyCapacity(1743L) .withRefillPolicy(RefillPolicy.ALWAYS)) .withContainerGroupProperties(new ContainerGroupProperties() .withContainerGroupProfile(new ContainerGroupProfile().withId( "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile") - .withRevision(1L)) + .withRevision(2L)) .withSubnetIds(Arrays.asList(new Subnet().withId( - "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet"))))) - .create(); + "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet")))) + .withZones(Arrays.asList("1", "2", "3"))) + .apply(); } // Use "Map.of" if available @@ -162,136 +97,109 @@ public final class StandbyContainerGroupPoolsCreateOrUpdateSamples { } ``` -### StandbyContainerGroupPools_Delete +### StandbyContainerGroupPoolRuntimeViews_Get ```java /** - * Samples for StandbyContainerGroupPools Delete. + * Samples for StandbyContainerGroupPoolRuntimeViews Get. */ -public final class StandbyContainerGroupPoolsDeleteSamples { +public final class StandbyContainerGroupPoolRuntimeViewsGetSamples { /* - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Delete.json + * x-ms-original-file: 2025-03-01/StandbyContainerGroupPoolRuntimeViews_Get.json */ /** - * Sample code: StandbyContainerGroupPools_Delete. + * Sample code: StandbyContainerGroupPoolRuntimeViews_Get. * * @param manager Entry point to StandbyPoolManager. */ public static void - standbyContainerGroupPoolsDelete(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyContainerGroupPools().delete("rgstandbypool", "pool", com.azure.core.util.Context.NONE); - } -} -``` - -### StandbyContainerGroupPools_GetByResourceGroup - -```java -/** - * Samples for StandbyContainerGroupPools GetByResourceGroup. - */ -public final class StandbyContainerGroupPoolsGetByResourceGroupSamples { - /* - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Get.json - */ - /** - * Sample code: StandbyContainerGroupPools_Get. - * - * @param manager Entry point to StandbyPoolManager. - */ - public static void standbyContainerGroupPoolsGet(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyContainerGroupPools() - .getByResourceGroupWithResponse("rgstandbypool", "pool", com.azure.core.util.Context.NONE); + standbyContainerGroupPoolRuntimeViewsGet(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyContainerGroupPoolRuntimeViews() + .getWithResponse("rgstandbypool", "pool", "latest", com.azure.core.util.Context.NONE); } } ``` -### StandbyContainerGroupPools_List +### StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool ```java /** - * Samples for StandbyContainerGroupPools List. + * Samples for StandbyContainerGroupPools Delete. */ -public final class StandbyContainerGroupPoolsListSamples { +public final class StandbyContainerGroupPoolsDeleteSamples { /* - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListBySubscription.json + * x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_Delete.json */ /** - * Sample code: StandbyContainerGroupPools_ListBySubscription. + * Sample code: StandbyContainerGroupPools_Delete. * * @param manager Entry point to StandbyPoolManager. */ public static void - standbyContainerGroupPoolsListBySubscription(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyContainerGroupPools().list(com.azure.core.util.Context.NONE); + standbyContainerGroupPoolsDelete(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyContainerGroupPools().delete("rgstandbypool", "pool", com.azure.core.util.Context.NONE); } } ``` -### StandbyContainerGroupPools_ListByResourceGroup +### StandbyContainerGroupPools_CreateOrUpdate ```java /** - * Samples for StandbyContainerGroupPools ListByResourceGroup. + * Samples for StandbyVirtualMachines ListByStandbyVirtualMachinePoolResource. */ -public final class StandbyContainerGroupPoolsListByResourceGroupSamples { +public final class StandbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSamples { /* - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_ListByResourceGroup.json + * x-ms-original-file: 2025-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json */ /** - * Sample code: StandbyContainerGroupPools_ListByResourceGroup. + * Sample code: StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource. * * @param manager Entry point to StandbyPoolManager. */ - public static void standbyContainerGroupPoolsListByResourceGroup( + public static void standbyVirtualMachinesListByStandbyVirtualMachinePoolResource( com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyContainerGroupPools().listByResourceGroup("rgstandbypool", com.azure.core.util.Context.NONE); + manager.standbyVirtualMachines() + .listByStandbyVirtualMachinePoolResource("rgstandbypool", "pool", com.azure.core.util.Context.NONE); } } ``` -### StandbyContainerGroupPools_Update +### StandbyContainerGroupPools_Delete ```java -import com.azure.resourcemanager.standbypool.models.ContainerGroupProfile; -import com.azure.resourcemanager.standbypool.models.ContainerGroupProperties; -import com.azure.resourcemanager.standbypool.models.RefillPolicy; -import com.azure.resourcemanager.standbypool.models.StandbyContainerGroupPoolElasticityProfile; -import com.azure.resourcemanager.standbypool.models.StandbyContainerGroupPoolResource; -import com.azure.resourcemanager.standbypool.models.StandbyContainerGroupPoolResourceUpdateProperties; -import com.azure.resourcemanager.standbypool.models.Subnet; -import java.util.Arrays; +import com.azure.resourcemanager.standbypool.models.StandbyVirtualMachinePoolElasticityProfile; +import com.azure.resourcemanager.standbypool.models.StandbyVirtualMachinePoolResource; +import com.azure.resourcemanager.standbypool.models.StandbyVirtualMachinePoolResourceUpdateProperties; +import com.azure.resourcemanager.standbypool.models.VirtualMachineState; import java.util.HashMap; import java.util.Map; /** - * Samples for StandbyContainerGroupPools Update. + * Samples for StandbyVirtualMachinePools Update. */ -public final class StandbyContainerGroupPoolsUpdateSamples { +public final class StandbyVirtualMachinePoolsUpdateSamples { /* - * x-ms-original-file: 2024-03-01/StandbyContainerGroupPools_Update.json + * x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_Update.json */ /** - * Sample code: StandbyContainerGroupPools_Update. + * Sample code: StandbyVirtualMachinePools_Update. * * @param manager Entry point to StandbyPoolManager. */ public static void - standbyContainerGroupPoolsUpdate(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - StandbyContainerGroupPoolResource resource = manager.standbyContainerGroupPools() + standbyVirtualMachinePoolsUpdate(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + StandbyVirtualMachinePoolResource resource = manager.standbyVirtualMachinePools() .getByResourceGroupWithResponse("rgstandbypool", "pool", com.azure.core.util.Context.NONE) .getValue(); resource.update() .withTags(mapOf()) - .withProperties(new StandbyContainerGroupPoolResourceUpdateProperties() - .withElasticityProfile(new StandbyContainerGroupPoolElasticityProfile().withMaxReadyCapacity(1743L) - .withRefillPolicy(RefillPolicy.ALWAYS)) - .withContainerGroupProperties(new ContainerGroupProperties() - .withContainerGroupProfile(new ContainerGroupProfile().withId( - "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile") - .withRevision(2L)) - .withSubnetIds(Arrays.asList(new Subnet().withId( - "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet"))))) + .withProperties(new StandbyVirtualMachinePoolResourceUpdateProperties() + .withElasticityProfile(new StandbyVirtualMachinePoolElasticityProfile().withMaxReadyCapacity(304L) + .withMinReadyCapacity(300L)) + .withVirtualMachineState(VirtualMachineState.RUNNING) + .withAttachedVirtualMachineScaleSetId( + "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss")) .apply(); } @@ -309,53 +217,50 @@ public final class StandbyContainerGroupPoolsUpdateSamples { } ``` -### StandbyVirtualMachinePoolRuntimeViews_Get +### StandbyContainerGroupPools_GetByResourceGroup ```java /** - * Samples for StandbyVirtualMachinePoolRuntimeViews Get. + * Samples for StandbyContainerGroupPools GetByResourceGroup. */ -public final class StandbyVirtualMachinePoolRuntimeViewsGetSamples { +public final class StandbyContainerGroupPoolsGetByResourceGroupSamples { /* - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json + * x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_Get.json */ /** - * Sample code: StandbyVirtualMachinePoolRuntimeViews_Get. + * Sample code: StandbyContainerGroupPools_Get. * * @param manager Entry point to StandbyPoolManager. */ - public static void - standbyVirtualMachinePoolRuntimeViewsGet(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyVirtualMachinePoolRuntimeViews() - .getWithResponse("rgstandbypool", "pool", "latest", com.azure.core.util.Context.NONE); + public static void standbyContainerGroupPoolsGet(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyContainerGroupPools() + .getByResourceGroupWithResponse("rgstandbypool", "pool", com.azure.core.util.Context.NONE); } } ``` -### StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool +### StandbyContainerGroupPools_List ```java /** - * Samples for StandbyVirtualMachinePoolRuntimeViews ListByStandbyPool. + * Samples for Operations List. */ -public final class StandbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSamples { +public final class OperationsListSamples { /* - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json + * x-ms-original-file: 2025-03-01/Operations_List.json */ /** - * Sample code: StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool. + * Sample code: Operations_List. * * @param manager Entry point to StandbyPoolManager. */ - public static void standbyVirtualMachinePoolRuntimeViewsListByStandbyPool( - com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyVirtualMachinePoolRuntimeViews() - .listByStandbyPool("rgstandbypool", "pool", com.azure.core.util.Context.NONE); + public static void operationsList(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### StandbyVirtualMachinePools_CreateOrUpdate +### StandbyContainerGroupPools_ListByResourceGroup ```java import com.azure.resourcemanager.standbypool.models.StandbyVirtualMachinePoolElasticityProfile; @@ -369,7 +274,7 @@ import java.util.Map; */ public final class StandbyVirtualMachinePoolsCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json + * x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_CreateOrUpdate.json */ /** * Sample code: StandbyVirtualMachinePools_CreateOrUpdate. @@ -406,51 +311,118 @@ public final class StandbyVirtualMachinePoolsCreateOrUpdateSamples { } ``` -### StandbyVirtualMachinePools_Delete +### StandbyContainerGroupPools_Update ```java /** - * Samples for StandbyVirtualMachinePools Delete. + * Samples for StandbyContainerGroupPools List. */ -public final class StandbyVirtualMachinePoolsDeleteSamples { +public final class StandbyContainerGroupPoolsListSamples { /* - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Delete.json + * x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_ListBySubscription.json */ /** - * Sample code: StandbyVirtualMachinePools_Delete. + * Sample code: StandbyContainerGroupPools_ListBySubscription. * * @param manager Entry point to StandbyPoolManager. */ public static void - standbyVirtualMachinePoolsDelete(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyVirtualMachinePools().delete("rgstandbypool", "pool", com.azure.core.util.Context.NONE); + standbyContainerGroupPoolsListBySubscription(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyContainerGroupPools().list(com.azure.core.util.Context.NONE); } } ``` -### StandbyVirtualMachinePools_GetByResourceGroup +### StandbyVirtualMachinePoolRuntimeViews_Get ```java /** - * Samples for StandbyVirtualMachinePools GetByResourceGroup. + * Samples for StandbyContainerGroupPools ListByResourceGroup. */ -public final class StandbyVirtualMachinePoolsGetByResourceGroupSamples { +public final class StandbyContainerGroupPoolsListByResourceGroupSamples { /* - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Get.json + * x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_ListByResourceGroup.json */ /** - * Sample code: StandbyVirtualMachinePools_Get. + * Sample code: StandbyContainerGroupPools_ListByResourceGroup. * * @param manager Entry point to StandbyPoolManager. */ - public static void standbyVirtualMachinePoolsGet(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyVirtualMachinePools() - .getByResourceGroupWithResponse("rgstandbypool", "pool", com.azure.core.util.Context.NONE); + public static void standbyContainerGroupPoolsListByResourceGroup( + com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyContainerGroupPools().listByResourceGroup("rgstandbypool", com.azure.core.util.Context.NONE); } } ``` -### StandbyVirtualMachinePools_List +### StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool + +```java +/** + * Samples for StandbyVirtualMachinePools ListByResourceGroup. + */ +public final class StandbyVirtualMachinePoolsListByResourceGroupSamples { + /* + * x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json + */ + /** + * Sample code: StandbyVirtualMachinePools_ListByResourceGroup. + * + * @param manager Entry point to StandbyPoolManager. + */ + public static void standbyVirtualMachinePoolsListByResourceGroup( + com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyVirtualMachinePools().listByResourceGroup("rgstandbypool", com.azure.core.util.Context.NONE); + } +} +``` + +### StandbyVirtualMachinePools_CreateOrUpdate + +```java +/** + * Samples for StandbyVirtualMachines Get. + */ +public final class StandbyVirtualMachinesGetSamples { + /* + * x-ms-original-file: 2025-03-01/StandbyVirtualMachines_Get.json + */ + /** + * Sample code: StandbyVirtualMachines_Get. + * + * @param manager Entry point to StandbyPoolManager. + */ + public static void standbyVirtualMachinesGet(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyVirtualMachines() + .getWithResponse("rgstandbypool", "pool", "virtualMachine", com.azure.core.util.Context.NONE); + } +} +``` + +### StandbyVirtualMachinePools_Delete + +```java +/** + * Samples for StandbyVirtualMachinePoolRuntimeViews ListByStandbyPool. + */ +public final class StandbyVirtualMachinePoolRuntimeViewsListByStandbyPoolSamples { + /* + * x-ms-original-file: 2025-03-01/StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool.json + */ + /** + * Sample code: StandbyVirtualMachinePoolRuntimeViews_ListByStandbyPool. + * + * @param manager Entry point to StandbyPoolManager. + */ + public static void standbyVirtualMachinePoolRuntimeViewsListByStandbyPool( + com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyVirtualMachinePoolRuntimeViews() + .listByStandbyPool("rgstandbypool", "pool", com.azure.core.util.Context.NONE); + } +} +``` + +### StandbyVirtualMachinePools_GetByResourceGroup ```java /** @@ -458,7 +430,7 @@ public final class StandbyVirtualMachinePoolsGetByResourceGroupSamples { */ public final class StandbyVirtualMachinePoolsListSamples { /* - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListBySubscription.json + * x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_ListBySubscription.json */ /** * Sample code: StandbyVirtualMachinePools_ListBySubscription. @@ -472,64 +444,72 @@ public final class StandbyVirtualMachinePoolsListSamples { } ``` -### StandbyVirtualMachinePools_ListByResourceGroup +### StandbyVirtualMachinePools_List ```java /** - * Samples for StandbyVirtualMachinePools ListByResourceGroup. + * Samples for StandbyVirtualMachinePoolRuntimeViews Get. */ -public final class StandbyVirtualMachinePoolsListByResourceGroupSamples { +public final class StandbyVirtualMachinePoolRuntimeViewsGetSamples { /* - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_ListByResourceGroup.json + * x-ms-original-file: 2025-03-01/StandbyVirtualMachinePoolRuntimeViews_Get.json */ /** - * Sample code: StandbyVirtualMachinePools_ListByResourceGroup. + * Sample code: StandbyVirtualMachinePoolRuntimeViews_Get. * * @param manager Entry point to StandbyPoolManager. */ - public static void standbyVirtualMachinePoolsListByResourceGroup( - com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyVirtualMachinePools().listByResourceGroup("rgstandbypool", com.azure.core.util.Context.NONE); + public static void + standbyVirtualMachinePoolRuntimeViewsGet(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyVirtualMachinePoolRuntimeViews() + .getWithResponse("rgstandbypool", "pool", "latest", com.azure.core.util.Context.NONE); } } ``` -### StandbyVirtualMachinePools_Update +### StandbyVirtualMachinePools_ListByResourceGroup ```java -import com.azure.resourcemanager.standbypool.models.StandbyVirtualMachinePoolElasticityProfile; -import com.azure.resourcemanager.standbypool.models.StandbyVirtualMachinePoolResource; -import com.azure.resourcemanager.standbypool.models.StandbyVirtualMachinePoolResourceUpdateProperties; -import com.azure.resourcemanager.standbypool.models.VirtualMachineState; +import com.azure.resourcemanager.standbypool.models.ContainerGroupProfile; +import com.azure.resourcemanager.standbypool.models.ContainerGroupProperties; +import com.azure.resourcemanager.standbypool.models.RefillPolicy; +import com.azure.resourcemanager.standbypool.models.StandbyContainerGroupPoolElasticityProfile; +import com.azure.resourcemanager.standbypool.models.StandbyContainerGroupPoolResourceProperties; +import com.azure.resourcemanager.standbypool.models.Subnet; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** - * Samples for StandbyVirtualMachinePools Update. + * Samples for StandbyContainerGroupPools CreateOrUpdate. */ -public final class StandbyVirtualMachinePoolsUpdateSamples { +public final class StandbyContainerGroupPoolsCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-03-01/StandbyVirtualMachinePools_Update.json + * x-ms-original-file: 2025-03-01/StandbyContainerGroupPools_CreateOrUpdate.json */ /** - * Sample code: StandbyVirtualMachinePools_Update. + * Sample code: StandbyContainerGroupPools_CreateOrUpdate. * * @param manager Entry point to StandbyPoolManager. */ public static void - standbyVirtualMachinePoolsUpdate(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - StandbyVirtualMachinePoolResource resource = manager.standbyVirtualMachinePools() - .getByResourceGroupWithResponse("rgstandbypool", "pool", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() + standbyContainerGroupPoolsCreateOrUpdate(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyContainerGroupPools() + .define("pool") + .withRegion("West US") + .withExistingResourceGroup("rgstandbypool") .withTags(mapOf()) - .withProperties(new StandbyVirtualMachinePoolResourceUpdateProperties() - .withElasticityProfile(new StandbyVirtualMachinePoolElasticityProfile().withMaxReadyCapacity(304L) - .withMinReadyCapacity(300L)) - .withVirtualMachineState(VirtualMachineState.RUNNING) - .withAttachedVirtualMachineScaleSetId( - "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss")) - .apply(); + .withProperties(new StandbyContainerGroupPoolResourceProperties() + .withElasticityProfile(new StandbyContainerGroupPoolElasticityProfile().withMaxReadyCapacity(688L) + .withRefillPolicy(RefillPolicy.ALWAYS)) + .withContainerGroupProperties(new ContainerGroupProperties() + .withContainerGroupProfile(new ContainerGroupProfile().withId( + "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.ContainerInstance/containerGroupProfiles/cgProfile") + .withRevision(1L)) + .withSubnetIds(Arrays.asList(new Subnet().withId( + "/subscriptions/00000000-0000-0000-0000-000000000009/resourceGroups/rgstandbypool/providers/Microsoft.Network/virtualNetworks/cgSubnet/subnets/cgSubnet")))) + .withZones(Arrays.asList("1", "2", "3"))) + .create(); } // Use "Map.of" if available @@ -546,24 +526,47 @@ public final class StandbyVirtualMachinePoolsUpdateSamples { } ``` +### StandbyVirtualMachinePools_Update + +```java +/** + * Samples for StandbyVirtualMachinePools Delete. + */ +public final class StandbyVirtualMachinePoolsDeleteSamples { + /* + * x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_Delete.json + */ + /** + * Sample code: StandbyVirtualMachinePools_Delete. + * + * @param manager Entry point to StandbyPoolManager. + */ + public static void + standbyVirtualMachinePoolsDelete(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyVirtualMachinePools().delete("rgstandbypool", "pool", com.azure.core.util.Context.NONE); + } +} +``` + ### StandbyVirtualMachines_Get ```java /** - * Samples for StandbyVirtualMachines Get. + * Samples for StandbyContainerGroupPoolRuntimeViews ListByStandbyPool. */ -public final class StandbyVirtualMachinesGetSamples { +public final class StandbyContainerGroupPoolRuntimeViewsListByStandbyPoolSamples { /* - * x-ms-original-file: 2024-03-01/StandbyVirtualMachines_Get.json + * x-ms-original-file: 2025-03-01/StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool.json */ /** - * Sample code: StandbyVirtualMachines_Get. + * Sample code: StandbyContainerGroupPoolRuntimeViews_ListByStandbyPool. * * @param manager Entry point to StandbyPoolManager. */ - public static void standbyVirtualMachinesGet(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyVirtualMachines() - .getWithResponse("rgstandbypool", "pool", "virtualMachine", com.azure.core.util.Context.NONE); + public static void standbyContainerGroupPoolRuntimeViewsListByStandbyPool( + com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyContainerGroupPoolRuntimeViews() + .listByStandbyPool("rgstandbypool", "pool", com.azure.core.util.Context.NONE); } } ``` @@ -572,21 +575,20 @@ public final class StandbyVirtualMachinesGetSamples { ```java /** - * Samples for StandbyVirtualMachines ListByStandbyVirtualMachinePoolResource. + * Samples for StandbyVirtualMachinePools GetByResourceGroup. */ -public final class StandbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSamples { +public final class StandbyVirtualMachinePoolsGetByResourceGroupSamples { /* - * x-ms-original-file: 2024-03-01/StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource.json + * x-ms-original-file: 2025-03-01/StandbyVirtualMachinePools_Get.json */ /** - * Sample code: StandbyVirtualMachines_ListByStandbyVirtualMachinePoolResource. + * Sample code: StandbyVirtualMachinePools_Get. * * @param manager Entry point to StandbyPoolManager. */ - public static void standbyVirtualMachinesListByStandbyVirtualMachinePoolResource( - com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { - manager.standbyVirtualMachines() - .listByStandbyVirtualMachinePoolResource("rgstandbypool", "pool", com.azure.core.util.Context.NONE); + public static void standbyVirtualMachinePoolsGet(com.azure.resourcemanager.standbypool.StandbyPoolManager manager) { + manager.standbyVirtualMachinePools() + .getByResourceGroupWithResponse("rgstandbypool", "pool", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/pom.xml b/sdk/standbypool/azure-resourcemanager-standbypool/pom.xml index 5d8c0119ab5a..eecd4636c829 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/pom.xml +++ b/sdk/standbypool/azure-resourcemanager-standbypool/pom.xml @@ -48,11 +48,6 @@ true - - com.azure - azure-json - 1.5.0 - com.azure azure-core @@ -70,15 +65,20 @@ test - com.azure.resourcemanager - azure-resourcemanager-compute - 2.49.0 + com.azure + azure-identity + 1.15.4 test com.azure - azure-identity - 1.15.4 + azure-json + 1.5.0 + + + com.azure.resourcemanager + azure-resourcemanager-compute + 2.49.0 test diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/tsp-location.yaml b/sdk/standbypool/azure-resourcemanager-standbypool/tsp-location.yaml index f05d47381517..a637b15a7074 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/tsp-location.yaml +++ b/sdk/standbypool/azure-resourcemanager-standbypool/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/standbypool/StandbyPool.Management -commit: 6f175c9c006269a1d0f1928fbc768cacc6ac379a +commit: 1009e3544b0d6e2023809f8c5ca81354bf1651e9 repo: Azure/azure-rest-api-specs additionalDirectories: