Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* 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 com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet;
import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete;
import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing;
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.POST;
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 ExpressRouteCircuits.
*/
public class ExpressRouteCircuitsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing {
/** The Retrofit service to perform REST calls. */
private ExpressRouteCircuitsService service;
/** The service client containing this operation class. */
private NetworkManagementClientImpl client;
/**
* Initializes an instance of ExpressRouteCircuitsInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public ExpressRouteCircuitsInner(Retrofit retrofit, NetworkManagementClientImpl client) {
this.service = retrofit.create(ExpressRouteCircuitsService.class);
this.client = client;
}
/**
* The interface defining all the services for ExpressRouteCircuits to be
* used by Retrofit to perform actually REST calls.
*/
interface ExpressRouteCircuitsService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.ExpressRouteCircuits delete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", method = "DELETE", hasBody = true)
Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @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.ExpressRouteCircuits beginDelete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", method = "DELETE", hasBody = true)
Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @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.ExpressRouteCircuits getByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}")
Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @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.ExpressRouteCircuits createOrUpdate" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}")
Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitInner parameters, @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.ExpressRouteCircuits beginCreateOrUpdate" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}")
Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("subscriptionId") String subscriptionId, @Body ExpressRouteCircuitInner parameters, @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.ExpressRouteCircuits listArpTable" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}")
Observable> listArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.ExpressRouteCircuits beginListArpTable" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}")
Observable> beginListArpTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.ExpressRouteCircuits listRoutesTable" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}")
Observable> listRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.ExpressRouteCircuits beginListRoutesTable" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}")
Observable> beginListRoutesTable(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.ExpressRouteCircuits listRoutesTableSummary" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}")
Observable> listRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.ExpressRouteCircuits beginListRoutesTableSummary" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}")
Observable> beginListRoutesTableSummary(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @Path("devicePath") String devicePath, @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.ExpressRouteCircuits getStats" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats")
Observable> getStats(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @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.ExpressRouteCircuits getPeeringStats" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats")
Observable> getPeeringStats(@Path("resourceGroupName") String resourceGroupName, @Path("circuitName") String circuitName, @Path("peeringName") String peeringName, @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.ExpressRouteCircuits listByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits")
Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.ExpressRouteCircuits list" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits")
Observable> list(@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.ExpressRouteCircuits listByResourceGroupNext" })
@GET
Observable> listByResourceGroupNext(@Url String nextUrl, @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.ExpressRouteCircuits listNext" })
@GET
Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
/**
* Deletes the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @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 circuitName) {
deleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().last().body();
}
/**
* Deletes the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @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 deleteAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback);
}
/**
* Deletes the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable deleteAsync(String resourceGroupName, String circuitName) {
return deleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() {
@Override
public Void call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Deletes the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName 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 = "2016-12-01";
Observable> observable = service.delete(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType());
}
/**
* Deletes the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @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 circuitName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body();
}
/**
* Deletes the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @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 beginDeleteAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback);
}
/**
* Deletes the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable beginDeleteAsync(String resourceGroupName, String circuitName) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() {
@Override
public Void call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Deletes the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName 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 = "2016-12-01";
return service.beginDelete(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = beginDeleteDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(204, new TypeToken() { }.getType())
.register(202, new TypeToken() { }.getType())
.register(200, new TypeToken() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets information about the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of express route circuit.
* @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 ExpressRouteCircuitInner object if successful.
*/
public ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body();
}
/**
* Gets information about the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of express route circuit.
* @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 getByResourceGroupAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback);
}
/**
* Gets information about the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of express route circuit.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitInner object
*/
public Observable getByResourceGroupAsync(String resourceGroupName, String circuitName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() {
@Override
public ExpressRouteCircuitInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets information about the specified express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of express route circuit.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitInner object
*/
public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String circuitName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName 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 = "2016-12-01";
return service.getByResourceGroup(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = getByResourceGroupDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Creates or updates an express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the circuit.
* @param parameters Parameters supplied to the create or update express route circuit 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 ExpressRouteCircuitInner object if successful.
*/
public ExpressRouteCircuitInner createOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().last().body();
}
/**
* Creates or updates an express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the circuit.
* @param parameters Parameters supplied to the create or update express route circuit 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 createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback);
}
/**
* Creates or updates an express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the circuit.
* @param parameters Parameters supplied to the create or update express route circuit operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() {
@Override
public ExpressRouteCircuitInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Creates or updates an express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the circuit.
* @param parameters Parameters supplied to the create or update express route circuit operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName 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 (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
Validator.validate(parameters);
final String apiVersion = "2016-12-01";
Observable> observable = service.createOrUpdate(resourceGroupName, circuitName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType());
}
/**
* Creates or updates an express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the circuit.
* @param parameters Parameters supplied to the create or update express route circuit 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 ExpressRouteCircuitInner object if successful.
*/
public ExpressRouteCircuitInner beginCreateOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().single().body();
}
/**
* Creates or updates an express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the circuit.
* @param parameters Parameters supplied to the create or update express route circuit 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 beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback);
}
/**
* Creates or updates an express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the circuit.
* @param parameters Parameters supplied to the create or update express route circuit operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitInner object
*/
public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() {
@Override
public ExpressRouteCircuitInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Creates or updates an express route circuit.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the circuit.
* @param parameters Parameters supplied to the create or update express route circuit operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitInner object
*/
public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName 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 (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
Validator.validate(parameters);
final String apiVersion = "2016-12-01";
return service.beginCreateOrUpdate(resourceGroupName, circuitName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(201, new TypeToken() { }.getType())
.register(200, new TypeToken() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets the currently advertised ARP table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 ExpressRouteCircuitsArpTableListResultInner object if successful.
*/
public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body();
}
/**
* Gets the currently advertised ARP table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback);
}
/**
* Gets the currently advertised ARP table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() {
@Override
public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets the currently advertised ARP table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> listArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName is required and cannot be null.");
}
if (peeringName == null) {
throw new IllegalArgumentException("Parameter peeringName is required and cannot be null.");
}
if (devicePath == null) {
throw new IllegalArgumentException("Parameter devicePath 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 = "2016-12-01";
Observable> observable = service.listArpTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType());
}
/**
* Gets the currently advertised ARP table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 ExpressRouteCircuitsArpTableListResultInner object if successful.
*/
public ExpressRouteCircuitsArpTableListResultInner beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body();
}
/**
* Gets the currently advertised ARP table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback);
}
/**
* Gets the currently advertised ARP table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitsArpTableListResultInner object
*/
public Observable beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() {
@Override
public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets the currently advertised ARP table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitsArpTableListResultInner object
*/
public Observable> beginListArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName is required and cannot be null.");
}
if (peeringName == null) {
throw new IllegalArgumentException("Parameter peeringName is required and cannot be null.");
}
if (devicePath == null) {
throw new IllegalArgumentException("Parameter devicePath 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 = "2016-12-01";
return service.beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = beginListArpTableDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse beginListArpTableDelegate(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 the currently advertised routes table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 ExpressRouteCircuitsRoutesTableListResultInner object if successful.
*/
public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body();
}
/**
* Gets the currently advertised routes table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback);
}
/**
* Gets the currently advertised routes table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() {
@Override
public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets the currently advertised routes table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> listRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName is required and cannot be null.");
}
if (peeringName == null) {
throw new IllegalArgumentException("Parameter peeringName is required and cannot be null.");
}
if (devicePath == null) {
throw new IllegalArgumentException("Parameter devicePath 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 = "2016-12-01";
Observable> observable = service.listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType());
}
/**
* Gets the currently advertised routes table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 ExpressRouteCircuitsRoutesTableListResultInner object if successful.
*/
public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body();
}
/**
* Gets the currently advertised routes table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback);
}
/**
* Gets the currently advertised routes table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object
*/
public Observable beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() {
@Override
public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets the currently advertised routes table associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object
*/
public Observable> beginListRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName is required and cannot be null.");
}
if (peeringName == null) {
throw new IllegalArgumentException("Parameter peeringName is required and cannot be null.");
}
if (devicePath == null) {
throw new IllegalArgumentException("Parameter devicePath 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 = "2016-12-01";
return service.beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = beginListRoutesTableDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse beginListRoutesTableDelegate(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 the currently advertised routes table summary associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 ExpressRouteCircuitsRoutesTableSummaryListResultInner object if successful.
*/
public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().body();
}
/**
* Gets the currently advertised routes table summary associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback);
}
/**
* Gets the currently advertised routes table summary associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() {
@Override
public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets the currently advertised routes table summary associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> listRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName is required and cannot be null.");
}
if (peeringName == null) {
throw new IllegalArgumentException("Parameter peeringName is required and cannot be null.");
}
if (devicePath == null) {
throw new IllegalArgumentException("Parameter devicePath 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 = "2016-12-01";
Observable> observable = service.listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType());
}
/**
* Gets the currently advertised routes table summary associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 ExpressRouteCircuitsRoutesTableSummaryListResultInner object if successful.
*/
public ExpressRouteCircuitsRoutesTableSummaryListResultInner beginListRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().body();
}
/**
* Gets the currently advertised routes table summary associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @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 beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback);
}
/**
* Gets the currently advertised routes table summary associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object
*/
public Observable beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() {
@Override
public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets the currently advertised routes table summary associated with the express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object
*/
public Observable> beginListRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName is required and cannot be null.");
}
if (peeringName == null) {
throw new IllegalArgumentException("Parameter peeringName is required and cannot be null.");
}
if (devicePath == null) {
throw new IllegalArgumentException("Parameter devicePath 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 = "2016-12-01";
return service.beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = beginListRoutesTableSummaryDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse beginListRoutesTableSummaryDelegate(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 all the stats from an express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @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 ExpressRouteCircuitStatsInner object if successful.
*/
public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) {
return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().body();
}
/**
* Gets all the stats from an express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @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 getStatsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getStatsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback);
}
/**
* Gets all the stats from an express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitStatsInner object
*/
public Observable getStatsAsync(String resourceGroupName, String circuitName) {
return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitStatsInner>() {
@Override
public ExpressRouteCircuitStatsInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets all the stats from an express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitStatsInner object
*/
public Observable> getStatsWithServiceResponseAsync(String resourceGroupName, String circuitName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName 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 = "2016-12-01";
return service.getStats(resourceGroupName, circuitName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = getStatsDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse getStatsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets all stats from an express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @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 ExpressRouteCircuitStatsInner object if successful.
*/
public ExpressRouteCircuitStatsInner getPeeringStats(String resourceGroupName, String circuitName, String peeringName) {
return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().body();
}
/**
* Gets all stats from an express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @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 getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback);
}
/**
* Gets all stats from an express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitStatsInner object
*/
public Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) {
return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, ExpressRouteCircuitStatsInner>() {
@Override
public ExpressRouteCircuitStatsInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets all stats from an express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitStatsInner object
*/
public Observable> getPeeringStatsWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName is required and cannot be null.");
}
if (peeringName == null) {
throw new IllegalArgumentException("Parameter peeringName 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 = "2016-12-01";
return service.getPeeringStats(resourceGroupName, circuitName, peeringName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = getPeeringStatsDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse getPeeringStatsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
.register(200, new TypeToken() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets all the express route circuits in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @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<ExpressRouteCircuitInner> object if successful.
*/
public PagedList listByResourceGroup(final String resourceGroupName) {
ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all the express route circuits in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByResourceGroupSinglePageAsync(resourceGroupName),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets all the express route circuits in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ExpressRouteCircuitInner> object
*/
public Observable> listByResourceGroupAsync(final String resourceGroupName) {
return listByResourceGroupWithServiceResponseAsync(resourceGroupName)
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all the express route circuits in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ExpressRouteCircuitInner> object
*/
public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) {
return listByResourceGroupSinglePageAsync(resourceGroupName)
.concatMap(new Func1>, Observable>>>() {
@Override
public Observable>> call(ServiceResponse> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink));
}
});
}
/**
* Gets all the express route circuits in a resource group.
*
ServiceResponse> * @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName 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 = "2016-12-01";
return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>>() {
@Override
public Observable>> call(Response response) {
try {
ServiceResponse> result = listByResourceGroupDelegate(response);
return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets all the express route circuits in a subscription.
*
* @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<ExpressRouteCircuitInner> object if successful.
*/
public PagedList list() {
ServiceResponse> response = listSinglePageAsync().toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all the express route circuits in a subscription.
*
* @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> listAsync(final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listSinglePageAsync(),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets all the express route circuits in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ExpressRouteCircuitInner> object
*/
public Observable> listAsync() {
return listWithServiceResponseAsync()
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all the express route circuits in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<ExpressRouteCircuitInner> object
*/
public Observable>> listWithServiceResponseAsync() {
return listSinglePageAsync()
.concatMap(new Func1>, Observable>>>() {
@Override
public Observable>> call(ServiceResponse> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
}
});
}
/**
* Gets all the express route circuits in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful.
*/
public Observable>> listSinglePageAsync() {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2016-12-01";
return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>>() {
@Override
public Observable>> call(Response response) {
try {
ServiceResponse> result = listDelegate(response);
return Observable.just(new ServiceResponse>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets all the express route circuits in a resource group.
*
* @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<ExpressRouteCircuitInner> object if successful.
*/
public PagedList listByResourceGroupNext(final String nextPageLink) {
ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets all the express route circuits in a resource group.
*
* @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture