|
28 | 28 | import retrofit2.http.Headers; |
29 | 29 | import retrofit2.http.HTTP; |
30 | 30 | import retrofit2.http.Path; |
| 31 | +import retrofit2.http.POST; |
31 | 32 | import retrofit2.http.PUT; |
32 | 33 | import retrofit2.http.Query; |
33 | 34 | import retrofit2.http.Url; |
@@ -93,6 +94,14 @@ interface AgentPoolsService { |
93 | 94 | @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions") |
94 | 95 | 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); |
95 | 96 |
|
| 97 | + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerservice.v2020_07_01.AgentPools upgradeNodeImageVersion" }) |
| 98 | + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion") |
| 99 | + 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); |
| 100 | + |
| 101 | + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerservice.v2020_07_01.AgentPools beginUpgradeNodeImageVersion" }) |
| 102 | + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion") |
| 103 | + 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); |
| 104 | + |
96 | 105 | @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerservice.v2020_07_01.AgentPools listNext" }) |
97 | 106 | @GET |
98 | 107 | Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); |
@@ -865,6 +874,180 @@ private ServiceResponse<AgentPoolAvailableVersionsInner> getAvailableAgentPoolVe |
865 | 874 | .build(response); |
866 | 875 | } |
867 | 876 |
|
| 877 | + /** |
| 878 | + * Upgrade node image version of an agent pool to the latest. |
| 879 | + * Upgrade node image version of an agent pool to the latest. |
| 880 | + * |
| 881 | + * @param resourceGroupName The name of the resource group. |
| 882 | + * @param resourceName The name of the managed cluster resource. |
| 883 | + * @param agentPoolName The name of the agent pool. |
| 884 | + * @throws IllegalArgumentException thrown if parameters fail the validation |
| 885 | + * @throws CloudException thrown if the request is rejected by server |
| 886 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent |
| 887 | + * @return the AgentPoolInner object if successful. |
| 888 | + */ |
| 889 | + public AgentPoolInner upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName) { |
| 890 | + return upgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).toBlocking().last().body(); |
| 891 | + } |
| 892 | + |
| 893 | + /** |
| 894 | + * Upgrade node image version of an agent pool to the latest. |
| 895 | + * Upgrade node image version of an agent pool to the latest. |
| 896 | + * |
| 897 | + * @param resourceGroupName The name of the resource group. |
| 898 | + * @param resourceName The name of the managed cluster resource. |
| 899 | + * @param agentPoolName The name of the agent pool. |
| 900 | + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. |
| 901 | + * @throws IllegalArgumentException thrown if parameters fail the validation |
| 902 | + * @return the {@link ServiceFuture} object |
| 903 | + */ |
| 904 | + public ServiceFuture<AgentPoolInner> upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName, final ServiceCallback<AgentPoolInner> serviceCallback) { |
| 905 | + return ServiceFuture.fromResponse(upgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName), serviceCallback); |
| 906 | + } |
| 907 | + |
| 908 | + /** |
| 909 | + * Upgrade node image version of an agent pool to the latest. |
| 910 | + * Upgrade node image version of an agent pool to the latest. |
| 911 | + * |
| 912 | + * @param resourceGroupName The name of the resource group. |
| 913 | + * @param resourceName The name of the managed cluster resource. |
| 914 | + * @param agentPoolName The name of the agent pool. |
| 915 | + * @throws IllegalArgumentException thrown if parameters fail the validation |
| 916 | + * @return the observable for the request |
| 917 | + */ |
| 918 | + public Observable<AgentPoolInner> upgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) { |
| 919 | + return upgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).map(new Func1<ServiceResponse<AgentPoolInner>, AgentPoolInner>() { |
| 920 | + @Override |
| 921 | + public AgentPoolInner call(ServiceResponse<AgentPoolInner> response) { |
| 922 | + return response.body(); |
| 923 | + } |
| 924 | + }); |
| 925 | + } |
| 926 | + |
| 927 | + /** |
| 928 | + * Upgrade node image version of an agent pool to the latest. |
| 929 | + * Upgrade node image version of an agent pool to the latest. |
| 930 | + * |
| 931 | + * @param resourceGroupName The name of the resource group. |
| 932 | + * @param resourceName The name of the managed cluster resource. |
| 933 | + * @param agentPoolName The name of the agent pool. |
| 934 | + * @throws IllegalArgumentException thrown if parameters fail the validation |
| 935 | + * @return the observable for the request |
| 936 | + */ |
| 937 | + public Observable<ServiceResponse<AgentPoolInner>> upgradeNodeImageVersionWithServiceResponseAsync(String resourceGroupName, String resourceName, String agentPoolName) { |
| 938 | + if (this.client.subscriptionId() == null) { |
| 939 | + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); |
| 940 | + } |
| 941 | + if (resourceGroupName == null) { |
| 942 | + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); |
| 943 | + } |
| 944 | + if (resourceName == null) { |
| 945 | + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); |
| 946 | + } |
| 947 | + if (agentPoolName == null) { |
| 948 | + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); |
| 949 | + } |
| 950 | + final String apiVersion = "2020-07-01"; |
| 951 | + Observable<Response<ResponseBody>> observable = service.upgradeNodeImageVersion(this.client.subscriptionId(), resourceGroupName, resourceName, agentPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); |
| 952 | + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<AgentPoolInner>() { }.getType()); |
| 953 | + } |
| 954 | + |
| 955 | + /** |
| 956 | + * Upgrade node image version of an agent pool to the latest. |
| 957 | + * Upgrade node image version of an agent pool to the latest. |
| 958 | + * |
| 959 | + * @param resourceGroupName The name of the resource group. |
| 960 | + * @param resourceName The name of the managed cluster resource. |
| 961 | + * @param agentPoolName The name of the agent pool. |
| 962 | + * @throws IllegalArgumentException thrown if parameters fail the validation |
| 963 | + * @throws CloudException thrown if the request is rejected by server |
| 964 | + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent |
| 965 | + * @return the AgentPoolInner object if successful. |
| 966 | + */ |
| 967 | + public AgentPoolInner beginUpgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName) { |
| 968 | + return beginUpgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).toBlocking().single().body(); |
| 969 | + } |
| 970 | + |
| 971 | + /** |
| 972 | + * Upgrade node image version of an agent pool to the latest. |
| 973 | + * Upgrade node image version of an agent pool to the latest. |
| 974 | + * |
| 975 | + * @param resourceGroupName The name of the resource group. |
| 976 | + * @param resourceName The name of the managed cluster resource. |
| 977 | + * @param agentPoolName The name of the agent pool. |
| 978 | + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. |
| 979 | + * @throws IllegalArgumentException thrown if parameters fail the validation |
| 980 | + * @return the {@link ServiceFuture} object |
| 981 | + */ |
| 982 | + public ServiceFuture<AgentPoolInner> beginUpgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName, final ServiceCallback<AgentPoolInner> serviceCallback) { |
| 983 | + return ServiceFuture.fromResponse(beginUpgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName), serviceCallback); |
| 984 | + } |
| 985 | + |
| 986 | + /** |
| 987 | + * Upgrade node image version of an agent pool to the latest. |
| 988 | + * Upgrade node image version of an agent pool to the latest. |
| 989 | + * |
| 990 | + * @param resourceGroupName The name of the resource group. |
| 991 | + * @param resourceName The name of the managed cluster resource. |
| 992 | + * @param agentPoolName The name of the agent pool. |
| 993 | + * @throws IllegalArgumentException thrown if parameters fail the validation |
| 994 | + * @return the observable to the AgentPoolInner object |
| 995 | + */ |
| 996 | + public Observable<AgentPoolInner> beginUpgradeNodeImageVersionAsync(String resourceGroupName, String resourceName, String agentPoolName) { |
| 997 | + return beginUpgradeNodeImageVersionWithServiceResponseAsync(resourceGroupName, resourceName, agentPoolName).map(new Func1<ServiceResponse<AgentPoolInner>, AgentPoolInner>() { |
| 998 | + @Override |
| 999 | + public AgentPoolInner call(ServiceResponse<AgentPoolInner> response) { |
| 1000 | + return response.body(); |
| 1001 | + } |
| 1002 | + }); |
| 1003 | + } |
| 1004 | + |
| 1005 | + /** |
| 1006 | + * Upgrade node image version of an agent pool to the latest. |
| 1007 | + * Upgrade node image version of an agent pool to the latest. |
| 1008 | + * |
| 1009 | + * @param resourceGroupName The name of the resource group. |
| 1010 | + * @param resourceName The name of the managed cluster resource. |
| 1011 | + * @param agentPoolName The name of the agent pool. |
| 1012 | + * @throws IllegalArgumentException thrown if parameters fail the validation |
| 1013 | + * @return the observable to the AgentPoolInner object |
| 1014 | + */ |
| 1015 | + public Observable<ServiceResponse<AgentPoolInner>> beginUpgradeNodeImageVersionWithServiceResponseAsync(String resourceGroupName, String resourceName, String agentPoolName) { |
| 1016 | + if (this.client.subscriptionId() == null) { |
| 1017 | + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); |
| 1018 | + } |
| 1019 | + if (resourceGroupName == null) { |
| 1020 | + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); |
| 1021 | + } |
| 1022 | + if (resourceName == null) { |
| 1023 | + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); |
| 1024 | + } |
| 1025 | + if (agentPoolName == null) { |
| 1026 | + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); |
| 1027 | + } |
| 1028 | + final String apiVersion = "2020-07-01"; |
| 1029 | + return service.beginUpgradeNodeImageVersion(this.client.subscriptionId(), resourceGroupName, resourceName, agentPoolName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) |
| 1030 | + .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<AgentPoolInner>>>() { |
| 1031 | + @Override |
| 1032 | + public Observable<ServiceResponse<AgentPoolInner>> call(Response<ResponseBody> response) { |
| 1033 | + try { |
| 1034 | + ServiceResponse<AgentPoolInner> clientResponse = beginUpgradeNodeImageVersionDelegate(response); |
| 1035 | + return Observable.just(clientResponse); |
| 1036 | + } catch (Throwable t) { |
| 1037 | + return Observable.error(t); |
| 1038 | + } |
| 1039 | + } |
| 1040 | + }); |
| 1041 | + } |
| 1042 | + |
| 1043 | + private ServiceResponse<AgentPoolInner> beginUpgradeNodeImageVersionDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { |
| 1044 | + return this.client.restClient().responseBuilderFactory().<AgentPoolInner, CloudException>newInstance(this.client.serializerAdapter()) |
| 1045 | + .register(200, new TypeToken<Void>() { }.getType()) |
| 1046 | + .register(202, new TypeToken<AgentPoolInner>() { }.getType()) |
| 1047 | + .registerError(CloudException.class) |
| 1048 | + .build(response); |
| 1049 | + } |
| 1050 | + |
868 | 1051 | /** |
869 | 1052 | * Gets a list of agent pools in the specified managed cluster. |
870 | 1053 | * Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool. |
|
0 commit comments