Search in sources :

Example 1 with FlowLogStatusParameters

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

the class NetworkWatchersInner method getFlowLogStatusWithServiceResponseAsync.

/**
     * Queries status of flow log on a specified resource.
     *
     * @param resourceGroupName The name of the network watcher resource group.
     * @param networkWatcherName The name of the network watcher resource.
     * @param targetResourceId The target resource where getting the flow logging status.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable for the request
     */
public Observable<ServiceResponse<FlowLogInformationInner>> getFlowLogStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
    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 (targetResourceId == null) {
        throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null.");
    }
    final String apiVersion = "2016-12-01";
    FlowLogStatusParameters parameters = new FlowLogStatusParameters();
    parameters.withTargetResourceId(targetResourceId);
    Observable<Response<ResponseBody>> observable = service.getFlowLogStatus(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent());
    return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<FlowLogInformationInner>() {
    }.getType());
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) TypeToken(com.google.common.reflect.TypeToken) FlowLogStatusParameters(com.microsoft.azure.management.network.FlowLogStatusParameters)

Example 2 with FlowLogStatusParameters

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

the class NetworkWatchersInner method beginGetFlowLogStatusWithServiceResponseAsync.

/**
     * Queries status of flow log on a specified resource.
     *
     * @param resourceGroupName The name of the network watcher resource group.
     * @param networkWatcherName The name of the network watcher resource.
     * @param targetResourceId The target resource where getting the flow logging status.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the FlowLogInformationInner object
     */
public Observable<ServiceResponse<FlowLogInformationInner>> beginGetFlowLogStatusWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
    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 (targetResourceId == null) {
        throw new IllegalArgumentException("Parameter targetResourceId is required and cannot be null.");
    }
    final String apiVersion = "2016-12-01";
    FlowLogStatusParameters parameters = new FlowLogStatusParameters();
    parameters.withTargetResourceId(targetResourceId);
    return service.beginGetFlowLogStatus(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<FlowLogInformationInner>>>() {

        @Override
        public Observable<ServiceResponse<FlowLogInformationInner>> call(Response<ResponseBody> response) {
            try {
                ServiceResponse<FlowLogInformationInner> clientResponse = beginGetFlowLogStatusDelegate(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) FlowLogStatusParameters(com.microsoft.azure.management.network.FlowLogStatusParameters) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody)

Aggregations

FlowLogStatusParameters (com.microsoft.azure.management.network.FlowLogStatusParameters)2 ServiceResponse (com.microsoft.rest.ServiceResponse)2 Response (retrofit2.Response)2 TypeToken (com.google.common.reflect.TypeToken)1 ResponseBody (okhttp3.ResponseBody)1 Observable (rx.Observable)1