com.microsoft.azure.management.network.implementation.NetworkInterfacesInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-mgmt-network Show documentation
Show all versions of azure-mgmt-network Show documentation
This package contains Microsoft Azure Network Management SDK.
/**
* 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.management.network.TagsObject;
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 java.util.Map;
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.PATCH;
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;
import com.microsoft.azure.LongRunningFinalState;
import com.microsoft.azure.LongRunningOperationOptions;
/**
* An instance of this class provides access to all the operations defined
* in NetworkInterfaces.
*/
public class NetworkInterfacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing {
/** The Retrofit service to perform REST calls. */
private NetworkInterfacesService service;
/** The service client containing this operation class. */
private NetworkManagementClientImpl client;
/**
* Initializes an instance of NetworkInterfacesInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public NetworkInterfacesInner(Retrofit retrofit, NetworkManagementClientImpl client) {
this.service = retrofit.create(NetworkInterfacesService.class);
this.client = client;
}
/**
* The interface defining all the services for NetworkInterfaces to be
* used by Retrofit to perform actually REST calls.
*/
interface NetworkInterfacesService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.NetworkInterfaces delete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", method = "DELETE", hasBody = true)
Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.NetworkInterfaces beginDelete" })
@HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", method = "DELETE", hasBody = true)
Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.NetworkInterfaces getByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}")
Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.NetworkInterfaces createOrUpdate" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}")
Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceInner 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.NetworkInterfaces beginCreateOrUpdate" })
@PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}")
Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Body NetworkInterfaceInner 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.NetworkInterfaces updateTags" })
@PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}")
Observable> updateTags(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsObject parameters, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.NetworkInterfaces list" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces")
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.NetworkInterfaces listByResourceGroup" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces")
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.NetworkInterfaces getEffectiveRouteTable" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable")
Observable> getEffectiveRouteTable(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.NetworkInterfaces beginGetEffectiveRouteTable" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable")
Observable> beginGetEffectiveRouteTable(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.NetworkInterfaces listEffectiveNetworkSecurityGroups" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups")
Observable> listEffectiveNetworkSecurityGroups(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.NetworkInterfaces beginListEffectiveNetworkSecurityGroups" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups")
Observable> beginListEffectiveNetworkSecurityGroups(@Path("resourceGroupName") String resourceGroupName, @Path("networkInterfaceName") String networkInterfaceName, @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.NetworkInterfaces listVirtualMachineScaleSetVMNetworkInterfaces" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces")
Observable> listVirtualMachineScaleSetVMNetworkInterfaces(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @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.NetworkInterfaces listVirtualMachineScaleSetNetworkInterfaces" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces")
Observable> listVirtualMachineScaleSetNetworkInterfaces(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @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.NetworkInterfaces getVirtualMachineScaleSetNetworkInterface" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}")
Observable> getVirtualMachineScaleSetNetworkInterface(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.NetworkInterfaces listVirtualMachineScaleSetIpConfigurations" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations")
Observable> listVirtualMachineScaleSetIpConfigurations(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.NetworkInterfaces getVirtualMachineScaleSetIpConfiguration" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}")
Observable> getVirtualMachineScaleSetIpConfiguration(@Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineScaleSetName") String virtualMachineScaleSetName, @Path("virtualmachineIndex") String virtualmachineIndex, @Path("networkInterfaceName") String networkInterfaceName, @Path("ipConfigurationName") String ipConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @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.NetworkInterfaces listNext" })
@GET
Observable> listNext(@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.NetworkInterfaces 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.NetworkInterfaces listVirtualMachineScaleSetVMNetworkInterfacesNext" })
@GET
Observable> listVirtualMachineScaleSetVMNetworkInterfacesNext(@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.NetworkInterfaces listVirtualMachineScaleSetNetworkInterfacesNext" })
@GET
Observable> listVirtualMachineScaleSetNetworkInterfacesNext(@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.NetworkInterfaces listVirtualMachineScaleSetIpConfigurationsNext" })
@GET
Observable> listVirtualMachineScaleSetIpConfigurationsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
/**
* Deletes the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 networkInterfaceName) {
deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body();
}
/**
* Deletes the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 networkInterfaceName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback);
}
/**
* Deletes the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable deleteAsync(String resourceGroupName, String networkInterfaceName) {
return deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() {
@Override
public Void call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Deletes the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName 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 = "2019-11-01";
Observable> observable = service.delete(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType());
}
/**
* Deletes the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 networkInterfaceName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body();
}
/**
* Deletes the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 networkInterfaceName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback);
}
/**
* Deletes the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable beginDeleteAsync(String resourceGroupName, String networkInterfaceName) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() {
@Override
public Void call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Deletes the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName 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 = "2019-11-01";
return service.beginDelete(resourceGroupName, networkInterfaceName, 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(200, new TypeToken() { }.getType())
.register(202, new TypeToken() { }.getType())
.register(204, new TypeToken() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Gets information about the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 NetworkInterfaceInner object if successful.
*/
public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body();
}
/**
* Gets information about the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 networkInterfaceName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback);
}
/**
* Gets information about the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the NetworkInterfaceInner object
*/
public Observable getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() {
@Override
public NetworkInterfaceInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets information about the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the NetworkInterfaceInner object
*/
public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName 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 = "2019-11-01";
final String expand = null;
return service.getByResourceGroup(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, 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);
}
}
});
}
/**
* Gets information about the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param expand Expands referenced resources.
* @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 NetworkInterfaceInner object if successful.
*/
public NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String networkInterfaceName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).toBlocking().single().body();
}
/**
* Gets information about the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param expand Expands referenced resources.
* @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 networkInterfaceName, String expand, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand), serviceCallback);
}
/**
* Gets information about the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param expand Expands referenced resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the NetworkInterfaceInner object
*/
public Observable getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).map(new Func1, NetworkInterfaceInner>() {
@Override
public NetworkInterfaceInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets information about the specified network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param expand Expands referenced resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the NetworkInterfaceInner object
*/
public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String expand) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName 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 = "2019-11-01";
return service.getByResourceGroup(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, expand, 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 a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param parameters Parameters supplied to the create or update network interface 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 NetworkInterfaceInner object if successful.
*/
public NetworkInterfaceInner createOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().last().body();
}
/**
* Creates or updates a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param parameters Parameters supplied to the create or update network interface 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 networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback);
}
/**
* Creates or updates a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param parameters Parameters supplied to the create or update network interface operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() {
@Override
public NetworkInterfaceInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Creates or updates a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param parameters Parameters supplied to the create or update network interface operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName 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 = "2019-11-01";
Observable> observable = service.createOrUpdate(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType());
}
/**
* Creates or updates a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param parameters Parameters supplied to the create or update network interface 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 NetworkInterfaceInner object if successful.
*/
public NetworkInterfaceInner beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().single().body();
}
/**
* Creates or updates a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param parameters Parameters supplied to the create or update network interface 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 networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback);
}
/**
* Creates or updates a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param parameters Parameters supplied to the create or update network interface operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the NetworkInterfaceInner object
*/
public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() {
@Override
public NetworkInterfaceInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Creates or updates a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param parameters Parameters supplied to the create or update network interface operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the NetworkInterfaceInner object
*/
public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName 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 = "2019-11-01";
return service.beginCreateOrUpdate(resourceGroupName, networkInterfaceName, 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(200, new TypeToken() { }.getType())
.register(201, new TypeToken() { }.getType())
.registerError(CloudException.class)
.build(response);
}
/**
* Updates a network interface tags.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 NetworkInterfaceInner object if successful.
*/
public NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body();
}
/**
* Updates a network interface tags.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 updateTagsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback);
}
/**
* Updates a network interface tags.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the NetworkInterfaceInner object
*/
public Observable updateTagsAsync(String resourceGroupName, String networkInterfaceName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() {
@Override
public NetworkInterfaceInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Updates a network interface tags.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the NetworkInterfaceInner object
*/
public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName 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 = "2019-11-01";
final Map tags = null;
TagsObject parameters = new TagsObject();
parameters.withTags(null);
return service.updateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = updateTagsDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
/**
* Updates a network interface tags.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param tags Resource tags.
* @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 NetworkInterfaceInner object if successful.
*/
public NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName, Map tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).toBlocking().single().body();
}
/**
* Updates a network interface tags.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param tags Resource tags.
* @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 updateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags), serviceCallback);
}
/**
* Updates a network interface tags.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param tags Resource tags.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the NetworkInterfaceInner object
*/
public Observable updateTagsAsync(String resourceGroupName, String networkInterfaceName, Map tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tags).map(new Func1, NetworkInterfaceInner>() {
@Override
public NetworkInterfaceInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Updates a network interface tags.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param tags Resource tags.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the NetworkInterfaceInner object
*/
public Observable> updateTagsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, Map tags) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
Validator.validate(tags);
final String apiVersion = "2019-11-01";
TagsObject parameters = new TagsObject();
parameters.withTags(tags);
return service.updateTags(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = updateTagsDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse updateTagsDelegate(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 network interfaces 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<NetworkInterfaceInner> 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 network interfaces 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 network interfaces in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<NetworkInterfaceInner> object
*/
public Observable> listAsync() {
return listWithServiceResponseAsync()
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets all network interfaces in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<NetworkInterfaceInner> 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 network interfaces in a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<NetworkInterfaceInner> 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 = "2019-11-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 network interfaces 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<NetworkInterfaceInner> 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 network interfaces 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 network interfaces 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<NetworkInterfaceInner> 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 network interfaces 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<NetworkInterfaceInner> 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 network interfaces in a resource group.
*
ServiceResponse> * @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<NetworkInterfaceInner> 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 = "2019-11-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 route tables applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 EffectiveRouteListResultInner object if successful.
*/
public EffectiveRouteListResultInner getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) {
return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body();
}
/**
* Gets all route tables applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback);
}
/**
* Gets all route tables applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) {
return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() {
@Override
public EffectiveRouteListResultInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets all route tables applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> getEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName 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 = "2019-11-01";
Observable> observable = service.getEffectiveRouteTable(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType());
}
/**
* Gets all route tables applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 EffectiveRouteListResultInner object if successful.
*/
public EffectiveRouteListResultInner beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) {
return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body();
}
/**
* Gets all route tables applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback);
}
/**
* Gets all route tables applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the EffectiveRouteListResultInner object
*/
public Observable beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) {
return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() {
@Override
public EffectiveRouteListResultInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets all route tables applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the EffectiveRouteListResultInner object
*/
public Observable> beginGetEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName 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 = "2019-11-01";
return service.beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = beginGetEffectiveRouteTableDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse beginGetEffectiveRouteTableDelegate(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 network security groups applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 EffectiveNetworkSecurityGroupListResultInner object if successful.
*/
public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) {
return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body();
}
/**
* Gets all network security groups applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback);
}
/**
* Gets all network security groups applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) {
return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() {
@Override
public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets all network security groups applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
public Observable> listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName 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 = "2019-11-01";
Observable> observable = service.listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType());
}
/**
* Gets all network security groups applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 EffectiveNetworkSecurityGroupListResultInner object if successful.
*/
public EffectiveNetworkSecurityGroupListResultInner beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) {
return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().body();
}
/**
* Gets all network security groups applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @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 beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) {
return ServiceFuture.fromResponse(beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback);
}
/**
* Gets all network security groups applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the EffectiveNetworkSecurityGroupListResultInner object
*/
public Observable beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) {
return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() {
@Override
public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) {
return response.body();
}
});
}
/**
* Gets all network security groups applied to a network interface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the EffectiveNetworkSecurityGroupListResultInner object
*/
public Observable> beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkInterfaceName == null) {
throw new IllegalArgumentException("Parameter networkInterfaceName 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 = "2019-11-01";
return service.beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1, Observable>>() {
@Override
public Observable> call(Response response) {
try {
ServiceResponse clientResponse = beginListEffectiveNetworkSecurityGroupsDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse beginListEffectiveNetworkSecurityGroupsDelegate(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 information about all network interfaces in a virtual machine in a virtual machine scale set.
*
* @param resourceGroupName The name of the resource group.
* @param virtualMachineScaleSetName The name of the virtual machine scale set.
* @param virtualmachineIndex The virtual machine index.
* @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<NetworkInterfaceInner> object if successful.
*/
public PagedList listVirtualMachineScaleSetVMNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) {
ServiceResponse> response = listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex).toBlocking().single();
return new PagedList(response.body()) {
@Override
public Page nextPage(String nextPageLink) {
return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
}
/**
* Gets information about all network interfaces in a virtual machine in a virtual machine scale set.
*
* @param resourceGroupName The name of the resource group.
* @param virtualMachineScaleSetName The name of the virtual machine scale set.
* @param virtualmachineIndex The virtual machine index.
* @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> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final ListOperationCallback serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex),
new Func1>>>() {
@Override
public Observable>> call(String nextPageLink) {
return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
}
/**
* Gets information about all network interfaces in a virtual machine in a virtual machine scale set.
*
* @param resourceGroupName The name of the resource group.
* @param virtualMachineScaleSetName The name of the virtual machine scale set.
* @param virtualmachineIndex The virtual machine index.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<NetworkInterfaceInner> object
*/
public Observable> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) {
return listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex)
.map(new Func1>, Page>() {
@Override
public Page call(ServiceResponse> response) {
return response.body();
}
});
}
/**
* Gets information about all network interfaces in a virtual machine in a virtual machine scale set.
*
* @param resourceGroupName The name of the resource group.
* @param virtualMachineScaleSetName The name of the virtual machine scale set.
* @param virtualmachineIndex The virtual machine index.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<NetworkInterfaceInner> object
*/
public Observable