Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See License.txt in the project root for license information. Code generated by Microsoft (R) AutoRest Code Generator.
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */
package com.microsoft.azure.management.network.implementation; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.Path; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.http.Url; import retrofit2.Response; import rx.functions.Func1; import rx.Observable;
An instance of this class provides access to all the operations defined in Routes.
/** * An instance of this class provides access to all the operations defined * in Routes. */
public class RoutesInner {
The Retrofit service to perform REST calls.
/** The Retrofit service to perform REST calls. */
private RoutesService service;
The service client containing this operation class.
/** The service client containing this operation class. */
private NetworkManagementClientImpl client;
Initializes an instance of RoutesInner.
Params:
  • retrofit – the Retrofit instance built from a Retrofit Builder.
  • client – the instance of the service client containing this operation class.
/** * Initializes an instance of RoutesInner. * * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */
public RoutesInner(Retrofit retrofit, NetworkManagementClientImpl client) { this.service = retrofit.create(RoutesService.class); this.client = client; }
The interface defining all the services for Routes to be used by Retrofit to perform actually REST calls.
/** * The interface defining all the services for Routes to be * used by Retrofit to perform actually REST calls. */
interface RoutesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.Routes delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> delete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @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.network.Routes beginDelete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @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.network.Routes get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") Observable<Response<ResponseBody>> get(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @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.network.Routes createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") Observable<Response<ResponseBody>> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Body RouteInner routeParameters, @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.network.Routes beginCreateOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}") Observable<Response<ResponseBody>> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("routeName") String routeName, @Path("subscriptionId") String subscriptionId, @Body RouteInner routeParameters, @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.network.Routes list" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes") Observable<Response<ResponseBody>> list(@Path("resourceGroupName") String resourceGroupName, @Path("routeTableName") String routeTableName, @Path("subscriptionId") String subscriptionId, @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.network.Routes listNext" }) @GET Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); }
Deletes the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
Throws:
/** * Deletes the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @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 */
public void delete(String resourceGroupName, String routeTableName, String routeName) { deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().last().body(); }
Deletes the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Deletes the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @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<Void> deleteAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); }
Deletes the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
Throws:
Returns:the observable for the request
/** * Deletes the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<Void> deleteAsync(String resourceGroupName, String routeTableName, String routeName) { return deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Deletes the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
Throws:
Returns:the observable for the request
/** * Deletes the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (routeTableName == null) { throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); } if (routeName == null) { throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2019-11-01"; Observable<Response<ResponseBody>> observable = service.delete(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
Deletes the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
Throws:
/** * Deletes the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @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 */
public void beginDelete(String resourceGroupName, String routeTableName, String routeName) { beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().body(); }
Deletes the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Deletes the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @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<Void> beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); }
Deletes the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName) { return beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Deletes the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (routeTableName == null) { throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); } if (routeName == null) { throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2019-11-01"; return service.beginDelete(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> beginDeleteDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(202, new TypeToken<Void>() { }.getType()) .register(204, new TypeToken<Void>() { }.getType()) .registerError(CloudException.class) .build(response); }
Gets the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
Throws:
Returns:the RouteInner object if successful.
/** * Gets the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @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 RouteInner object if successful. */
public RouteInner get(String resourceGroupName, String routeTableName, String routeName) { return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().body(); }
Gets the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Gets the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @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<RouteInner> getAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback<RouteInner> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); }
Gets the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
Throws:
Returns:the observable to the RouteInner object
/** * Gets the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RouteInner object */
public Observable<RouteInner> getAsync(String resourceGroupName, String routeTableName, String routeName) { return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1<ServiceResponse<RouteInner>, RouteInner>() { @Override public RouteInner call(ServiceResponse<RouteInner> response) { return response.body(); } }); }
Gets the specified route from a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
Throws:
Returns:the observable to the RouteInner object
/** * Gets the specified route from a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RouteInner object */
public Observable<ServiceResponse<RouteInner>> getWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (routeTableName == null) { throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); } if (routeName == null) { throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2019-11-01"; return service.get(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RouteInner>>>() { @Override public Observable<ServiceResponse<RouteInner>> call(Response<ResponseBody> response) { try { ServiceResponse<RouteInner> clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<RouteInner> getDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<RouteInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<RouteInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Creates or updates a route in the specified route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
  • routeParameters – Parameters supplied to the create or update route operation.
Throws:
Returns:the RouteInner object if successful.
/** * Creates or updates a route in the specified route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @param routeParameters Parameters supplied to the create or update route operation. * @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 RouteInner object if successful. */
public RouteInner createOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().last().body(); }
Creates or updates a route in the specified route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
  • routeParameters – Parameters supplied to the create or update route operation.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Creates or updates a route in the specified route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @param routeParameters Parameters supplied to the create or update route operation. * @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<RouteInner> createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback<RouteInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); }
Creates or updates a route in the specified route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
  • routeParameters – Parameters supplied to the create or update route operation.
Throws:
Returns:the observable for the request
/** * Creates or updates a route in the specified route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @param routeParameters Parameters supplied to the create or update route operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<RouteInner> createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1<ServiceResponse<RouteInner>, RouteInner>() { @Override public RouteInner call(ServiceResponse<RouteInner> response) { return response.body(); } }); }
Creates or updates a route in the specified route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
  • routeParameters – Parameters supplied to the create or update route operation.
Throws:
Returns:the observable for the request
/** * Creates or updates a route in the specified route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @param routeParameters Parameters supplied to the create or update route operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<RouteInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (routeTableName == null) { throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); } if (routeName == null) { throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (routeParameters == null) { throw new IllegalArgumentException("Parameter routeParameters is required and cannot be null."); } Validator.validate(routeParameters); final String apiVersion = "2019-11-01"; Observable<Response<ResponseBody>> observable = service.createOrUpdate(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), routeParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<RouteInner>() { }.getType()); }
Creates or updates a route in the specified route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
  • routeParameters – Parameters supplied to the create or update route operation.
Throws:
Returns:the RouteInner object if successful.
/** * Creates or updates a route in the specified route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @param routeParameters Parameters supplied to the create or update route operation. * @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 RouteInner object if successful. */
public RouteInner beginCreateOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().single().body(); }
Creates or updates a route in the specified route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
  • routeParameters – Parameters supplied to the create or update route operation.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Creates or updates a route in the specified route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @param routeParameters Parameters supplied to the create or update route operation. * @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<RouteInner> beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback<RouteInner> serviceCallback) { return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); }
Creates or updates a route in the specified route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
  • routeParameters – Parameters supplied to the create or update route operation.
Throws:
Returns:the observable to the RouteInner object
/** * Creates or updates a route in the specified route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @param routeParameters Parameters supplied to the create or update route operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RouteInner object */
public Observable<RouteInner> beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1<ServiceResponse<RouteInner>, RouteInner>() { @Override public RouteInner call(ServiceResponse<RouteInner> response) { return response.body(); } }); }
Creates or updates a route in the specified route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • routeName – The name of the route.
  • routeParameters – Parameters supplied to the create or update route operation.
Throws:
Returns:the observable to the RouteInner object
/** * Creates or updates a route in the specified route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @param routeName The name of the route. * @param routeParameters Parameters supplied to the create or update route operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RouteInner object */
public Observable<ServiceResponse<RouteInner>> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (routeTableName == null) { throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); } if (routeName == null) { throw new IllegalArgumentException("Parameter routeName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (routeParameters == null) { throw new IllegalArgumentException("Parameter routeParameters is required and cannot be null."); } Validator.validate(routeParameters); final String apiVersion = "2019-11-01"; return service.beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, this.client.subscriptionId(), routeParameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RouteInner>>>() { @Override public Observable<ServiceResponse<RouteInner>> call(Response<ResponseBody> response) { try { ServiceResponse<RouteInner> clientResponse = beginCreateOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<RouteInner> beginCreateOrUpdateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<RouteInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<RouteInner>() { }.getType()) .register(201, new TypeToken<RouteInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Gets all routes in a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
Throws:
Returns:the PagedList<RouteInner> object if successful.
/** * Gets all routes in a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @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 PagedList&lt;RouteInner&gt; object if successful. */
public PagedList<RouteInner> list(final String resourceGroupName, final String routeTableName) { ServiceResponse<Page<RouteInner>> response = listSinglePageAsync(resourceGroupName, routeTableName).toBlocking().single(); return new PagedList<RouteInner>(response.body()) { @Override public Page<RouteInner> nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Gets all routes in a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Gets all routes in a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @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<List<RouteInner>> listAsync(final String resourceGroupName, final String routeTableName, final ListOperationCallback<RouteInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listSinglePageAsync(resourceGroupName, routeTableName), new Func1<String, Observable<ServiceResponse<Page<RouteInner>>>>() { @Override public Observable<ServiceResponse<Page<RouteInner>>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Gets all routes in a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
Throws:
Returns:the observable to the PagedList<RouteInner> object
/** * Gets all routes in a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;RouteInner&gt; object */
public Observable<Page<RouteInner>> listAsync(final String resourceGroupName, final String routeTableName) { return listWithServiceResponseAsync(resourceGroupName, routeTableName) .map(new Func1<ServiceResponse<Page<RouteInner>>, Page<RouteInner>>() { @Override public Page<RouteInner> call(ServiceResponse<Page<RouteInner>> response) { return response.body(); } }); }
Gets all routes in a route table.
Params:
  • resourceGroupName – The name of the resource group.
  • routeTableName – The name of the route table.
Throws:
Returns:the observable to the PagedList<RouteInner> object
/** * Gets all routes in a route table. * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;RouteInner&gt; object */
public Observable<ServiceResponse<Page<RouteInner>>> listWithServiceResponseAsync(final String resourceGroupName, final String routeTableName) { return listSinglePageAsync(resourceGroupName, routeTableName) .concatMap(new Func1<ServiceResponse<Page<RouteInner>>, Observable<ServiceResponse<Page<RouteInner>>>>() { @Override public Observable<ServiceResponse<Page<RouteInner>>> call(ServiceResponse<Page<RouteInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); }
Gets all routes in a route table. ServiceResponse> * @param resourceGroupName The name of the resource group. ServiceResponse> * @param routeTableName The name of the route table.
Throws:
Returns:the PagedList<RouteInner> object wrapped in ServiceResponse if successful.
/** * Gets all routes in a route table. * ServiceResponse<PageImpl<RouteInner>> * @param resourceGroupName The name of the resource group. ServiceResponse<PageImpl<RouteInner>> * @param routeTableName The name of the route table. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;RouteInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<RouteInner>>> listSinglePageAsync(final String resourceGroupName, final String routeTableName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (routeTableName == null) { throw new IllegalArgumentException("Parameter routeTableName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2019-11-01"; return service.list(resourceGroupName, routeTableName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<RouteInner>>>>() { @Override public Observable<ServiceResponse<Page<RouteInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<RouteInner>> result = listDelegate(response); return Observable.just(new ServiceResponse<Page<RouteInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<RouteInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<RouteInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<RouteInner>>() { }.getType()) .registerError(CloudException.class) .build(response); }
Gets all routes in a route table.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<RouteInner> object if successful.
/** * Gets all routes in a route table. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @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 PagedList&lt;RouteInner&gt; object if successful. */
public PagedList<RouteInner> listNext(final String nextPageLink) { ServiceResponse<Page<RouteInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<RouteInner>(response.body()) { @Override public Page<RouteInner> nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Gets all routes in a route table.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
  • serviceFuture – the ServiceFuture object tracking the Retrofit calls
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Gets all routes in a route table. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls * @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<List<RouteInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<RouteInner>> serviceFuture, final ListOperationCallback<RouteInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<RouteInner>>>>() { @Override public Observable<ServiceResponse<Page<RouteInner>>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Gets all routes in a route table.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<RouteInner> object
/** * Gets all routes in a route table. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;RouteInner&gt; object */
public Observable<Page<RouteInner>> listNextAsync(final String nextPageLink) { return listNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<RouteInner>>, Page<RouteInner>>() { @Override public Page<RouteInner> call(ServiceResponse<Page<RouteInner>> response) { return response.body(); } }); }
Gets all routes in a route table.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<RouteInner> object
/** * Gets all routes in a route table. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;RouteInner&gt; object */
public Observable<ServiceResponse<Page<RouteInner>>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<RouteInner>>, Observable<ServiceResponse<Page<RouteInner>>>>() { @Override public Observable<ServiceResponse<Page<RouteInner>>> call(ServiceResponse<Page<RouteInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); }
Gets all routes in a route table. ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<RouteInner> object wrapped in ServiceResponse if successful.
/** * Gets all routes in a route table. * ServiceResponse<PageImpl<RouteInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;RouteInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<RouteInner>>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<RouteInner>>>>() { @Override public Observable<ServiceResponse<Page<RouteInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<RouteInner>> result = listNextDelegate(response); return Observable.just(new ServiceResponse<Page<RouteInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<RouteInner>> listNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<RouteInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<RouteInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } }