Skip to content

Commit

Permalink
Generated from c53101afce109f8619669fed0789d761bd3fce09
Browse files Browse the repository at this point in the history
  • Loading branch information
SDK Automation committed Oct 19, 2020
1 parent 0d7301c commit 2989e4d
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 209 deletions.
4 changes: 2 additions & 2 deletions sdk/containerservice/mgmt-v2020_07_01/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.3.2</version>
<relativePath>../../parents/azure-arm-parent/pom.xml</relativePath>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
</parent>
<artifactId>azure-mgmt-containerservice</artifactId>
<version>1.0.0-beta</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
* Type representing AgentPools.
*/
public interface AgentPools extends SupportsCreating<AgentPool.DefinitionStages.Blank>, HasInner<AgentPoolsInner> {
/**
* 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<AgentPool> upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName);

/**
* Gets the agent pool.
* Gets the details of the agent pool by managed cluster and resource group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,4 @@ public interface ManagedClusters extends SupportsCreating<ManagedCluster.Definit
*/
Observable<ManagedClusterAccessProfile> 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<AgentPool> upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ private AgentPoolImpl wrapModel(String name) {
return new AgentPoolImpl(name, this.manager());
}

@Override
public Observable<AgentPool> upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) {
AgentPoolsInner client = this.inner();
return client.upgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName)
.map(new Func1<AgentPoolInner, AgentPool>() {
@Override
public AgentPool call(AgentPoolInner inner) {
return new AgentPoolImpl(inner, manager());
}
});
}

@Override
public Observable<AgentPool> listAsync(final String resourceGroupName, final String resourceName) {
AgentPoolsInner client = this.inner();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -93,6 +94,14 @@ interface AgentPoolsService {
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions")
Observable<Response<ResponseBody>> 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<Response<ResponseBody>> 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<Response<ResponseBody>> 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<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
Expand Down Expand Up @@ -865,6 +874,180 @@ private ServiceResponse<AgentPoolAvailableVersionsInner> 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<AgentPoolInner> upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName, final ServiceCallback<AgentPoolInner> 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<AgentPoolInner> upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) {
return upgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).map(new Func1<ServiceResponse<AgentPoolInner>, AgentPoolInner>() {
@Override
public AgentPoolInner call(ServiceResponse<AgentPoolInner> 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<ServiceResponse<AgentPoolInner>> 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<Response<ResponseBody>> observable = service.upgradeNodeImageVersion(this.client.subscriptionId(), resourceGroupName, resourceName, agentPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<AgentPoolInner>() { }.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<AgentPoolInner> beginUpgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName, final ServiceCallback<AgentPoolInner> 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<AgentPoolInner> beginUpgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) {
return beginUpgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).map(new Func1<ServiceResponse<AgentPoolInner>, AgentPoolInner>() {
@Override
public AgentPoolInner call(ServiceResponse<AgentPoolInner> 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<ServiceResponse<AgentPoolInner>> 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<Response<ResponseBody>, Observable<ServiceResponse<AgentPoolInner>>>() {
@Override
public Observable<ServiceResponse<AgentPoolInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<AgentPoolInner> clientResponse = beginUpgradeNodeImageVersionDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}

private ServiceResponse<AgentPoolInner> beginUpgradeNodeImageVersionDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<AgentPoolInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<Void>() { }.getType())
.register(202, new TypeToken<AgentPoolInner>() { }.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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ManagedCluster, ManagedClusterImpl, ManagedClusterInner, ManagedClustersInner, ContainerServiceManager> implements ManagedClusters {
protected ManagedClustersImpl(ContainerServiceManager manager) {
Expand Down Expand Up @@ -219,16 +218,4 @@ public ManagedClusterAccessProfile call(ManagedClusterAccessProfileInner inner)
});
}

@Override
public Observable<AgentPool> upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) {
ManagedClustersInner client = this.inner();
return client.upgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName)
.map(new Func1<AgentPoolInner, AgentPool>() {
@Override
public AgentPool call(AgentPoolInner inner) {
return new AgentPoolImpl(inner, manager());
}
});
}

}
Loading

0 comments on commit 2989e4d

Please sign in to comment.