Search in sources :

Example 61 with ServiceResponse

use of com.microsoft.rest.ServiceResponse in project azure-sdk-for-java by Azure.

the class NetworkWatchersInner method beginGetVMSecurityRulesWithServiceResponseAsync.

/**
     * Gets the configured and effective security group rules on the specified VM.
     *
     * @param resourceGroupName The name of the resource group.
     * @param networkWatcherName The name of the network watcher.
     * @param targetResourceId ID of the target VM.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the SecurityGroupViewResultInner object
     */
public Observable<ServiceResponse<SecurityGroupViewResultInner>> beginGetVMSecurityRulesWithServiceResponseAsync(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";
    SecurityGroupViewParameters parameters = new SecurityGroupViewParameters();
    parameters.withTargetResourceId(targetResourceId);
    return service.beginGetVMSecurityRules(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<SecurityGroupViewResultInner>>>() {

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

Example 62 with ServiceResponse

use of com.microsoft.rest.ServiceResponse in project azure-sdk-for-java by Azure.

the class NetworkWatchersInner method beginGetTroubleshootingResultWithServiceResponseAsync.

/**
     * Get the last completed troubleshooting result on a specified resource.
     *
     * @param resourceGroupName The name of the resource group.
     * @param networkWatcherName The name of the network watcher resource.
     * @param targetResourceId The target resource ID to query the troubleshooting result.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the TroubleshootingResultInner object
     */
public Observable<ServiceResponse<TroubleshootingResultInner>> beginGetTroubleshootingResultWithServiceResponseAsync(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";
    QueryTroubleshootingParameters parameters = new QueryTroubleshootingParameters();
    parameters.withTargetResourceId(targetResourceId);
    return service.beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<TroubleshootingResultInner>>>() {

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

Example 63 with ServiceResponse

use of com.microsoft.rest.ServiceResponse in project azure-sdk-for-java by Azure.

the class NetworkWatchersInner method getVMSecurityRulesWithServiceResponseAsync.

/**
     * Gets the configured and effective security group rules on the specified VM.
     *
     * @param resourceGroupName The name of the resource group.
     * @param networkWatcherName The name of the network watcher.
     * @param targetResourceId ID of the target VM.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable for the request
     */
public Observable<ServiceResponse<SecurityGroupViewResultInner>> getVMSecurityRulesWithServiceResponseAsync(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";
    SecurityGroupViewParameters parameters = new SecurityGroupViewParameters();
    parameters.withTargetResourceId(targetResourceId);
    Observable<Response<ResponseBody>> observable = service.getVMSecurityRules(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent());
    return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<SecurityGroupViewResultInner>() {
    }.getType());
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) SecurityGroupViewParameters(com.microsoft.azure.management.network.SecurityGroupViewParameters) TypeToken(com.google.common.reflect.TypeToken)

Example 64 with ServiceResponse

use of com.microsoft.rest.ServiceResponse in project azure-sdk-for-java by Azure.

the class NetworkWatchersInner method getTroubleshootingResultWithServiceResponseAsync.

/**
     * Get the last completed troubleshooting result on a specified resource.
     *
     * @param resourceGroupName The name of the resource group.
     * @param networkWatcherName The name of the network watcher resource.
     * @param targetResourceId The target resource ID to query the troubleshooting result.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable for the request
     */
public Observable<ServiceResponse<TroubleshootingResultInner>> getTroubleshootingResultWithServiceResponseAsync(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";
    QueryTroubleshootingParameters parameters = new QueryTroubleshootingParameters();
    parameters.withTargetResourceId(targetResourceId);
    Observable<Response<ResponseBody>> observable = service.getTroubleshootingResult(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent());
    return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<TroubleshootingResultInner>() {
    }.getType());
}
Also used : Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) TypeToken(com.google.common.reflect.TypeToken) QueryTroubleshootingParameters(com.microsoft.azure.management.network.QueryTroubleshootingParameters)

Example 65 with ServiceResponse

use of com.microsoft.rest.ServiceResponse 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

ServiceResponse (com.microsoft.rest.ServiceResponse)114 Response (retrofit2.Response)114 ResponseBody (okhttp3.ResponseBody)92 Observable (rx.Observable)92 TypeToken (com.google.common.reflect.TypeToken)22 VirtualMachineScaleSetVMInstanceIDs (com.microsoft.azure.management.compute.VirtualMachineScaleSetVMInstanceIDs)16 KeyBundle (com.microsoft.azure.keyvault.models.KeyBundle)7 CertificateBundle (com.microsoft.azure.keyvault.models.CertificateBundle)6 RegenerateKeysParameters (com.microsoft.azure.management.servicebus.RegenerateKeysParameters)6 CertificateAttributes (com.microsoft.azure.keyvault.models.CertificateAttributes)4 IssuerBundle (com.microsoft.azure.keyvault.models.IssuerBundle)4 KeyOperationResult (com.microsoft.azure.keyvault.models.KeyOperationResult)4 SecretBundle (com.microsoft.azure.keyvault.models.SecretBundle)4 CsmPublishingProfileOptions (com.microsoft.azure.management.appservice.CsmPublishingProfileOptions)4 FailoverPolicies (com.microsoft.azure.management.documentdb.FailoverPolicies)4 RoleAssignmentCreateParameters (com.microsoft.azure.management.graphrbac.RoleAssignmentCreateParameters)4 InputStream (java.io.InputStream)4 Page (com.microsoft.azure.Page)3 CertificateOperation (com.microsoft.azure.keyvault.models.CertificateOperation)3 CertificatePolicy (com.microsoft.azure.keyvault.models.CertificatePolicy)3