From 4f89e2601e938f71fcb2cf820da632f96ff31ad7 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 21 Oct 2020 02:10:10 +0000 Subject: [PATCH] Generated from 9b33d7ca67d424c5f35e9ad9de82ab51951682a2 --- sdk/containerservice/mgmt-v2020_07_01/pom.xml | 4 +- .../v2020_07_01/AgentPools.java | 12 ++ .../v2020_07_01/ManagedClusters.java | 12 -- .../implementation/AgentPoolsImpl.java | 12 ++ .../implementation/AgentPoolsInner.java | 183 ++++++++++++++++++ .../implementation/ManagedClustersImpl.java | 13 -- .../implementation/ManagedClustersInner.java | 182 ----------------- 7 files changed, 209 insertions(+), 209 deletions(-) diff --git a/sdk/containerservice/mgmt-v2020_07_01/pom.xml b/sdk/containerservice/mgmt-v2020_07_01/pom.xml index d0dd4b3db391..38298649244e 100644 --- a/sdk/containerservice/mgmt-v2020_07_01/pom.xml +++ b/sdk/containerservice/mgmt-v2020_07_01/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.3.2 - ../../parents/azure-arm-parent/pom.xml + 1.1.0 + ../../../pom.management.xml azure-mgmt-containerservice 1.0.0-beta diff --git a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/AgentPools.java b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/AgentPools.java index c40927a15c15..959ebb91d4d9 100644 --- a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/AgentPools.java +++ b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/AgentPools.java @@ -18,6 +18,18 @@ * Type representing AgentPools. */ public interface AgentPools extends SupportsCreating, HasInner { + /** + * Upgrade node image version of an agent pool to the latest. + * Upgrade node image version of an agent pool to the latest. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName); + /** * Gets the agent pool. * Gets the details of the agent pool by managed cluster and resource group. diff --git a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/ManagedClusters.java b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/ManagedClusters.java index 60d7881f278d..f734d536cb07 100644 --- a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/ManagedClusters.java +++ b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/ManagedClusters.java @@ -114,16 +114,4 @@ public interface ManagedClusters extends SupportsCreating getAccessProfileAsync(String resourceGroupName, String resourceName, String roleName); - /** - * Upgrade node image version of an agent pool to the latest. - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName); - } diff --git a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/AgentPoolsImpl.java b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/AgentPoolsImpl.java index 377029f2b781..9582c22dc81a 100644 --- a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/AgentPoolsImpl.java +++ b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/AgentPoolsImpl.java @@ -44,6 +44,18 @@ private AgentPoolImpl wrapModel(String name) { return new AgentPoolImpl(name, this.manager()); } + @Override + public Observable upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) { + AgentPoolsInner client = this.inner(); + return client.upgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName) + .map(new Func1() { + @Override + public AgentPool call(AgentPoolInner inner) { + return new AgentPoolImpl(inner, manager()); + } + }); + } + @Override public Observable listAsync(final String resourceGroupName, final String resourceName) { AgentPoolsInner client = this.inner(); diff --git a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/AgentPoolsInner.java b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/AgentPoolsInner.java index 4e4e94cbd862..ae24d2855c5c 100644 --- a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/AgentPoolsInner.java +++ b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/AgentPoolsInner.java @@ -28,6 +28,7 @@ import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.Path; +import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.http.Url; @@ -93,6 +94,14 @@ interface AgentPoolsService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions") Observable> getAvailableAgentPoolVersions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerservice.v2020_07_01.AgentPools upgradeNodeImageVersion" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion") + Observable> upgradeNodeImageVersion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerservice.v2020_07_01.AgentPools beginUpgradeNodeImageVersion" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion") + Observable> beginUpgradeNodeImageVersion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerservice.v2020_07_01.AgentPools listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -865,6 +874,180 @@ private ServiceResponse getAvailableAgentPoolVe .build(response); } + /** + * Upgrade node image version of an agent pool to the latest. + * Upgrade node image version of an agent pool to the latest. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgentPoolInner object if successful. + */ + public AgentPoolInner upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName) { + return upgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).toBlocking().last().body(); + } + + /** + * Upgrade node image version of an agent pool to the latest. + * Upgrade node image version of an agent pool to the latest. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(upgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName), serviceCallback); + } + + /** + * Upgrade node image version of an agent pool to the latest. + * Upgrade node image version of an agent pool to the latest. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) { + return upgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).map(new Func1, AgentPoolInner>() { + @Override + public AgentPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upgrade node image version of an agent pool to the latest. + * Upgrade node image version of an agent pool to the latest. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> upgradeNodeImageVersionWithServiceResponseAsync(String resourceGroupName, String resourceName, String agentPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (agentPoolName == null) { + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); + } + final String apiVersion = "2020-07-01"; + Observable> observable = service.upgradeNodeImageVersion(this.client.subscriptionId(), resourceGroupName, resourceName, agentPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Upgrade node image version of an agent pool to the latest. + * Upgrade node image version of an agent pool to the latest. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgentPoolInner object if successful. + */ + public AgentPoolInner beginUpgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName) { + return beginUpgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).toBlocking().single().body(); + } + + /** + * Upgrade node image version of an agent pool to the latest. + * Upgrade node image version of an agent pool to the latest. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName), serviceCallback); + } + + /** + * Upgrade node image version of an agent pool to the latest. + * Upgrade node image version of an agent pool to the latest. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgentPoolInner object + */ + public Observable beginUpgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) { + return beginUpgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).map(new Func1, AgentPoolInner>() { + @Override + public AgentPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upgrade node image version of an agent pool to the latest. + * Upgrade node image version of an agent pool to the latest. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgentPoolInner object + */ + public Observable> beginUpgradeNodeImageVersionWithServiceResponseAsync(String resourceGroupName, String resourceName, String agentPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + if (agentPoolName == null) { + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); + } + final String apiVersion = "2020-07-01"; + return service.beginUpgradeNodeImageVersion(this.client.subscriptionId(), resourceGroupName, resourceName, agentPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpgradeNodeImageVersionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpgradeNodeImageVersionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Gets a list of agent pools in the specified managed cluster. * Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool. diff --git a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/ManagedClustersImpl.java b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/ManagedClustersImpl.java index 696eae8e764e..3f54f96d00d5 100644 --- a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/ManagedClustersImpl.java +++ b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/ManagedClustersImpl.java @@ -27,7 +27,6 @@ import com.microsoft.azure.management.containerservice.v2020_07_01.ManagedClusterAADProfile; import com.microsoft.azure.management.containerservice.v2020_07_01.ManagedClusterUpgradeProfile; import com.microsoft.azure.management.containerservice.v2020_07_01.ManagedClusterAccessProfile; -import com.microsoft.azure.management.containerservice.v2020_07_01.AgentPool; class ManagedClustersImpl extends GroupableResourcesCoreImpl implements ManagedClusters { protected ManagedClustersImpl(ContainerServiceManager manager) { @@ -219,16 +218,4 @@ public ManagedClusterAccessProfile call(ManagedClusterAccessProfileInner inner) }); } - @Override - public Observable upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) { - ManagedClustersInner client = this.inner(); - return client.upgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName) - .map(new Func1() { - @Override - public AgentPool call(AgentPoolInner inner) { - return new AgentPoolImpl(inner, manager()); - } - }); - } - } diff --git a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/ManagedClustersInner.java b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/ManagedClustersInner.java index 070a7fba256b..a91371b87888 100644 --- a/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/ManagedClustersInner.java +++ b/sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/ManagedClustersInner.java @@ -150,14 +150,6 @@ interface ManagedClustersService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates") Observable> beginRotateClusterCertificates(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerservice.v2020_07_01.ManagedClusters upgradeNodeImageVersion" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion") - Observable> upgradeNodeImageVersion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerservice.v2020_07_01.ManagedClusters beginUpgradeNodeImageVersion" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion") - Observable> beginUpgradeNodeImageVersion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceName") String resourceName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerservice.v2020_07_01.ManagedClusters listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -2101,180 +2093,6 @@ private ServiceResponse beginRotateClusterCertificatesDelegate(Response upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(upgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName), serviceCallback); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) { - return upgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).map(new Func1, AgentPoolInner>() { - @Override - public AgentPoolInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> upgradeNodeImageVersionWithServiceResponseAsync(String resourceGroupName, String resourceName, String agentPoolName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (resourceName == null) { - throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); - } - if (agentPoolName == null) { - throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); - } - final String apiVersion = "2020-07-01"; - Observable> observable = service.upgradeNodeImageVersion(this.client.subscriptionId(), resourceGroupName, resourceName, agentPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the AgentPoolInner object if successful. - */ - public AgentPoolInner beginUpgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName) { - return beginUpgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).toBlocking().single().body(); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginUpgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName), serviceCallback); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AgentPoolInner object - */ - public Observable beginUpgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) { - return beginUpgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).map(new Func1, AgentPoolInner>() { - @Override - public AgentPoolInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Upgrade node image version of an agent pool to the latest. - * Upgrade node image version of an agent pool to the latest. - * - * @param resourceGroupName The name of the resource group. - * @param resourceName The name of the managed cluster resource. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AgentPoolInner object - */ - public Observable> beginUpgradeNodeImageVersionWithServiceResponseAsync(String resourceGroupName, String resourceName, String agentPoolName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (resourceName == null) { - throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); - } - if (agentPoolName == null) { - throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); - } - final String apiVersion = "2020-07-01"; - return service.beginUpgradeNodeImageVersion(this.client.subscriptionId(), resourceGroupName, resourceName, agentPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginUpgradeNodeImageVersionDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginUpgradeNodeImageVersionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** * Gets a list of managed clusters in the specified subscription. * Gets a list of managed clusters in the specified subscription. The operation returns properties of each managed cluster.