Skip to content

Commit

Permalink
CodeGen from PR 31907 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 2e40823fc42f3faa4698db4d19cb342c2464ab51 into 400c11792452dcb27582223863171cd596680a58
  • Loading branch information
SDKAuto committed Dec 17, 2024
1 parent 7911bf2 commit d6ccaf2
Show file tree
Hide file tree
Showing 17 changed files with 126 additions and 92 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Release History

## 1.1.0-beta.1 (Unreleased)
## 1.0.0-beta.1 (2024-12-17)

### 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
#### `StandbyPoolManager` was modified

### Other Changes
* `fluent.StandbyPoolClient serviceClient()` -> `fluent.StandbyPoolManagementClient serviceClient()`

## 1.0.0 (2024-09-25)

Expand Down
43 changes: 42 additions & 1 deletion sdk/standbypool/azure-resourcemanager-standbypool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-standbypool</artifactId>
<version>1.0.0</version>
<version>1.1.0-beta.1</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down Expand Up @@ -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)


Expand Down
21 changes: 11 additions & 10 deletions sdk/standbypool/azure-resourcemanager-standbypool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,9 @@
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<revapi.skip>true</revapi.skip>
<spotless.skip>false</spotless.skip>
</properties>
<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-json</artifactId>
<version>1.3.0</version> <!-- {x-version-update;com.azure:azure-json;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
Expand All @@ -70,15 +66,20 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-compute</artifactId>
<version>2.45.0</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-compute;dependency} -->
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.14.2</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.14.2</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
<artifactId>azure-json</artifactId>
<version>1.3.0</version> <!-- {x-version-update;com.azure:azure-json;dependency} -->
</dependency>
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-compute</artifactId>
<version>2.45.0</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-compute;dependency} -->
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.standbypool.fluent.StandbyPoolClient;
import com.azure.resourcemanager.standbypool.fluent.StandbyPoolManagementClient;
import com.azure.resourcemanager.standbypool.implementation.OperationsImpl;
import com.azure.resourcemanager.standbypool.implementation.StandbyContainerGroupPoolRuntimeViewsImpl;
import com.azure.resourcemanager.standbypool.implementation.StandbyContainerGroupPoolsImpl;
import com.azure.resourcemanager.standbypool.implementation.StandbyPoolClientBuilder;
import com.azure.resourcemanager.standbypool.implementation.StandbyPoolManagementClientBuilder;
import com.azure.resourcemanager.standbypool.implementation.StandbyVirtualMachinePoolRuntimeViewsImpl;
import com.azure.resourcemanager.standbypool.implementation.StandbyVirtualMachinePoolsImpl;
import com.azure.resourcemanager.standbypool.implementation.StandbyVirtualMachinesImpl;
Expand Down Expand Up @@ -60,12 +60,12 @@ public final class StandbyPoolManager {

private StandbyContainerGroupPoolRuntimeViews standbyContainerGroupPoolRuntimeViews;

private final StandbyPoolClient clientObject;
private final StandbyPoolManagementClient clientObject;

private StandbyPoolManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
this.clientObject = new StandbyPoolClientBuilder().pipeline(httpPipeline)
this.clientObject = new StandbyPoolManagementClientBuilder().pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
.subscriptionId(profile.getSubscriptionId())
.defaultPollInterval(defaultPollInterval)
Expand Down Expand Up @@ -348,12 +348,12 @@ public StandbyContainerGroupPoolRuntimeViews standbyContainerGroupPoolRuntimeVie
}

/**
* Gets wrapped service client StandbyPoolClient providing direct access to the underlying auto-generated API
* implementation, based on Azure REST API.
* Gets wrapped service client StandbyPoolManagementClient providing direct access to the underlying auto-generated
* API implementation, based on Azure REST API.
*
* @return Wrapped service client StandbyPoolClient.
* @return Wrapped service client StandbyPoolManagementClient.
*/
public StandbyPoolClient serviceClient() {
public StandbyPoolManagementClient serviceClient() {
return this.clientObject;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import java.time.Duration;

/**
* The interface for StandbyPoolClient class.
* The interface for StandbyPoolManagementClient class.
*/
public interface StandbyPoolClient {
public interface StandbyPoolManagementClient {
/**
* Gets Service host.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ public final class OperationsClientImpl implements OperationsClient {
/**
* The service client containing this operation class.
*/
private final StandbyPoolClientImpl client;
private final StandbyPoolManagementClientImpl client;

/**
* Initializes an instance of OperationsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
OperationsClientImpl(StandbyPoolClientImpl client) {
OperationsClientImpl(StandbyPoolManagementClientImpl client) {
this.service
= RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}

/**
* The interface defining all the services for StandbyPoolClientOperations to be used by the proxy service to
* perform REST calls.
* The interface defining all the services for StandbyPoolManagementClientOperations to be used by the proxy service
* to perform REST calls.
*/
@Host("{endpoint}")
@ServiceInterface(name = "StandbyPoolClientOpe")
@ServiceInterface(name = "StandbyPoolManagemen")
public interface OperationsService {
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.StandbyPool/operations")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,25 @@ public final class StandbyContainerGroupPoolRuntimeViewsClientImpl
/**
* The service client containing this operation class.
*/
private final StandbyPoolClientImpl client;
private final StandbyPoolManagementClientImpl client;

/**
* Initializes an instance of StandbyContainerGroupPoolRuntimeViewsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
StandbyContainerGroupPoolRuntimeViewsClientImpl(StandbyPoolClientImpl client) {
StandbyContainerGroupPoolRuntimeViewsClientImpl(StandbyPoolManagementClientImpl client) {
this.service = RestProxy.create(StandbyContainerGroupPoolRuntimeViewsService.class, client.getHttpPipeline(),
client.getSerializerAdapter());
this.client = client;
}

/**
* The interface defining all the services for StandbyPoolClientStandbyContainerGroupPoolRuntimeViews to be used by
* the proxy service to perform REST calls.
* The interface defining all the services for StandbyPoolManagementClientStandbyContainerGroupPoolRuntimeViews to
* be used by the proxy service to perform REST calls.
*/
@Host("{endpoint}")
@ServiceInterface(name = "StandbyPoolClientSta")
@ServiceInterface(name = "StandbyPoolManagemen")
public interface StandbyContainerGroupPoolRuntimeViewsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}/runtimeViews/{runtimeView}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,25 @@ public final class StandbyContainerGroupPoolsClientImpl implements StandbyContai
/**
* The service client containing this operation class.
*/
private final StandbyPoolClientImpl client;
private final StandbyPoolManagementClientImpl client;

/**
* Initializes an instance of StandbyContainerGroupPoolsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
StandbyContainerGroupPoolsClientImpl(StandbyPoolClientImpl client) {
StandbyContainerGroupPoolsClientImpl(StandbyPoolManagementClientImpl client) {
this.service = RestProxy.create(StandbyContainerGroupPoolsService.class, client.getHttpPipeline(),
client.getSerializerAdapter());
this.client = client;
}

/**
* The interface defining all the services for StandbyPoolClientStandbyContainerGroupPools to be used by the proxy
* service to perform REST calls.
* The interface defining all the services for StandbyPoolManagementClientStandbyContainerGroupPools to be used by
* the proxy service to perform REST calls.
*/
@Host("{endpoint}")
@ServiceInterface(name = "StandbyPoolClientSta")
@ServiceInterface(name = "StandbyPoolManagemen")
public interface StandbyContainerGroupPoolsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
import java.time.Duration;

/**
* A builder for creating a new instance of the StandbyPoolClientImpl type.
* A builder for creating a new instance of the StandbyPoolManagementClientImpl type.
*/
@ServiceClientBuilder(serviceClients = { StandbyPoolClientImpl.class })
public final class StandbyPoolClientBuilder {
@ServiceClientBuilder(serviceClients = { StandbyPoolManagementClientImpl.class })
public final class StandbyPoolManagementClientBuilder {
/*
* Service host
*/
Expand All @@ -28,9 +28,9 @@ public final class StandbyPoolClientBuilder {
* Sets Service host.
*
* @param endpoint the endpoint value.
* @return the StandbyPoolClientBuilder.
* @return the StandbyPoolManagementClientBuilder.
*/
public StandbyPoolClientBuilder endpoint(String endpoint) {
public StandbyPoolManagementClientBuilder endpoint(String endpoint) {
this.endpoint = endpoint;
return this;
}
Expand All @@ -44,9 +44,9 @@ public StandbyPoolClientBuilder endpoint(String endpoint) {
* Sets The ID of the target subscription. The value must be an UUID.
*
* @param subscriptionId the subscriptionId value.
* @return the StandbyPoolClientBuilder.
* @return the StandbyPoolManagementClientBuilder.
*/
public StandbyPoolClientBuilder subscriptionId(String subscriptionId) {
public StandbyPoolManagementClientBuilder subscriptionId(String subscriptionId) {
this.subscriptionId = subscriptionId;
return this;
}
Expand All @@ -60,9 +60,9 @@ public StandbyPoolClientBuilder subscriptionId(String subscriptionId) {
* Sets The environment to connect to.
*
* @param environment the environment value.
* @return the StandbyPoolClientBuilder.
* @return the StandbyPoolManagementClientBuilder.
*/
public StandbyPoolClientBuilder environment(AzureEnvironment environment) {
public StandbyPoolManagementClientBuilder environment(AzureEnvironment environment) {
this.environment = environment;
return this;
}
Expand All @@ -76,9 +76,9 @@ public StandbyPoolClientBuilder environment(AzureEnvironment environment) {
* Sets The HTTP pipeline to send requests through.
*
* @param pipeline the pipeline value.
* @return the StandbyPoolClientBuilder.
* @return the StandbyPoolManagementClientBuilder.
*/
public StandbyPoolClientBuilder pipeline(HttpPipeline pipeline) {
public StandbyPoolManagementClientBuilder pipeline(HttpPipeline pipeline) {
this.pipeline = pipeline;
return this;
}
Expand All @@ -92,9 +92,9 @@ public StandbyPoolClientBuilder pipeline(HttpPipeline pipeline) {
* Sets The default poll interval for long-running operation.
*
* @param defaultPollInterval the defaultPollInterval value.
* @return the StandbyPoolClientBuilder.
* @return the StandbyPoolManagementClientBuilder.
*/
public StandbyPoolClientBuilder defaultPollInterval(Duration defaultPollInterval) {
public StandbyPoolManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = defaultPollInterval;
return this;
}
Expand All @@ -108,19 +108,19 @@ public StandbyPoolClientBuilder defaultPollInterval(Duration defaultPollInterval
* Sets The serializer to serialize an object into a string.
*
* @param serializerAdapter the serializerAdapter value.
* @return the StandbyPoolClientBuilder.
* @return the StandbyPoolManagementClientBuilder.
*/
public StandbyPoolClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
public StandbyPoolManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
this.serializerAdapter = serializerAdapter;
return this;
}

/**
* Builds an instance of StandbyPoolClientImpl with the provided parameters.
* Builds an instance of StandbyPoolManagementClientImpl with the provided parameters.
*
* @return an instance of StandbyPoolClientImpl.
* @return an instance of StandbyPoolManagementClientImpl.
*/
public StandbyPoolClientImpl buildClient() {
public StandbyPoolManagementClientImpl buildClient() {
String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com";
AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE;
HttpPipeline localPipeline = (pipeline != null)
Expand All @@ -131,8 +131,8 @@ public StandbyPoolClientImpl buildClient() {
SerializerAdapter localSerializerAdapter = (serializerAdapter != null)
? serializerAdapter
: SerializerFactory.createDefaultManagementSerializerAdapter();
StandbyPoolClientImpl client = new StandbyPoolClientImpl(localPipeline, localSerializerAdapter,
localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId);
StandbyPoolManagementClientImpl client = new StandbyPoolManagementClientImpl(localPipeline,
localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId);
return client;
}
}
Loading

0 comments on commit d6ccaf2

Please sign in to comment.