Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.avs.implementation;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
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.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.avs.fluent.WorkloadNetworksClient;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner;
import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServicesList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZonesList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkGatewayList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIPsList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentsList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachinesList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupsList;
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 WorkloadNetworksClient.
*/
public final class WorkloadNetworksClientImpl implements WorkloadNetworksClient {
/**
* The proxy service used to perform REST calls.
*/
private final WorkloadNetworksService service;
/**
* The service client containing this operation class.
*/
private final AvsClientImpl client;
/**
* Initializes an instance of WorkloadNetworksClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
WorkloadNetworksClientImpl(AvsClientImpl client) {
this.service
= RestProxy.create(WorkloadNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for AvsClientWorkloadNetworks to be used by the proxy service to perform
* REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "AvsClientWorkloadNet")
public interface WorkloadNetworksService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> get(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listDhcp(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getDhcp(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("dhcpId") String dhcpId,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createDhcp(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("dhcpId") String dhcpId,
@BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> updateDhcp(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("dhcpId") String dhcpId,
@BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteDhcp(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("dhcpId") String dhcpId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listDnsServices(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getDnsService(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("dnsServiceId") String dnsServiceId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createDnsService(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("dnsServiceId") String dnsServiceId,
@BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> updateDnsService(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("dnsServiceId") String dnsServiceId,
@BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteDnsService(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("dnsServiceId") String dnsServiceId,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listDnsZones(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getDnsZone(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("dnsZoneId") String dnsZoneId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createDnsZone(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("dnsZoneId") String dnsZoneId,
@BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> updateDnsZone(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("dnsZoneId") String dnsZoneId,
@BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteDnsZone(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("dnsZoneId") String dnsZoneId,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listGateways(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getGateway(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("gatewayId") String gatewayId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listPortMirroring(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getPortMirroring(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName,
@PathParam("portMirroringId") String portMirroringId, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createPortMirroring(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName,
@PathParam("portMirroringId") String portMirroringId,
@BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> updatePortMirroring(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName,
@PathParam("portMirroringId") String portMirroringId,
@BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deletePortMirroring(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("portMirroringId") String portMirroringId,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listPublicIPs(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getPublicIp(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("publicIPId") String publicIpId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createPublicIp(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("publicIPId") String publicIpId,
@BodyParam("application/json") WorkloadNetworkPublicIpInner workloadNetworkPublicIp,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deletePublicIp(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("publicIPId") String publicIpId,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listSegments(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getSegment(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createSegments(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId,
@BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> updateSegments(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId,
@BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteSegment(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listVirtualMachines(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getVirtualMachine(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName,
@PathParam("virtualMachineId") String virtualMachineId, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listVMGroups(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getVMGroup(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("vmGroupId") String vmGroupId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createVMGroup(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("vmGroupId") String vmGroupId,
@BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> updateVMGroup(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("privateCloudName") String privateCloudName, @PathParam("vmGroupId") String vmGroupId,
@BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteVMGroup(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmGroupId") String vmGroupId,
@PathParam("privateCloudName") String privateCloudName, @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> listDhcpNext(
@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> listDnsServicesNext(
@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> listDnsZonesNext(
@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> listGatewaysNext(
@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> listPortMirroringNext(
@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> listPublicIPsNext(
@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> listSegmentsNext(
@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> listVirtualMachinesNext(
@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> listVMGroupsNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
}
/**
* List WorkloadNetwork resources by PrivateCloud.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetwork list operation along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String resourceGroupName,
String privateCloudName) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, 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()));
}
/**
* List WorkloadNetwork resources by PrivateCloud.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetwork list operation along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String resourceGroupName,
String privateCloudName, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, privateCloudName, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* List WorkloadNetwork resources by PrivateCloud.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetwork list operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(String resourceGroupName, String privateCloudName) {
return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName),
nextLink -> listNextSinglePageAsync(nextLink));
}
/**
* List WorkloadNetwork resources by PrivateCloud.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetwork list operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(String resourceGroupName, String privateCloudName,
Context context) {
return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, context),
nextLink -> listNextSinglePageAsync(nextLink, context));
}
/**
* List WorkloadNetwork resources by PrivateCloud.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetwork list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String resourceGroupName, String privateCloudName) {
return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName));
}
/**
* List WorkloadNetwork resources by PrivateCloud.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetwork list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String resourceGroupName, String privateCloudName,
Context context) {
return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context));
}
/**
* Get a WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 a WorkloadNetwork along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName,
String privateCloudName) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get a WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 a WorkloadNetwork along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName,
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, privateCloudName, accept, context);
}
/**
* Get a WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 a WorkloadNetwork on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getAsync(String resourceGroupName, String privateCloudName) {
return getWithResponseAsync(resourceGroupName, privateCloudName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get a WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 a WorkloadNetwork along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(String resourceGroupName, String privateCloudName,
Context context) {
return getWithResponseAsync(resourceGroupName, privateCloudName, context).block();
}
/**
* Get a WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 a WorkloadNetwork.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkInner get(String resourceGroupName, String privateCloudName) {
return getWithResponse(resourceGroupName, privateCloudName, Context.NONE).getValue();
}
/**
* List WorkloadNetworkDhcp resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDhcp list operation along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDhcpSinglePageAsync(String resourceGroupName,
String privateCloudName) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, 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()));
}
/**
* List WorkloadNetworkDhcp resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDhcp list operation along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDhcpSinglePageAsync(String resourceGroupName,
String privateCloudName, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listDhcp(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, privateCloudName, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* List WorkloadNetworkDhcp resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listDhcpAsync(String resourceGroupName, String privateCloudName) {
return new PagedFlux<>(() -> listDhcpSinglePageAsync(resourceGroupName, privateCloudName),
nextLink -> listDhcpNextSinglePageAsync(nextLink));
}
/**
* List WorkloadNetworkDhcp resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listDhcpAsync(String resourceGroupName, String privateCloudName,
Context context) {
return new PagedFlux<>(() -> listDhcpSinglePageAsync(resourceGroupName, privateCloudName, context),
nextLink -> listDhcpNextSinglePageAsync(nextLink, context));
}
/**
* List WorkloadNetworkDhcp resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listDhcp(String resourceGroupName, String privateCloudName) {
return new PagedIterable<>(listDhcpAsync(resourceGroupName, privateCloudName));
}
/**
* List WorkloadNetworkDhcp resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listDhcp(String resourceGroupName, String privateCloudName,
Context context) {
return new PagedIterable<>(listDhcpAsync(resourceGroupName, privateCloudName, context));
}
/**
* Get a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dhcpId The ID of the DHCP configuration.
* @param privateCloudName Name of the private cloud.
* @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 a WorkloadNetworkDhcp along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getDhcpWithResponseAsync(String resourceGroupName, String dhcpId,
String privateCloudName) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (dhcpId == null) {
return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, dhcpId, privateCloudName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dhcpId The ID of the DHCP configuration.
* @param privateCloudName Name of the private cloud.
* @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 a WorkloadNetworkDhcp along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getDhcpWithResponseAsync(String resourceGroupName, String dhcpId,
String privateCloudName, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (dhcpId == null) {
return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getDhcp(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, dhcpId, privateCloudName, accept, context);
}
/**
* Get a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dhcpId The ID of the DHCP configuration.
* @param privateCloudName Name of the private cloud.
* @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 a WorkloadNetworkDhcp on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getDhcpAsync(String resourceGroupName, String dhcpId,
String privateCloudName) {
return getDhcpWithResponseAsync(resourceGroupName, dhcpId, privateCloudName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dhcpId The ID of the DHCP configuration.
* @param privateCloudName Name of the private cloud.
* @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 a WorkloadNetworkDhcp along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getDhcpWithResponse(String resourceGroupName, String dhcpId,
String privateCloudName, Context context) {
return getDhcpWithResponseAsync(resourceGroupName, dhcpId, privateCloudName, context).block();
}
/**
* Get a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dhcpId The ID of the DHCP configuration.
* @param privateCloudName Name of the private cloud.
* @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 a WorkloadNetworkDhcp.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDhcpInner getDhcp(String resourceGroupName, String dhcpId, String privateCloudName) {
return getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, Context.NONE).getValue();
}
/**
* Create a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp Resource create parameters.
* @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 nSX DHCP along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createDhcpWithResponseAsync(String resourceGroupName,
String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dhcpId == null) {
return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
}
if (workloadNetworkDhcp == null) {
return Mono
.error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."));
} else {
workloadNetworkDhcp.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp,
accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp Resource create parameters.
* @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 nSX DHCP along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createDhcpWithResponseAsync(String resourceGroupName,
String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dhcpId == null) {
return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
}
if (workloadNetworkDhcp == null) {
return Mono
.error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."));
} else {
workloadNetworkDhcp.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, accept,
context);
}
/**
* Create a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp Resource create parameters.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDhcpInner> beginCreateDhcpAsync(
String resourceGroupName, String privateCloudName, String dhcpId,
WorkloadNetworkDhcpInner workloadNetworkDhcp) {
Mono>> mono
= createDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class,
this.client.getContext());
}
/**
* Create a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp Resource create parameters.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDhcpInner> beginCreateDhcpAsync(
String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, context);
}
/**
* Create a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp Resource create parameters.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp(
String resourceGroupName, String privateCloudName, String dhcpId,
WorkloadNetworkDhcpInner workloadNetworkDhcp) {
return this.beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp)
.getSyncPoller();
}
/**
* Create a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp Resource create parameters.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp(
String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp,
Context context) {
return this.beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context)
.getSyncPoller();
}
/**
* Create a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp Resource create parameters.
* @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 nSX DHCP on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createDhcpAsync(String resourceGroupName, String privateCloudName,
String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) {
return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp Resource create parameters.
* @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 nSX DHCP on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createDhcpAsync(String resourceGroupName, String privateCloudName,
String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) {
return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp Resource create parameters.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, String dhcpId,
WorkloadNetworkDhcpInner workloadNetworkDhcp) {
return createDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).block();
}
/**
* Create a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp Resource create parameters.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, String dhcpId,
WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) {
return createDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).block();
}
/**
* Update a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp The resource properties to be updated.
* @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 nSX DHCP along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateDhcpWithResponseAsync(String resourceGroupName,
String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dhcpId == null) {
return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
}
if (workloadNetworkDhcp == null) {
return Mono
.error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."));
} else {
workloadNetworkDhcp.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.updateDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp,
accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Update a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp The resource properties to be updated.
* @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 nSX DHCP along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateDhcpWithResponseAsync(String resourceGroupName,
String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dhcpId == null) {
return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
}
if (workloadNetworkDhcp == null) {
return Mono
.error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."));
} else {
workloadNetworkDhcp.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.updateDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, accept,
context);
}
/**
* Update a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp The resource properties to be updated.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDhcpInner> beginUpdateDhcpAsync(
String resourceGroupName, String privateCloudName, String dhcpId,
WorkloadNetworkDhcpInner workloadNetworkDhcp) {
Mono>> mono
= updateDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class,
this.client.getContext());
}
/**
* Update a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp The resource properties to be updated.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDhcpInner> beginUpdateDhcpAsync(
String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= updateDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, context);
}
/**
* Update a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp The resource properties to be updated.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp(
String resourceGroupName, String privateCloudName, String dhcpId,
WorkloadNetworkDhcpInner workloadNetworkDhcp) {
return this.beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp)
.getSyncPoller();
}
/**
* Update a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp The resource properties to be updated.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp(
String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp,
Context context) {
return this.beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context)
.getSyncPoller();
}
/**
* Update a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp The resource properties to be updated.
* @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 nSX DHCP on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateDhcpAsync(String resourceGroupName, String privateCloudName,
String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) {
return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp The resource properties to be updated.
* @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 nSX DHCP on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateDhcpAsync(String resourceGroupName, String privateCloudName,
String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) {
return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp The resource properties to be updated.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, String dhcpId,
WorkloadNetworkDhcpInner workloadNetworkDhcp) {
return updateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).block();
}
/**
* Update a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @param workloadNetworkDhcp The resource properties to be updated.
* @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 nSX DHCP.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, String dhcpId,
WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) {
return updateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).block();
}
/**
* Delete a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @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 Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteDhcpWithResponseAsync(String resourceGroupName,
String privateCloudName, String dhcpId) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dhcpId == null) {
return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.deleteDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @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 Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteDhcpWithResponseAsync(String resourceGroupName,
String privateCloudName, String dhcpId, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dhcpId == null) {
return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.deleteDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, accept, context);
}
/**
* Delete a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteDhcpAsync(String resourceGroupName, String privateCloudName,
String dhcpId) {
Mono>> mono
= deleteDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Delete a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteDhcpAsync(String resourceGroupName, String privateCloudName,
String dhcpId, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Delete a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, String privateCloudName,
String dhcpId) {
return this.beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).getSyncPoller();
}
/**
* Delete a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, String privateCloudName,
String dhcpId, Context context) {
return this.beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).getSyncPoller();
}
/**
* Delete a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @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 A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId) {
return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @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 A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId,
Context context) {
return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId) {
deleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).block();
}
/**
* Delete a WorkloadNetworkDhcp.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dhcpId The ID of the DHCP configuration.
* @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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context) {
deleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).block();
}
/**
* List WorkloadNetworkDnsService resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsService list operation along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDnsServicesSinglePageAsync(String resourceGroupName,
String privateCloudName) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listDnsServices(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, 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()));
}
/**
* List WorkloadNetworkDnsService resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsService list operation along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDnsServicesSinglePageAsync(String resourceGroupName,
String privateCloudName, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listDnsServices(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, privateCloudName, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* List WorkloadNetworkDnsService resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsService list operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listDnsServicesAsync(String resourceGroupName,
String privateCloudName) {
return new PagedFlux<>(() -> listDnsServicesSinglePageAsync(resourceGroupName, privateCloudName),
nextLink -> listDnsServicesNextSinglePageAsync(nextLink));
}
/**
* List WorkloadNetworkDnsService resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsService list operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listDnsServicesAsync(String resourceGroupName,
String privateCloudName, Context context) {
return new PagedFlux<>(() -> listDnsServicesSinglePageAsync(resourceGroupName, privateCloudName, context),
nextLink -> listDnsServicesNextSinglePageAsync(nextLink, context));
}
/**
* List WorkloadNetworkDnsService resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsService list operation as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listDnsServices(String resourceGroupName,
String privateCloudName) {
return new PagedIterable<>(listDnsServicesAsync(resourceGroupName, privateCloudName));
}
/**
* List WorkloadNetworkDnsService resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsService list operation as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listDnsServices(String resourceGroupName,
String privateCloudName, Context context) {
return new PagedIterable<>(listDnsServicesAsync(resourceGroupName, privateCloudName, context));
}
/**
* Get a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @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 a WorkloadNetworkDnsService along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getDnsServiceWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsServiceId) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsServiceId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @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 a WorkloadNetworkDnsService along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getDnsServiceWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsServiceId, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsServiceId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId, accept, context);
}
/**
* Get a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @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 a WorkloadNetworkDnsService on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getDnsServiceAsync(String resourceGroupName, String privateCloudName,
String dnsServiceId) {
return getDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, dnsServiceId)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @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 a WorkloadNetworkDnsService along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getDnsServiceWithResponse(String resourceGroupName,
String privateCloudName, String dnsServiceId, Context context) {
return getDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, dnsServiceId, context).block();
}
/**
* Get a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @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 a WorkloadNetworkDnsService.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDnsServiceInner getDnsService(String resourceGroupName, String privateCloudName,
String dnsServiceId) {
return getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, Context.NONE).getValue();
}
/**
* Create a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService Resource create parameters.
* @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 nSX DNS Service along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createDnsServiceWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsServiceId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
}
if (workloadNetworkDnsService == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null."));
} else {
workloadNetworkDnsService.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId,
workloadNetworkDnsService, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService Resource create parameters.
* @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 nSX DNS Service along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createDnsServiceWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsServiceId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
}
if (workloadNetworkDnsService == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null."));
} else {
workloadNetworkDnsService.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId,
workloadNetworkDnsService, accept, context);
}
/**
* Create a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService Resource create parameters.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDnsServiceInner>
beginCreateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId,
WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
Mono>> mono = createDnsServiceWithResponseAsync(resourceGroupName, privateCloudName,
dnsServiceId, workloadNetworkDnsService);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class,
this.client.getContext());
}
/**
* Create a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService Resource create parameters.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDnsServiceInner>
beginCreateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId,
WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = createDnsServiceWithResponseAsync(resourceGroupName, privateCloudName,
dnsServiceId, workloadNetworkDnsService, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class,
context);
}
/**
* Create a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService Resource create parameters.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService(
String resourceGroupName, String privateCloudName, String dnsServiceId,
WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
return this
.beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
.getSyncPoller();
}
/**
* Create a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService Resource create parameters.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService(
String resourceGroupName, String privateCloudName, String dnsServiceId,
WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
return this
.beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
context)
.getSyncPoller();
}
/**
* Create a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService Resource create parameters.
* @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 nSX DNS Service on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createDnsServiceAsync(String resourceGroupName,
String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
return beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService Resource create parameters.
* @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 nSX DNS Service on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createDnsServiceAsync(String resourceGroupName,
String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
Context context) {
return beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService Resource create parameters.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, String privateCloudName,
String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
return createDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
.block();
}
/**
* Create a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService Resource create parameters.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, String privateCloudName,
String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
return createDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
context).block();
}
/**
* Update a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService The resource properties to be updated.
* @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 nSX DNS Service along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateDnsServiceWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsServiceId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
}
if (workloadNetworkDnsService == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null."));
} else {
workloadNetworkDnsService.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.updateDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId,
workloadNetworkDnsService, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Update a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService The resource properties to be updated.
* @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 nSX DNS Service along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateDnsServiceWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsServiceId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
}
if (workloadNetworkDnsService == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null."));
} else {
workloadNetworkDnsService.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.updateDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId,
workloadNetworkDnsService, accept, context);
}
/**
* Update a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService The resource properties to be updated.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDnsServiceInner>
beginUpdateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId,
WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
Mono>> mono = updateDnsServiceWithResponseAsync(resourceGroupName, privateCloudName,
dnsServiceId, workloadNetworkDnsService);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class,
this.client.getContext());
}
/**
* Update a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService The resource properties to be updated.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDnsServiceInner>
beginUpdateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId,
WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = updateDnsServiceWithResponseAsync(resourceGroupName, privateCloudName,
dnsServiceId, workloadNetworkDnsService, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class,
context);
}
/**
* Update a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService The resource properties to be updated.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService(
String resourceGroupName, String privateCloudName, String dnsServiceId,
WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
return this
.beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
.getSyncPoller();
}
/**
* Update a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService The resource properties to be updated.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService(
String resourceGroupName, String privateCloudName, String dnsServiceId,
WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
return this
.beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
context)
.getSyncPoller();
}
/**
* Update a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService The resource properties to be updated.
* @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 nSX DNS Service on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateDnsServiceAsync(String resourceGroupName,
String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
return beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService The resource properties to be updated.
* @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 nSX DNS Service on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateDnsServiceAsync(String resourceGroupName,
String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
Context context) {
return beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService The resource properties to be updated.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, String privateCloudName,
String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
return updateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
.block();
}
/**
* Update a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsServiceId ID of the DNS service.
* @param workloadNetworkDnsService The resource properties to be updated.
* @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 nSX DNS Service.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, String privateCloudName,
String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
return updateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
context).block();
}
/**
* Delete a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsServiceId ID of the DNS service.
* @param privateCloudName Name of the private cloud.
* @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 Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteDnsServiceWithResponseAsync(String resourceGroupName,
String dnsServiceId, String privateCloudName) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (dnsServiceId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.deleteDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, dnsServiceId, privateCloudName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsServiceId ID of the DNS service.
* @param privateCloudName Name of the private cloud.
* @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 Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteDnsServiceWithResponseAsync(String resourceGroupName,
String dnsServiceId, String privateCloudName, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (dnsServiceId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.deleteDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, dnsServiceId, privateCloudName, accept, context);
}
/**
* Delete a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsServiceId ID of the DNS service.
* @param privateCloudName Name of the private cloud.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteDnsServiceAsync(String resourceGroupName, String dnsServiceId,
String privateCloudName) {
Mono>> mono
= deleteDnsServiceWithResponseAsync(resourceGroupName, dnsServiceId, privateCloudName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Delete a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsServiceId ID of the DNS service.
* @param privateCloudName Name of the private cloud.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteDnsServiceAsync(String resourceGroupName, String dnsServiceId,
String privateCloudName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteDnsServiceWithResponseAsync(resourceGroupName, dnsServiceId, privateCloudName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Delete a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsServiceId ID of the DNS service.
* @param privateCloudName Name of the private cloud.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteDnsService(String resourceGroupName, String dnsServiceId,
String privateCloudName) {
return this.beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).getSyncPoller();
}
/**
* Delete a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsServiceId ID of the DNS service.
* @param privateCloudName Name of the private cloud.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteDnsService(String resourceGroupName, String dnsServiceId,
String privateCloudName, Context context) {
return this.beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context)
.getSyncPoller();
}
/**
* Delete a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsServiceId ID of the DNS service.
* @param privateCloudName Name of the private cloud.
* @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 A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteDnsServiceAsync(String resourceGroupName, String dnsServiceId, String privateCloudName) {
return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsServiceId ID of the DNS service.
* @param privateCloudName Name of the private cloud.
* @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 A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteDnsServiceAsync(String resourceGroupName, String dnsServiceId, String privateCloudName,
Context context) {
return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsServiceId ID of the DNS service.
* @param privateCloudName Name of the private cloud.
* @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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName) {
deleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).block();
}
/**
* Delete a WorkloadNetworkDnsService.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsServiceId ID of the DNS service.
* @param privateCloudName Name of the private cloud.
* @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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName,
Context context) {
deleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context).block();
}
/**
* List WorkloadNetworkDnsZone resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsZone list operation along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDnsZonesSinglePageAsync(String resourceGroupName,
String privateCloudName) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listDnsZones(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, 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()));
}
/**
* List WorkloadNetworkDnsZone resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsZone list operation along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDnsZonesSinglePageAsync(String resourceGroupName,
String privateCloudName, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listDnsZones(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, privateCloudName, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* List WorkloadNetworkDnsZone resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listDnsZonesAsync(String resourceGroupName,
String privateCloudName) {
return new PagedFlux<>(() -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName),
nextLink -> listDnsZonesNextSinglePageAsync(nextLink));
}
/**
* List WorkloadNetworkDnsZone resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listDnsZonesAsync(String resourceGroupName, String privateCloudName,
Context context) {
return new PagedFlux<>(() -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName, context),
nextLink -> listDnsZonesNextSinglePageAsync(nextLink, context));
}
/**
* List WorkloadNetworkDnsZone resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName) {
return new PagedIterable<>(listDnsZonesAsync(resourceGroupName, privateCloudName));
}
/**
* List WorkloadNetworkDnsZone resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName,
Context context) {
return new PagedIterable<>(listDnsZonesAsync(resourceGroupName, privateCloudName, context));
}
/**
* Get a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @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 a WorkloadNetworkDnsZone along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getDnsZoneWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsZoneId) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsZoneId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @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 a WorkloadNetworkDnsZone along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getDnsZoneWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsZoneId, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsZoneId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, accept, context);
}
/**
* Get a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @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 a WorkloadNetworkDnsZone on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getDnsZoneAsync(String resourceGroupName, String privateCloudName,
String dnsZoneId) {
return getDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @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 a WorkloadNetworkDnsZone along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getDnsZoneWithResponse(String resourceGroupName,
String privateCloudName, String dnsZoneId, Context context) {
return getDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, context).block();
}
/**
* Get a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @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 a WorkloadNetworkDnsZone.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId) {
return getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, Context.NONE).getValue();
}
/**
* Create a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone Resource create parameters.
* @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 nSX DNS Zone along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createDnsZoneWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsZoneId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
}
if (workloadNetworkDnsZone == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null."));
} else {
workloadNetworkDnsZone.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone,
accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone Resource create parameters.
* @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 nSX DNS Zone along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createDnsZoneWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone,
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsZoneId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
}
if (workloadNetworkDnsZone == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null."));
} else {
workloadNetworkDnsZone.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone,
accept, context);
}
/**
* Create a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone Resource create parameters.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDnsZoneInner> beginCreateDnsZoneAsync(
String resourceGroupName, String privateCloudName, String dnsZoneId,
WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
Mono>> mono
= createDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class,
this.client.getContext());
}
/**
* Create a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone Resource create parameters.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDnsZoneInner> beginCreateDnsZoneAsync(
String resourceGroupName, String privateCloudName, String dnsZoneId,
WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = createDnsZoneWithResponseAsync(resourceGroupName, privateCloudName,
dnsZoneId, workloadNetworkDnsZone, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class,
context);
}
/**
* Create a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone Resource create parameters.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone(
String resourceGroupName, String privateCloudName, String dnsZoneId,
WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
return this.beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone)
.getSyncPoller();
}
/**
* Create a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone Resource create parameters.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone(
String resourceGroupName, String privateCloudName, String dnsZoneId,
WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
return this
.beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
.getSyncPoller();
}
/**
* Create a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone Resource create parameters.
* @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 nSX DNS Zone on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createDnsZoneAsync(String resourceGroupName, String privateCloudName,
String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone Resource create parameters.
* @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 nSX DNS Zone on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createDnsZoneAsync(String resourceGroupName, String privateCloudName,
String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone Resource create parameters.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String privateCloudName,
String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
return createDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).block();
}
/**
* Create a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone Resource create parameters.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String privateCloudName,
String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
return createDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
.block();
}
/**
* Update a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone The resource properties to be updated.
* @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 nSX DNS Zone along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateDnsZoneWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsZoneId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
}
if (workloadNetworkDnsZone == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null."));
} else {
workloadNetworkDnsZone.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.updateDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone,
accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Update a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone The resource properties to be updated.
* @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 nSX DNS Zone along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateDnsZoneWithResponseAsync(String resourceGroupName,
String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone,
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (dnsZoneId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
}
if (workloadNetworkDnsZone == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null."));
} else {
workloadNetworkDnsZone.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.updateDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone,
accept, context);
}
/**
* Update a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone The resource properties to be updated.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDnsZoneInner> beginUpdateDnsZoneAsync(
String resourceGroupName, String privateCloudName, String dnsZoneId,
WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
Mono>> mono
= updateDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class,
this.client.getContext());
}
/**
* Update a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone The resource properties to be updated.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkDnsZoneInner> beginUpdateDnsZoneAsync(
String resourceGroupName, String privateCloudName, String dnsZoneId,
WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = updateDnsZoneWithResponseAsync(resourceGroupName, privateCloudName,
dnsZoneId, workloadNetworkDnsZone, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class,
context);
}
/**
* Update a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone The resource properties to be updated.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone(
String resourceGroupName, String privateCloudName, String dnsZoneId,
WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
return this.beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone)
.getSyncPoller();
}
/**
* Update a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone The resource properties to be updated.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone(
String resourceGroupName, String privateCloudName, String dnsZoneId,
WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
return this
.beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
.getSyncPoller();
}
/**
* Update a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone The resource properties to be updated.
* @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 nSX DNS Zone on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateDnsZoneAsync(String resourceGroupName, String privateCloudName,
String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone The resource properties to be updated.
* @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 nSX DNS Zone on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateDnsZoneAsync(String resourceGroupName, String privateCloudName,
String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone The resource properties to be updated.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, String privateCloudName,
String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
return updateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).block();
}
/**
* Update a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId ID of the DNS zone.
* @param workloadNetworkDnsZone The resource properties to be updated.
* @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 nSX DNS Zone.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, String privateCloudName,
String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
return updateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
.block();
}
/**
* Delete a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsZoneId ID of the DNS zone.
* @param privateCloudName Name of the private cloud.
* @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 Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteDnsZoneWithResponseAsync(String resourceGroupName, String dnsZoneId,
String privateCloudName) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (dnsZoneId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.deleteDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, dnsZoneId, privateCloudName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsZoneId ID of the DNS zone.
* @param privateCloudName Name of the private cloud.
* @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 Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteDnsZoneWithResponseAsync(String resourceGroupName, String dnsZoneId,
String privateCloudName, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (dnsZoneId == null) {
return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.deleteDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, dnsZoneId, privateCloudName, accept, context);
}
/**
* Delete a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsZoneId ID of the DNS zone.
* @param privateCloudName Name of the private cloud.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteDnsZoneAsync(String resourceGroupName, String dnsZoneId,
String privateCloudName) {
Mono>> mono
= deleteDnsZoneWithResponseAsync(resourceGroupName, dnsZoneId, privateCloudName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Delete a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsZoneId ID of the DNS zone.
* @param privateCloudName Name of the private cloud.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteDnsZoneAsync(String resourceGroupName, String dnsZoneId,
String privateCloudName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteDnsZoneWithResponseAsync(resourceGroupName, dnsZoneId, privateCloudName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Delete a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsZoneId ID of the DNS zone.
* @param privateCloudName Name of the private cloud.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteDnsZone(String resourceGroupName, String dnsZoneId,
String privateCloudName) {
return this.beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).getSyncPoller();
}
/**
* Delete a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsZoneId ID of the DNS zone.
* @param privateCloudName Name of the private cloud.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDeleteDnsZone(String resourceGroupName, String dnsZoneId,
String privateCloudName, Context context) {
return this.beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).getSyncPoller();
}
/**
* Delete a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsZoneId ID of the DNS zone.
* @param privateCloudName Name of the private cloud.
* @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 A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteDnsZoneAsync(String resourceGroupName, String dnsZoneId, String privateCloudName) {
return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsZoneId ID of the DNS zone.
* @param privateCloudName Name of the private cloud.
* @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 A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteDnsZoneAsync(String resourceGroupName, String dnsZoneId, String privateCloudName,
Context context) {
return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsZoneId ID of the DNS zone.
* @param privateCloudName Name of the private cloud.
* @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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName) {
deleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).block();
}
/**
* Delete a WorkloadNetworkDnsZone.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param dnsZoneId ID of the DNS zone.
* @param privateCloudName Name of the private cloud.
* @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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) {
deleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).block();
}
/**
* List WorkloadNetworkGateway resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkGateway list operation along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listGatewaysSinglePageAsync(String resourceGroupName,
String privateCloudName) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listGateways(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, 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()));
}
/**
* List WorkloadNetworkGateway resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkGateway list operation along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listGatewaysSinglePageAsync(String resourceGroupName,
String privateCloudName, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listGateways(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, privateCloudName, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* List WorkloadNetworkGateway resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listGatewaysAsync(String resourceGroupName,
String privateCloudName) {
return new PagedFlux<>(() -> listGatewaysSinglePageAsync(resourceGroupName, privateCloudName),
nextLink -> listGatewaysNextSinglePageAsync(nextLink));
}
/**
* List WorkloadNetworkGateway resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listGatewaysAsync(String resourceGroupName, String privateCloudName,
Context context) {
return new PagedFlux<>(() -> listGatewaysSinglePageAsync(resourceGroupName, privateCloudName, context),
nextLink -> listGatewaysNextSinglePageAsync(nextLink, context));
}
/**
* List WorkloadNetworkGateway resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listGateways(String resourceGroupName, String privateCloudName) {
return new PagedIterable<>(listGatewaysAsync(resourceGroupName, privateCloudName));
}
/**
* List WorkloadNetworkGateway resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listGateways(String resourceGroupName, String privateCloudName,
Context context) {
return new PagedIterable<>(listGatewaysAsync(resourceGroupName, privateCloudName, context));
}
/**
* Get a WorkloadNetworkGateway.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param gatewayId The ID of the NSX Gateway.
* @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 a WorkloadNetworkGateway along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getGatewayWithResponseAsync(String resourceGroupName,
String privateCloudName, String gatewayId) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (gatewayId == null) {
return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getGateway(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, gatewayId, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get a WorkloadNetworkGateway.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param gatewayId The ID of the NSX Gateway.
* @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 a WorkloadNetworkGateway along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getGatewayWithResponseAsync(String resourceGroupName,
String privateCloudName, String gatewayId, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (gatewayId == null) {
return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getGateway(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, gatewayId, accept, context);
}
/**
* Get a WorkloadNetworkGateway.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param gatewayId The ID of the NSX Gateway.
* @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 a WorkloadNetworkGateway on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getGatewayAsync(String resourceGroupName, String privateCloudName,
String gatewayId) {
return getGatewayWithResponseAsync(resourceGroupName, privateCloudName, gatewayId)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get a WorkloadNetworkGateway.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param gatewayId The ID of the NSX Gateway.
* @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 a WorkloadNetworkGateway along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getGatewayWithResponse(String resourceGroupName,
String privateCloudName, String gatewayId, Context context) {
return getGatewayWithResponseAsync(resourceGroupName, privateCloudName, gatewayId, context).block();
}
/**
* Get a WorkloadNetworkGateway.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param gatewayId The ID of the NSX Gateway.
* @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 a WorkloadNetworkGateway.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String privateCloudName, String gatewayId) {
return getGatewayWithResponse(resourceGroupName, privateCloudName, gatewayId, Context.NONE).getValue();
}
/**
* List WorkloadNetworkPortMirroring resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkPortMirroring list operation along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listPortMirroringSinglePageAsync(String resourceGroupName, String privateCloudName) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, 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()));
}
/**
* List WorkloadNetworkPortMirroring resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkPortMirroring list operation along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listPortMirroringSinglePageAsync(String resourceGroupName, String privateCloudName, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, privateCloudName, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* List WorkloadNetworkPortMirroring resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkPortMirroring list operation as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listPortMirroringAsync(String resourceGroupName,
String privateCloudName) {
return new PagedFlux<>(() -> listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName),
nextLink -> listPortMirroringNextSinglePageAsync(nextLink));
}
/**
* List WorkloadNetworkPortMirroring resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkPortMirroring list operation as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listPortMirroringAsync(String resourceGroupName,
String privateCloudName, Context context) {
return new PagedFlux<>(() -> listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName, context),
nextLink -> listPortMirroringNextSinglePageAsync(nextLink, context));
}
/**
* List WorkloadNetworkPortMirroring resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkPortMirroring list operation as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listPortMirroring(String resourceGroupName,
String privateCloudName) {
return new PagedIterable<>(listPortMirroringAsync(resourceGroupName, privateCloudName));
}
/**
* List WorkloadNetworkPortMirroring resources by WorkloadNetwork.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @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 response of a WorkloadNetworkPortMirroring list operation as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listPortMirroring(String resourceGroupName,
String privateCloudName, Context context) {
return new PagedIterable<>(listPortMirroringAsync(resourceGroupName, privateCloudName, context));
}
/**
* Get a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @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 a WorkloadNetworkPortMirroring along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
getPortMirroringWithResponseAsync(String resourceGroupName, String privateCloudName, String portMirroringId) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (portMirroringId == null) {
return Mono
.error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @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 a WorkloadNetworkPortMirroring along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getPortMirroringWithResponseAsync(
String resourceGroupName, String privateCloudName, String portMirroringId, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (portMirroringId == null) {
return Mono
.error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId, accept, context);
}
/**
* Get a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @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 a WorkloadNetworkPortMirroring on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getPortMirroringAsync(String resourceGroupName,
String privateCloudName, String portMirroringId) {
return getPortMirroringWithResponseAsync(resourceGroupName, privateCloudName, portMirroringId)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @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 a WorkloadNetworkPortMirroring along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getPortMirroringWithResponse(String resourceGroupName,
String privateCloudName, String portMirroringId, Context context) {
return getPortMirroringWithResponseAsync(resourceGroupName, privateCloudName, portMirroringId, context).block();
}
/**
* Get a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @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 a WorkloadNetworkPortMirroring.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkPortMirroringInner getPortMirroring(String resourceGroupName, String privateCloudName,
String portMirroringId) {
return getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, Context.NONE)
.getValue();
}
/**
* Create a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring Resource create parameters.
* @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 nSX Port Mirroring along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createPortMirroringWithResponseAsync(String resourceGroupName,
String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (portMirroringId == null) {
return Mono
.error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
}
if (workloadNetworkPortMirroring == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."));
} else {
workloadNetworkPortMirroring.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring Resource create parameters.
* @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 nSX Port Mirroring along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createPortMirroringWithResponseAsync(String resourceGroupName,
String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (portMirroringId == null) {
return Mono
.error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
}
if (workloadNetworkPortMirroring == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."));
} else {
workloadNetworkPortMirroring.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring, accept, context);
}
/**
* Create a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring Resource create parameters.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkPortMirroringInner>
beginCreatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
Mono>> mono = createPortMirroringWithResponseAsync(resourceGroupName,
privateCloudName, portMirroringId, workloadNetworkPortMirroring);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class,
WorkloadNetworkPortMirroringInner.class, this.client.getContext());
}
/**
* Create a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring Resource create parameters.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkPortMirroringInner>
beginCreatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = createPortMirroringWithResponseAsync(resourceGroupName,
privateCloudName, portMirroringId, workloadNetworkPortMirroring, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class,
WorkloadNetworkPortMirroringInner.class, context);
}
/**
* Create a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring Resource create parameters.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkPortMirroringInner>
beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
return this
.beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring)
.getSyncPoller();
}
/**
* Create a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring Resource create parameters.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkPortMirroringInner>
beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
return this
.beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring, context)
.getSyncPoller();
}
/**
* Create a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring Resource create parameters.
* @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 nSX Port Mirroring on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createPortMirroringAsync(String resourceGroupName,
String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
return beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring Resource create parameters.
* @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 nSX Port Mirroring on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createPortMirroringAsync(String resourceGroupName,
String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
Context context) {
return beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring, context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring Resource create parameters.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, String privateCloudName,
String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
return createPortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring).block();
}
/**
* Create a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring Resource create parameters.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, String privateCloudName,
String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
return createPortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring, context).block();
}
/**
* Update a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring The resource properties to be updated.
* @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 nSX Port Mirroring along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updatePortMirroringWithResponseAsync(String resourceGroupName,
String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (portMirroringId == null) {
return Mono
.error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
}
if (workloadNetworkPortMirroring == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."));
} else {
workloadNetworkPortMirroring.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.updatePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Update a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring The resource properties to be updated.
* @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 nSX Port Mirroring along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updatePortMirroringWithResponseAsync(String resourceGroupName,
String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
if (portMirroringId == null) {
return Mono
.error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
}
if (workloadNetworkPortMirroring == null) {
return Mono.error(
new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."));
} else {
workloadNetworkPortMirroring.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.updatePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring, accept, context);
}
/**
* Update a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring The resource properties to be updated.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkPortMirroringInner>
beginUpdatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
Mono>> mono = updatePortMirroringWithResponseAsync(resourceGroupName,
privateCloudName, portMirroringId, workloadNetworkPortMirroring);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class,
WorkloadNetworkPortMirroringInner.class, this.client.getContext());
}
/**
* Update a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring The resource properties to be updated.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WorkloadNetworkPortMirroringInner>
beginUpdatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = updatePortMirroringWithResponseAsync(resourceGroupName,
privateCloudName, portMirroringId, workloadNetworkPortMirroring, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class,
WorkloadNetworkPortMirroringInner.class, context);
}
/**
* Update a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring The resource properties to be updated.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkPortMirroringInner>
beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
return this
.beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring)
.getSyncPoller();
}
/**
* Update a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring The resource properties to be updated.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WorkloadNetworkPortMirroringInner>
beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
return this
.beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring, context)
.getSyncPoller();
}
/**
* Update a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring The resource properties to be updated.
* @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 nSX Port Mirroring on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updatePortMirroringAsync(String resourceGroupName,
String privateCloudName, String portMirroringId,
WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
return beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring The resource properties to be updated.
* @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 nSX Port Mirroring on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updatePortMirroringAsync(String resourceGroupName,
String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
Context context) {
return beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring, context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring The resource properties to be updated.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGroupName, String privateCloudName,
String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
return updatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring).block();
}
/**
* Update a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param workloadNetworkPortMirroring The resource properties to be updated.
* @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 nSX Port Mirroring.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGroupName, String privateCloudName,
String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
return updatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
workloadNetworkPortMirroring, context).block();
}
/**
* Delete a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param privateCloudName Name of the private cloud.
* @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 Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deletePortMirroringWithResponseAsync(String resourceGroupName,
String portMirroringId, String privateCloudName) {
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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (portMirroringId == null) {
return Mono
.error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.deletePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, portMirroringId, privateCloudName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param privateCloudName Name of the private cloud.
* @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 Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deletePortMirroringWithResponseAsync(String resourceGroupName,
String portMirroringId, String privateCloudName, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (portMirroringId == null) {
return Mono
.error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.deletePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, portMirroringId, privateCloudName, accept, context);
}
/**
* Delete a WorkloadNetworkPortMirroring.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param portMirroringId ID of the NSX port mirroring profile.
* @param privateCloudName Name of the private cloud.
* @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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux