Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See License.txt in the project root for license information. Code generated by Microsoft (R) AutoRest Code Generator.
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */
package com.microsoft.azure.management.network.implementation; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.Path; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.http.Url; import retrofit2.Response; import rx.functions.Func1; import rx.Observable;
An instance of this class provides access to all the operations defined in VpnConnections.
/** * An instance of this class provides access to all the operations defined * in VpnConnections. */
public class VpnConnectionsInner {
The Retrofit service to perform REST calls.
/** The Retrofit service to perform REST calls. */
private VpnConnectionsService service;
The service client containing this operation class.
/** The service client containing this operation class. */
private NetworkManagementClientImpl client;
Initializes an instance of VpnConnectionsInner.
Params:
  • retrofit – the Retrofit instance built from a Retrofit Builder.
  • client – the instance of the service client containing this operation class.
/** * Initializes an instance of VpnConnectionsInner. * * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */
public VpnConnectionsInner(Retrofit retrofit, NetworkManagementClientImpl client) { this.service = retrofit.create(VpnConnectionsService.class); this.client = client; }
The interface defining all the services for VpnConnections to be used by Retrofit to perform actually REST calls.
/** * The interface defining all the services for VpnConnections to be * used by Retrofit to perform actually REST calls. */
interface VpnConnectionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.VpnConnections get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") Observable<Response<ResponseBody>> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @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.VpnConnections createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") Observable<Response<ResponseBody>> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Body VpnConnectionInner vpnConnectionParameters, @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.VpnConnections beginCreateOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}") Observable<Response<ResponseBody>> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @Query("api-version") String apiVersion, @Body VpnConnectionInner vpnConnectionParameters, @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.VpnConnections delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @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.VpnConnections beginDelete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @Path("connectionName") String connectionName, @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.VpnConnections listByVpnGateway" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections") Observable<Response<ResponseBody>> listByVpnGateway(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("gatewayName") String gatewayName, @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.VpnConnections listByVpnGatewayNext" }) @GET Observable<Response<ResponseBody>> listByVpnGatewayNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); }
Retrieves the details of a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the vpn connection.
Throws:
Returns:the VpnConnectionInner object if successful.
/** * Retrieves the details of a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the vpn connection. * @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 VpnConnectionInner object if successful. */
public VpnConnectionInner get(String resourceGroupName, String gatewayName, String connectionName) { return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().single().body(); }
Retrieves the details of a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the vpn connection.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Retrieves the details of a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the vpn connection. * @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<VpnConnectionInner> getAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback<VpnConnectionInner> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); }
Retrieves the details of a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the vpn connection.
Throws:
Returns:the observable to the VpnConnectionInner object
/** * Retrieves the details of a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the vpn connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the VpnConnectionInner object */
public Observable<VpnConnectionInner> getAsync(String resourceGroupName, String gatewayName, String connectionName) { return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1<ServiceResponse<VpnConnectionInner>, VpnConnectionInner>() { @Override public VpnConnectionInner call(ServiceResponse<VpnConnectionInner> response) { return response.body(); } }); }
Retrieves the details of a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the vpn connection.
Throws:
Returns:the observable to the VpnConnectionInner object
/** * Retrieves the details of a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the vpn connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the VpnConnectionInner object */
public Observable<ServiceResponse<VpnConnectionInner>> getWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (gatewayName == null) { throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); } if (connectionName == null) { throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); } final String apiVersion = "2019-11-01"; return service.get(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<VpnConnectionInner>>>() { @Override public Observable<ServiceResponse<VpnConnectionInner>> call(Response<ResponseBody> response) { try { ServiceResponse<VpnConnectionInner> clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<VpnConnectionInner> getDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<VpnConnectionInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<VpnConnectionInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
  • vpnConnectionParameters – Parameters supplied to create or Update a VPN Connection.
Throws:
Returns:the VpnConnectionInner object if successful.
/** * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. * @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 VpnConnectionInner object if successful. */
public VpnConnectionInner createOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().last().body(); }
Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
  • vpnConnectionParameters – Parameters supplied to create or Update a VPN Connection.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. * @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<VpnConnectionInner> createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters, final ServiceCallback<VpnConnectionInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters), serviceCallback); }
Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
  • vpnConnectionParameters – Parameters supplied to create or Update a VPN Connection.
Throws:
Returns:the observable for the request
/** * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<VpnConnectionInner> createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Func1<ServiceResponse<VpnConnectionInner>, VpnConnectionInner>() { @Override public VpnConnectionInner call(ServiceResponse<VpnConnectionInner> response) { return response.body(); } }); }
Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
  • vpnConnectionParameters – Parameters supplied to create or Update a VPN Connection.
Throws:
Returns:the observable for the request
/** * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<VpnConnectionInner>> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (gatewayName == null) { throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); } if (connectionName == null) { throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); } if (vpnConnectionParameters == null) { throw new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null."); } Validator.validate(vpnConnectionParameters); final String apiVersion = "2019-11-01"; Observable<Response<ResponseBody>> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, vpnConnectionParameters, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<VpnConnectionInner>() { }.getType()); }
Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
  • vpnConnectionParameters – Parameters supplied to create or Update a VPN Connection.
Throws:
Returns:the VpnConnectionInner object if successful.
/** * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. * @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 VpnConnectionInner object if successful. */
public VpnConnectionInner beginCreateOrUpdate(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).toBlocking().single().body(); }
Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
  • vpnConnectionParameters – Parameters supplied to create or Update a VPN Connection.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. * @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<VpnConnectionInner> beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters, final ServiceCallback<VpnConnectionInner> serviceCallback) { return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters), serviceCallback); }
Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
  • vpnConnectionParameters – Parameters supplied to create or Update a VPN Connection.
Throws:
Returns:the observable to the VpnConnectionInner object
/** * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the VpnConnectionInner object */
public Observable<VpnConnectionInner> beginCreateOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Func1<ServiceResponse<VpnConnectionInner>, VpnConnectionInner>() { @Override public VpnConnectionInner call(ServiceResponse<VpnConnectionInner> response) { return response.body(); } }); }
Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
  • vpnConnectionParameters – Parameters supplied to create or Update a VPN Connection.
Throws:
Returns:the observable to the VpnConnectionInner object
/** * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @param vpnConnectionParameters Parameters supplied to create or Update a VPN Connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the VpnConnectionInner object */
public Observable<ServiceResponse<VpnConnectionInner>> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (gatewayName == null) { throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); } if (connectionName == null) { throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); } if (vpnConnectionParameters == null) { throw new IllegalArgumentException("Parameter vpnConnectionParameters is required and cannot be null."); } Validator.validate(vpnConnectionParameters); final String apiVersion = "2019-11-01"; return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, vpnConnectionParameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<VpnConnectionInner>>>() { @Override public Observable<ServiceResponse<VpnConnectionInner>> call(Response<ResponseBody> response) { try { ServiceResponse<VpnConnectionInner> clientResponse = beginCreateOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<VpnConnectionInner> beginCreateOrUpdateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<VpnConnectionInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<VpnConnectionInner>() { }.getType()) .register(201, new TypeToken<VpnConnectionInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Deletes a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
Throws:
/** * Deletes a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @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 gatewayName, String connectionName) { deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().last().body(); }
Deletes a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Deletes a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
public ServiceFuture<Void> deleteAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); }
Deletes a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
Throws:
Returns:the observable for the request
/** * Deletes a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<Void> deleteAsync(String resourceGroupName, String gatewayName, String connectionName) { return deleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Deletes a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
Throws:
Returns:the observable for the request
/** * Deletes a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (gatewayName == null) { throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); } if (connectionName == null) { throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); } final String apiVersion = "2019-11-01"; Observable<Response<ResponseBody>> observable = service.delete(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<Void>() { }.getType()); }
Deletes a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
Throws:
/** * Deletes a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @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 gatewayName, String connectionName) { beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).toBlocking().single().body(); }
Deletes a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Deletes a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
public ServiceFuture<Void> beginDeleteAsync(String resourceGroupName, String gatewayName, String connectionName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName), serviceCallback); }
Deletes a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> beginDeleteAsync(String resourceGroupName, String gatewayName, String connectionName) { return beginDeleteWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Deletes a vpn connection.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • connectionName – The name of the connection.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes a vpn connection. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param connectionName The name of the connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String gatewayName, String connectionName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (gatewayName == null) { throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); } if (connectionName == null) { throw new IllegalArgumentException("Parameter connectionName is required and cannot be null."); } final String apiVersion = "2019-11-01"; return service.beginDelete(this.client.subscriptionId(), resourceGroupName, gatewayName, connectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> beginDeleteDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(202, new TypeToken<Void>() { }.getType()) .register(204, new TypeToken<Void>() { }.getType()) .registerError(CloudException.class) .build(response); }
Retrieves all vpn connections for a particular virtual wan vpn gateway.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
Throws:
Returns:the PagedList<VpnConnectionInner> object if successful.
/** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList&lt;VpnConnectionInner&gt; object if successful. */
public PagedList<VpnConnectionInner> listByVpnGateway(final String resourceGroupName, final String gatewayName) { ServiceResponse<Page<VpnConnectionInner>> response = listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName).toBlocking().single(); return new PagedList<VpnConnectionInner>(response.body()) { @Override public Page<VpnConnectionInner> nextPage(String nextPageLink) { return listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Retrieves all vpn connections for a particular virtual wan vpn gateway.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
public ServiceFuture<List<VpnConnectionInner>> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName, final ListOperationCallback<VpnConnectionInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName), new Func1<String, Observable<ServiceResponse<Page<VpnConnectionInner>>>>() { @Override public Observable<ServiceResponse<Page<VpnConnectionInner>>> call(String nextPageLink) { return listByVpnGatewayNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Retrieves all vpn connections for a particular virtual wan vpn gateway.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
Throws:
Returns:the observable to the PagedList<VpnConnectionInner> object
/** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;VpnConnectionInner&gt; object */
public Observable<Page<VpnConnectionInner>> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) { return listByVpnGatewayWithServiceResponseAsync(resourceGroupName, gatewayName) .map(new Func1<ServiceResponse<Page<VpnConnectionInner>>, Page<VpnConnectionInner>>() { @Override public Page<VpnConnectionInner> call(ServiceResponse<Page<VpnConnectionInner>> response) { return response.body(); } }); }
Retrieves all vpn connections for a particular virtual wan vpn gateway.
Params:
  • resourceGroupName – The resource group name of the VpnGateway.
  • gatewayName – The name of the gateway.
Throws:
Returns:the observable to the PagedList<VpnConnectionInner> object
/** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * * @param resourceGroupName The resource group name of the VpnGateway. * @param gatewayName The name of the gateway. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;VpnConnectionInner&gt; object */
public Observable<ServiceResponse<Page<VpnConnectionInner>>> listByVpnGatewayWithServiceResponseAsync(final String resourceGroupName, final String gatewayName) { return listByVpnGatewaySinglePageAsync(resourceGroupName, gatewayName) .concatMap(new Func1<ServiceResponse<Page<VpnConnectionInner>>, Observable<ServiceResponse<Page<VpnConnectionInner>>>>() { @Override public Observable<ServiceResponse<Page<VpnConnectionInner>>> call(ServiceResponse<Page<VpnConnectionInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listByVpnGatewayNextWithServiceResponseAsync(nextPageLink)); } }); }
Retrieves all vpn connections for a particular virtual wan vpn gateway. ServiceResponse> * @param resourceGroupName The resource group name of the VpnGateway. ServiceResponse> * @param gatewayName The name of the gateway.
Throws:
Returns:the PagedList<VpnConnectionInner> object wrapped in ServiceResponse if successful.
/** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * ServiceResponse<PageImpl<VpnConnectionInner>> * @param resourceGroupName The resource group name of the VpnGateway. ServiceResponse<PageImpl<VpnConnectionInner>> * @param gatewayName The name of the gateway. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;VpnConnectionInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<VpnConnectionInner>>> listByVpnGatewaySinglePageAsync(final String resourceGroupName, final String gatewayName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (gatewayName == null) { throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); } final String apiVersion = "2019-11-01"; return service.listByVpnGateway(this.client.subscriptionId(), resourceGroupName, gatewayName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<VpnConnectionInner>>>>() { @Override public Observable<ServiceResponse<Page<VpnConnectionInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<VpnConnectionInner>> result = listByVpnGatewayDelegate(response); return Observable.just(new ServiceResponse<Page<VpnConnectionInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<VpnConnectionInner>> listByVpnGatewayDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<VpnConnectionInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<VpnConnectionInner>>() { }.getType()) .registerError(CloudException.class) .build(response); }
Retrieves all vpn connections for a particular virtual wan vpn gateway.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<VpnConnectionInner> object if successful.
/** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList&lt;VpnConnectionInner&gt; object if successful. */
public PagedList<VpnConnectionInner> listByVpnGatewayNext(final String nextPageLink) { ServiceResponse<Page<VpnConnectionInner>> response = listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<VpnConnectionInner>(response.body()) { @Override public Page<VpnConnectionInner> nextPage(String nextPageLink) { return listByVpnGatewayNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Retrieves all vpn connections for a particular virtual wan vpn gateway.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
  • serviceFuture – the ServiceFuture object tracking the Retrofit calls
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @param serviceFuture the ServiceFuture object tracking the Retrofit calls * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
public ServiceFuture<List<VpnConnectionInner>> listByVpnGatewayNextAsync(final String nextPageLink, final ServiceFuture<List<VpnConnectionInner>> serviceFuture, final ListOperationCallback<VpnConnectionInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listByVpnGatewayNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<VpnConnectionInner>>>>() { @Override public Observable<ServiceResponse<Page<VpnConnectionInner>>> call(String nextPageLink) { return listByVpnGatewayNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Retrieves all vpn connections for a particular virtual wan vpn gateway.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<VpnConnectionInner> object
/** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;VpnConnectionInner&gt; object */
public Observable<Page<VpnConnectionInner>> listByVpnGatewayNextAsync(final String nextPageLink) { return listByVpnGatewayNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<VpnConnectionInner>>, Page<VpnConnectionInner>>() { @Override public Page<VpnConnectionInner> call(ServiceResponse<Page<VpnConnectionInner>> response) { return response.body(); } }); }
Retrieves all vpn connections for a particular virtual wan vpn gateway.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<VpnConnectionInner> object
/** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;VpnConnectionInner&gt; object */
public Observable<ServiceResponse<Page<VpnConnectionInner>>> listByVpnGatewayNextWithServiceResponseAsync(final String nextPageLink) { return listByVpnGatewayNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<VpnConnectionInner>>, Observable<ServiceResponse<Page<VpnConnectionInner>>>>() { @Override public Observable<ServiceResponse<Page<VpnConnectionInner>>> call(ServiceResponse<Page<VpnConnectionInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listByVpnGatewayNextWithServiceResponseAsync(nextPageLink)); } }); }
Retrieves all vpn connections for a particular virtual wan vpn gateway. ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<VpnConnectionInner> object wrapped in ServiceResponse if successful.
/** * Retrieves all vpn connections for a particular virtual wan vpn gateway. * ServiceResponse<PageImpl<VpnConnectionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;VpnConnectionInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<VpnConnectionInner>>> listByVpnGatewayNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); return service.listByVpnGatewayNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<VpnConnectionInner>>>>() { @Override public Observable<ServiceResponse<Page<VpnConnectionInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<VpnConnectionInner>> result = listByVpnGatewayNextDelegate(response); return Observable.just(new ServiceResponse<Page<VpnConnectionInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<VpnConnectionInner>> listByVpnGatewayNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<VpnConnectionInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<VpnConnectionInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } }