Search in sources :

Example 1 with TopologyParameters

use of com.microsoft.azure.management.network.TopologyParameters in project azure-sdk-for-java by Azure.

the class NetworkWatchersInner method getTopologyWithServiceResponseAsync.

/**
     * Gets the current network topology by resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param networkWatcherName The name of the network watcher.
     * @param targetResourceGroupName The name of the target resource group to perform topology on.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the TopologyInner object
     */
public Observable<ServiceResponse<TopologyInner>> getTopologyWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceGroupName) {
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (networkWatcherName == null) {
        throw new IllegalArgumentException("Parameter networkWatcherName 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 (targetResourceGroupName == null) {
        throw new IllegalArgumentException("Parameter targetResourceGroupName is required and cannot be null.");
    }
    final String apiVersion = "2016-12-01";
    TopologyParameters parameters = new TopologyParameters();
    parameters.withTargetResourceGroupName(targetResourceGroupName);
    return service.getTopology(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<TopologyInner>>>() {

        @Override
        public Observable<ServiceResponse<TopologyInner>> call(Response<ResponseBody> response) {
            try {
                ServiceResponse<TopologyInner> clientResponse = getTopologyDelegate(response);
                return Observable.just(clientResponse);
            } catch (Throwable t) {
                return Observable.error(t);
            }
        }
    });
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) ServiceResponse(com.microsoft.rest.ServiceResponse) Observable(rx.Observable) TopologyParameters(com.microsoft.azure.management.network.TopologyParameters) ResponseBody(okhttp3.ResponseBody)

Aggregations

TopologyParameters (com.microsoft.azure.management.network.TopologyParameters)1 ServiceResponse (com.microsoft.rest.ServiceResponse)1 ResponseBody (okhttp3.ResponseBody)1 Response (retrofit2.Response)1 Observable (rx.Observable)1