
com.azure.resourcemanager.network.implementation.ExpressRouteCrossConnectionsClientImpl Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.network.implementation;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Patch;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.network.fluent.ExpressRouteCrossConnectionsClient;
import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsArpTableListResultInner;
import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitsRoutesTableListResultInner;
import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionInner;
import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner;
import com.azure.resourcemanager.network.models.ExpressRouteCrossConnectionListResult;
import com.azure.resourcemanager.network.models.TagsObject;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* An instance of this class provides access to all the operations defined in ExpressRouteCrossConnectionsClient.
*/
public final class ExpressRouteCrossConnectionsClientImpl implements InnerSupportsGet,
InnerSupportsListing, ExpressRouteCrossConnectionsClient {
/**
* The proxy service used to perform REST calls.
*/
private final ExpressRouteCrossConnectionsService service;
/**
* The service client containing this operation class.
*/
private final NetworkManagementClientImpl client;
/**
* Initializes an instance of ExpressRouteCrossConnectionsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
ExpressRouteCrossConnectionsClientImpl(NetworkManagementClientImpl client) {
this.service = RestProxy.create(ExpressRouteCrossConnectionsService.class, client.getHttpPipeline(),
client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for NetworkManagementClientExpressRouteCrossConnections to be used by the
* proxy service to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "NetworkManagementCli")
public interface ExpressRouteCrossConnectionsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("crossConnectionName") String crossConnectionName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdate(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("crossConnectionName") String crossConnectionName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@BodyParam("application/json") ExpressRouteCrossConnectionInner parameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> updateTags(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("crossConnectionName") String crossConnectionName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@BodyParam("application/json") TagsObject crossConnectionParameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> listArpTable(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("crossConnectionName") String crossConnectionName, @PathParam("peeringName") String peeringName,
@PathParam("devicePath") String devicePath, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> listRoutesTableSummary(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("crossConnectionName") String crossConnectionName, @PathParam("peeringName") String peeringName,
@PathParam("devicePath") String devicePath, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> listRoutesTable(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("crossConnectionName") String crossConnectionName, @PathParam("peeringName") String peeringName,
@PathParam("devicePath") String devicePath, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByResourceGroupNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
}
/**
* Retrieves all the ExpressRouteCrossConnections in a subscription.
*
* @param filter The filter to apply on the operation. For example, you can use $filter=name eq
* '{circuitServiceKey}'.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String filter) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(),
filter, accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a subscription.
*
* @param filter The filter to apply on the operation. For example, you can use $filter=name eq
* '{circuitServiceKey}'.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String filter, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a subscription.
*
* @param filter The filter to apply on the operation. For example, you can use $filter=name eq
* '{circuitServiceKey}'.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listAsync(String filter) {
return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a subscription.
*
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listAsync() {
final String filter = null;
return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a subscription.
*
* @param filter The filter to apply on the operation. For example, you can use $filter=name eq
* '{circuitServiceKey}'.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(String filter, Context context) {
return new PagedFlux<>(() -> listSinglePageAsync(filter, context),
nextLink -> listNextSinglePageAsync(nextLink, context));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a subscription.
*
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
final String filter = null;
return new PagedIterable<>(listAsync(filter));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a subscription.
*
* @param filter The filter to apply on the operation. For example, you can use $filter=name eq
* '{circuitServiceKey}'.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String filter, Context context) {
return new PagedIterable<>(listAsync(filter, context));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listByResourceGroupSinglePageAsync(String resourceGroupName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName,
apiVersion, this.client.getSubscriptionId(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion,
this.client.getSubscriptionId(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listByResourceGroupAsync(String resourceGroupName) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName,
Context context) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
}
/**
* Retrieves all the ExpressRouteCrossConnections in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName,
Context context) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
}
/**
* Gets details about the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group (peering location of the circuit).
* @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit).
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return details about the specified ExpressRouteCrossConnection along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>
getByResourceGroupWithResponseAsync(String resourceGroupName, String crossConnectionName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName,
crossConnectionName, apiVersion, this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets details about the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group (peering location of the circuit).
* @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit).
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return details about the specified ExpressRouteCrossConnection along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
getByResourceGroupWithResponseAsync(String resourceGroupName, String crossConnectionName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, crossConnectionName, apiVersion,
this.client.getSubscriptionId(), accept, context);
}
/**
* Gets details about the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group (peering location of the circuit).
* @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit).
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return details about the specified ExpressRouteCrossConnection on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getByResourceGroupAsync(String resourceGroupName,
String crossConnectionName) {
return getByResourceGroupWithResponseAsync(resourceGroupName, crossConnectionName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets details about the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group (peering location of the circuit).
* @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit).
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return details about the specified ExpressRouteCrossConnection along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByResourceGroupWithResponse(String resourceGroupName,
String crossConnectionName, Context context) {
return getByResourceGroupWithResponseAsync(resourceGroupName, crossConnectionName, context).block();
}
/**
* Gets details about the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group (peering location of the circuit).
* @param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit).
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return details about the specified ExpressRouteCrossConnection.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExpressRouteCrossConnectionInner getByResourceGroup(String resourceGroupName, String crossConnectionName) {
return getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, Context.NONE).getValue();
}
/**
* Update the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param parameters Parameters supplied to the update express route crossConnection operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return expressRouteCrossConnection resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String crossConnectionName, ExpressRouteCrossConnectionInner parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName,
crossConnectionName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Update the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param parameters Parameters supplied to the update express route crossConnection operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return expressRouteCrossConnection resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String crossConnectionName, ExpressRouteCrossConnectionInner parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, crossConnectionName, apiVersion,
this.client.getSubscriptionId(), parameters, accept, context);
}
/**
* Update the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param parameters Parameters supplied to the update express route crossConnection operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of expressRouteCrossConnection resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, ExpressRouteCrossConnectionInner>
beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName,
ExpressRouteCrossConnectionInner parameters) {
Mono>> mono
= createOrUpdateWithResponseAsync(resourceGroupName, crossConnectionName, parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ExpressRouteCrossConnectionInner.class,
ExpressRouteCrossConnectionInner.class, this.client.getContext());
}
/**
* Update the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param parameters Parameters supplied to the update express route crossConnection operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of expressRouteCrossConnection resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ExpressRouteCrossConnectionInner>
beginCreateOrUpdateAsync(String resourceGroupName, String crossConnectionName,
ExpressRouteCrossConnectionInner parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createOrUpdateWithResponseAsync(resourceGroupName, crossConnectionName, parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ExpressRouteCrossConnectionInner.class,
ExpressRouteCrossConnectionInner.class, context);
}
/**
* Update the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param parameters Parameters supplied to the update express route crossConnection operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of expressRouteCrossConnection resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ExpressRouteCrossConnectionInner>
beginCreateOrUpdate(String resourceGroupName, String crossConnectionName,
ExpressRouteCrossConnectionInner parameters) {
return this.beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).getSyncPoller();
}
/**
* Update the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param parameters Parameters supplied to the update express route crossConnection operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of expressRouteCrossConnection resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ExpressRouteCrossConnectionInner>
beginCreateOrUpdate(String resourceGroupName, String crossConnectionName,
ExpressRouteCrossConnectionInner parameters, Context context) {
return this.beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters, context)
.getSyncPoller();
}
/**
* Update the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param parameters Parameters supplied to the update express route crossConnection operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return expressRouteCrossConnection resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono createOrUpdateAsync(String resourceGroupName,
String crossConnectionName, ExpressRouteCrossConnectionInner parameters) {
return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param parameters Parameters supplied to the update express route crossConnection operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return expressRouteCrossConnection resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName,
String crossConnectionName, ExpressRouteCrossConnectionInner parameters, Context context) {
return beginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param parameters Parameters supplied to the update express route crossConnection operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return expressRouteCrossConnection resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExpressRouteCrossConnectionInner createOrUpdate(String resourceGroupName, String crossConnectionName,
ExpressRouteCrossConnectionInner parameters) {
return createOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).block();
}
/**
* Update the specified ExpressRouteCrossConnection.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param parameters Parameters supplied to the update express route crossConnection operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return expressRouteCrossConnection resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExpressRouteCrossConnectionInner createOrUpdate(String resourceGroupName, String crossConnectionName,
ExpressRouteCrossConnectionInner parameters, Context context) {
return createOrUpdateAsync(resourceGroupName, crossConnectionName, parameters, context).block();
}
/**
* Updates an express route cross connection tags.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the cross connection.
* @param crossConnectionParameters Parameters supplied to update express route cross connection tags.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return expressRouteCrossConnection resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> updateTagsWithResponseAsync(String resourceGroupName,
String crossConnectionName, TagsObject crossConnectionParameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (crossConnectionParameters == null) {
return Mono.error(
new IllegalArgumentException("Parameter crossConnectionParameters is required and cannot be null."));
} else {
crossConnectionParameters.validate();
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.updateTags(this.client.getEndpoint(), resourceGroupName, crossConnectionName,
apiVersion, this.client.getSubscriptionId(), crossConnectionParameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Updates an express route cross connection tags.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the cross connection.
* @param crossConnectionParameters Parameters supplied to update express route cross connection tags.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return expressRouteCrossConnection resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateTagsWithResponseAsync(String resourceGroupName,
String crossConnectionName, TagsObject crossConnectionParameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (crossConnectionParameters == null) {
return Mono.error(
new IllegalArgumentException("Parameter crossConnectionParameters is required and cannot be null."));
} else {
crossConnectionParameters.validate();
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.updateTags(this.client.getEndpoint(), resourceGroupName, crossConnectionName, apiVersion,
this.client.getSubscriptionId(), crossConnectionParameters, accept, context);
}
/**
* Updates an express route cross connection tags.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the cross connection.
* @param crossConnectionParameters Parameters supplied to update express route cross connection tags.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return expressRouteCrossConnection resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono updateTagsAsync(String resourceGroupName, String crossConnectionName,
TagsObject crossConnectionParameters) {
return updateTagsWithResponseAsync(resourceGroupName, crossConnectionName, crossConnectionParameters)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Updates an express route cross connection tags.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the cross connection.
* @param crossConnectionParameters Parameters supplied to update express route cross connection tags.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return expressRouteCrossConnection resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response updateTagsWithResponse(String resourceGroupName,
String crossConnectionName, TagsObject crossConnectionParameters, Context context) {
return updateTagsWithResponseAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, context)
.block();
}
/**
* Updates an express route cross connection tags.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the cross connection.
* @param crossConnectionParameters Parameters supplied to update express route cross connection tags.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return expressRouteCrossConnection resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExpressRouteCrossConnectionInner updateTags(String resourceGroupName, String crossConnectionName,
TagsObject crossConnectionParameters) {
return updateTagsWithResponse(resourceGroupName, crossConnectionName, crossConnectionParameters, Context.NONE)
.getValue();
}
/**
* Gets the currently advertised ARP table associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised ARP table associated with the express route cross connection in a resource group
* along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> listArpTableWithResponseAsync(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (peeringName == null) {
return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null."));
}
if (devicePath == null) {
return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listArpTable(this.client.getEndpoint(), resourceGroupName, crossConnectionName,
peeringName, devicePath, apiVersion, this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the currently advertised ARP table associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised ARP table associated with the express route cross connection in a resource group
* along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> listArpTableWithResponseAsync(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (peeringName == null) {
return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null."));
}
if (devicePath == null) {
return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listArpTable(this.client.getEndpoint(), resourceGroupName, crossConnectionName, peeringName,
devicePath, apiVersion, this.client.getSubscriptionId(), accept, context);
}
/**
* Gets the currently advertised ARP table associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of the currently advertised ARP table associated with the express
* route cross connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
PollerFlux, ExpressRouteCircuitsArpTableListResultInner>
beginListArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName,
String devicePath) {
Mono>> mono
= listArpTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath);
return this.client
.getLroResult(
mono, this.client.getHttpPipeline(), ExpressRouteCircuitsArpTableListResultInner.class,
ExpressRouteCircuitsArpTableListResultInner.class, this.client.getContext());
}
/**
* Gets the currently advertised ARP table associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of the currently advertised ARP table associated with the express
* route cross connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private
PollerFlux, ExpressRouteCircuitsArpTableListResultInner>
beginListArpTableAsync(String resourceGroupName, String crossConnectionName, String peeringName,
String devicePath, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= listArpTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context);
return this.client
.getLroResult(
mono, this.client.getHttpPipeline(), ExpressRouteCircuitsArpTableListResultInner.class,
ExpressRouteCircuitsArpTableListResultInner.class, context);
}
/**
* Gets the currently advertised ARP table associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of the currently advertised ARP table associated with the express
* route cross connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
SyncPoller, ExpressRouteCircuitsArpTableListResultInner>
beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
return this.beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath)
.getSyncPoller();
}
/**
* Gets the currently advertised ARP table associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of the currently advertised ARP table associated with the express
* route cross connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
SyncPoller, ExpressRouteCircuitsArpTableListResultInner>
beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath,
Context context) {
return this.beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context)
.getSyncPoller();
}
/**
* Gets the currently advertised ARP table associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised ARP table associated with the express route cross connection in a resource group
* on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono listArpTableAsync(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath) {
return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the currently advertised ARP table associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised ARP table associated with the express route cross connection in a resource group
* on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono listArpTableAsync(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath, Context context) {
return beginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the currently advertised ARP table associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised ARP table associated with the express route cross connection in a resource
* group.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath) {
return listArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).block();
}
/**
* Gets the currently advertised ARP table associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised ARP table associated with the express route cross connection in a resource
* group.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath, Context context) {
return listArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context).block();
}
/**
* Gets the route table summary associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the route table summary associated with the express route cross connection in a resource group along with
* {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> listRoutesTableSummaryWithResponseAsync(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (peeringName == null) {
return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null."));
}
if (devicePath == null) {
return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listRoutesTableSummary(this.client.getEndpoint(), resourceGroupName,
crossConnectionName, peeringName, devicePath, apiVersion, this.client.getSubscriptionId(), accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the route table summary associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the route table summary associated with the express route cross connection in a resource group along with
* {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> listRoutesTableSummaryWithResponseAsync(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (peeringName == null) {
return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null."));
}
if (devicePath == null) {
return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listRoutesTableSummary(this.client.getEndpoint(), resourceGroupName, crossConnectionName,
peeringName, devicePath, apiVersion, this.client.getSubscriptionId(), accept, context);
}
/**
* Gets the route table summary associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of the route table summary associated with the express route cross
* connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
PollerFlux, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>
beginListRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName,
String devicePath) {
Mono>> mono
= listRoutesTableSummaryWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath);
return this.client
.getLroResult(
mono, this.client.getHttpPipeline(),
ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class,
ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, this.client.getContext());
}
/**
* Gets the route table summary associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of the route table summary associated with the express route cross
* connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private
PollerFlux, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>
beginListRoutesTableSummaryAsync(String resourceGroupName, String crossConnectionName, String peeringName,
String devicePath, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = listRoutesTableSummaryWithResponseAsync(resourceGroupName,
crossConnectionName, peeringName, devicePath, context);
return this.client
.getLroResult(
mono, this.client.getHttpPipeline(),
ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class,
ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.class, context);
}
/**
* Gets the route table summary associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of the route table summary associated with the express route cross
* connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
SyncPoller, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>
beginListRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName,
String devicePath) {
return this.beginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath)
.getSyncPoller();
}
/**
* Gets the route table summary associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of the route table summary associated with the express route cross
* connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
SyncPoller, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner>
beginListRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName,
String devicePath, Context context) {
return this
.beginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context)
.getSyncPoller();
}
/**
* Gets the route table summary associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the route table summary associated with the express route cross connection in a resource group on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono listRoutesTableSummaryAsync(
String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
return beginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the route table summary associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the route table summary associated with the express route cross connection in a resource group on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono listRoutesTableSummaryAsync(
String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) {
return beginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath,
context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the route table summary associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the route table summary associated with the express route cross connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary(
String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
return listRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).block();
}
/**
* Gets the route table summary associated with the express route cross connection in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the route table summary associated with the express route cross connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary(
String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, Context context) {
return listRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context)
.block();
}
/**
* Gets the currently advertised routes table associated with the express route cross connection in a resource
* group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised routes table associated with the express route cross connection in a resource
* group along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> listRoutesTableWithResponseAsync(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (peeringName == null) {
return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null."));
}
if (devicePath == null) {
return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listRoutesTable(this.client.getEndpoint(), resourceGroupName, crossConnectionName,
peeringName, devicePath, apiVersion, this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the currently advertised routes table associated with the express route cross connection in a resource
* group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised routes table associated with the express route cross connection in a resource
* group along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> listRoutesTableWithResponseAsync(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (crossConnectionName == null) {
return Mono
.error(new IllegalArgumentException("Parameter crossConnectionName is required and cannot be null."));
}
if (peeringName == null) {
return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null."));
}
if (devicePath == null) {
return Mono.error(new IllegalArgumentException("Parameter devicePath is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listRoutesTable(this.client.getEndpoint(), resourceGroupName, crossConnectionName, peeringName,
devicePath, apiVersion, this.client.getSubscriptionId(), accept, context);
}
/**
* Gets the currently advertised routes table associated with the express route cross connection in a resource
* group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of the currently advertised routes table associated with the express
* route cross connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
PollerFlux, ExpressRouteCircuitsRoutesTableListResultInner>
beginListRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName,
String devicePath) {
Mono>> mono
= listRoutesTableWithResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath);
return this.client
.getLroResult(
mono, this.client.getHttpPipeline(), ExpressRouteCircuitsRoutesTableListResultInner.class,
ExpressRouteCircuitsRoutesTableListResultInner.class, this.client.getContext());
}
/**
* Gets the currently advertised routes table associated with the express route cross connection in a resource
* group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of the currently advertised routes table associated with the express
* route cross connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private
PollerFlux, ExpressRouteCircuitsRoutesTableListResultInner>
beginListRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName,
String devicePath, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = listRoutesTableWithResponseAsync(resourceGroupName, crossConnectionName,
peeringName, devicePath, context);
return this.client
.getLroResult(
mono, this.client.getHttpPipeline(), ExpressRouteCircuitsRoutesTableListResultInner.class,
ExpressRouteCircuitsRoutesTableListResultInner.class, context);
}
/**
* Gets the currently advertised routes table associated with the express route cross connection in a resource
* group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of the currently advertised routes table associated with the express
* route cross connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
SyncPoller, ExpressRouteCircuitsRoutesTableListResultInner>
beginListRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName,
String devicePath) {
return this.beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath)
.getSyncPoller();
}
/**
* Gets the currently advertised routes table associated with the express route cross connection in a resource
* group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of the currently advertised routes table associated with the express
* route cross connection in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
SyncPoller, ExpressRouteCircuitsRoutesTableListResultInner>
beginListRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName,
String devicePath, Context context) {
return this.beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context)
.getSyncPoller();
}
/**
* Gets the currently advertised routes table associated with the express route cross connection in a resource
* group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised routes table associated with the express route cross connection in a resource
* group on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono listRoutesTableAsync(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath) {
return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the currently advertised routes table associated with the express route cross connection in a resource
* group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised routes table associated with the express route cross connection in a resource
* group on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono listRoutesTableAsync(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath, Context context) {
return beginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the currently advertised routes table associated with the express route cross connection in a resource
* group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised routes table associated with the express route cross connection in a resource
* group.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath) {
return listRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).block();
}
/**
* Gets the currently advertised routes table associated with the express route cross connection in a resource
* group.
*
* @param resourceGroupName The name of the resource group.
* @param crossConnectionName The name of the ExpressRouteCrossConnection.
* @param peeringName The name of the peering.
* @param devicePath The path of the device.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the currently advertised routes table associated with the express route cross connection in a resource
* group.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName,
String crossConnectionName, String peeringName, String devicePath, Context context) {
return listRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, context).block();
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(String nextLink,
Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listByResourceGroupNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ListExpressRouteCrossConnection API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listByResourceGroupNextSinglePageAsync(String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy