com.azure.resourcemanager.azurestackhci.implementation.ArcSettingsClientImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-azurestackhci Show documentation
Show all versions of azure-resourcemanager-azurestackhci Show documentation
This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2024-04.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.azurestackhci.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.Post;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.azurestackhci.fluent.ArcSettingsClient;
import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner;
import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner;
import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner;
import com.azure.resourcemanager.azurestackhci.models.ArcSettingList;
import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch;
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 ArcSettingsClient.
*/
public final class ArcSettingsClientImpl implements ArcSettingsClient {
/**
* The proxy service used to perform REST calls.
*/
private final ArcSettingsService service;
/**
* The service client containing this operation class.
*/
private final AzureStackHciClientImpl client;
/**
* Initializes an instance of ArcSettingsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
ArcSettingsClientImpl(AzureStackHciClientImpl client) {
this.service
= RestProxy.create(ArcSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for AzureStackHciClientArcSettings to be used by the proxy service to
* perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "AzureStackHciClientA")
public interface ArcSettingsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByCluster(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> get(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName,
@PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> create(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName,
@PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ArcSettingInner arcSetting, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> update(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName,
@PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ArcSettingsPatch arcSetting, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName,
@PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> generatePassword(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName,
@PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createIdentity(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName,
@PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/consentAndInstallDefaultExtensions")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> consentAndInstallDefaultExtensions(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName,
@PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/initializeDisableProcess")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> initializeDisableProcess(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName,
@PathParam("arcSettingName") String arcSettingName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByClusterNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
}
/**
* Get ArcSetting resources of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @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 arcSetting resources of HCI Cluster along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByClusterSinglePageAsync(String resourceGroupName,
String clusterName) {
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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, clusterName, this.client.getApiVersion(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get ArcSetting resources of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @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 arcSetting resources of HCI Cluster along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByClusterSinglePageAsync(String resourceGroupName,
String clusterName, 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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByCluster(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName,
this.client.getApiVersion(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get ArcSetting resources of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @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 arcSetting resources of HCI Cluster as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) {
return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName),
nextLink -> listByClusterNextSinglePageAsync(nextLink));
}
/**
* Get ArcSetting resources of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @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 arcSetting resources of HCI Cluster as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName,
Context context) {
return new PagedFlux<>(() -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context),
nextLink -> listByClusterNextSinglePageAsync(nextLink, context));
}
/**
* Get ArcSetting resources of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @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 arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByCluster(String resourceGroupName, String clusterName) {
return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName));
}
/**
* Get ArcSetting resources of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @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 arcSetting resources of HCI Cluster as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) {
return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context));
}
/**
* Get ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcSetting resource details of HCI Cluster along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName, String clusterName,
String arcSettingName) {
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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcSetting resource details of HCI Cluster along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName, String clusterName,
String arcSettingName, 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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName,
arcSettingName, this.client.getApiVersion(), accept, context);
}
/**
* Get ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcSetting resource details of HCI Cluster on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getAsync(String resourceGroupName, String clusterName, String arcSettingName) {
return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcSetting resource details of HCI Cluster along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(String resourceGroupName, String clusterName,
String arcSettingName, Context context) {
return getWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block();
}
/**
* Get ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcSetting resource details of HCI Cluster.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ArcSettingInner get(String resourceGroupName, String clusterName, String arcSettingName) {
return getWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue();
}
/**
* Create ArcSetting for HCI cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster.
* @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 arcSetting details along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createWithResponseAsync(String resourceGroupName, String clusterName,
String arcSettingName, ArcSettingInner arcSetting) {
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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
if (arcSetting == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null."));
} else {
arcSetting.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
clusterName, arcSettingName, this.client.getApiVersion(), arcSetting, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create ArcSetting for HCI cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster.
* @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 arcSetting details along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createWithResponseAsync(String resourceGroupName, String clusterName,
String arcSettingName, ArcSettingInner arcSetting, 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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
if (arcSetting == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null."));
} else {
arcSetting.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
clusterName, arcSettingName, this.client.getApiVersion(), arcSetting, accept, context);
}
/**
* Create ArcSetting for HCI cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster.
* @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 arcSetting details on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createAsync(String resourceGroupName, String clusterName, String arcSettingName,
ArcSettingInner arcSetting) {
return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Create ArcSetting for HCI cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster.
* @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 arcSetting details along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response createWithResponse(String resourceGroupName, String clusterName,
String arcSettingName, ArcSettingInner arcSetting, Context context) {
return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block();
}
/**
* Create ArcSetting for HCI cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @param arcSetting Parameters supplied to the Create ArcSetting resource for this HCI cluster.
* @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 arcSetting details.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ArcSettingInner create(String resourceGroupName, String clusterName, String arcSettingName,
ArcSettingInner arcSetting) {
return createWithResponse(resourceGroupName, clusterName, arcSettingName, arcSetting, Context.NONE).getValue();
}
/**
* Update ArcSettings for HCI cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @param arcSetting ArcSettings parameters that needs 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 arcSetting details along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateWithResponseAsync(String resourceGroupName, String clusterName,
String arcSettingName, ArcSettingsPatch arcSetting) {
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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
if (arcSetting == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null."));
} else {
arcSetting.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
clusterName, arcSettingName, this.client.getApiVersion(), arcSetting, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Update ArcSettings for HCI cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @param arcSetting ArcSettings parameters that needs 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 arcSetting details along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateWithResponseAsync(String resourceGroupName, String clusterName,
String arcSettingName, ArcSettingsPatch arcSetting, 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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
if (arcSetting == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null."));
} else {
arcSetting.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
clusterName, arcSettingName, this.client.getApiVersion(), arcSetting, accept, context);
}
/**
* Update ArcSettings for HCI cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @param arcSetting ArcSettings parameters that needs 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 arcSetting details on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String resourceGroupName, String clusterName, String arcSettingName,
ArcSettingsPatch arcSetting) {
return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Update ArcSettings for HCI cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @param arcSetting ArcSettings parameters that needs 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 arcSetting details along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response updateWithResponse(String resourceGroupName, String clusterName,
String arcSettingName, ArcSettingsPatch arcSetting, Context context) {
return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block();
}
/**
* Update ArcSettings for HCI cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @param arcSetting ArcSettings parameters that needs 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 arcSetting details.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ArcSettingInner update(String resourceGroupName, String clusterName, String arcSettingName,
ArcSettingsPatch arcSetting) {
return updateWithResponse(resourceGroupName, clusterName, arcSettingName, arcSetting, Context.NONE).getValue();
}
/**
* Delete ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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>> deleteWithResponseAsync(String resourceGroupName, String clusterName,
String arcSettingName) {
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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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>> deleteWithResponseAsync(String resourceGroupName, String clusterName,
String arcSettingName, 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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
clusterName, arcSettingName, this.client.getApiVersion(), accept, context);
}
/**
* Delete ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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> beginDeleteAsync(String resourceGroupName, String clusterName,
String arcSettingName) {
Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Delete ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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> beginDeleteAsync(String resourceGroupName, String clusterName,
String arcSettingName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Delete ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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> beginDelete(String resourceGroupName, String clusterName,
String arcSettingName) {
return this.beginDeleteAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller();
}
/**
* Delete ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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> beginDelete(String resourceGroupName, String clusterName,
String arcSettingName, Context context) {
return this.beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, context).getSyncPoller();
}
/**
* Delete ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 deleteAsync(String resourceGroupName, String clusterName, String arcSettingName) {
return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 deleteAsync(String resourceGroupName, String clusterName, String arcSettingName,
Context context) {
return beginDeleteAsync(resourceGroupName, clusterName, arcSettingName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 delete(String resourceGroupName, String clusterName, String arcSettingName) {
deleteAsync(resourceGroupName, clusterName, arcSettingName).block();
}
/**
* Delete ArcSetting resource details of HCI Cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 delete(String resourceGroupName, String clusterName, String arcSettingName, Context context) {
deleteAsync(resourceGroupName, clusterName, arcSettingName, context).block();
}
/**
* Generate password for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 body along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> generatePasswordWithResponseAsync(String resourceGroupName,
String clusterName, String arcSettingName) {
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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.generatePassword(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Generate password for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 body along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> generatePasswordWithResponseAsync(String resourceGroupName,
String clusterName, String arcSettingName, 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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.generatePassword(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
clusterName, arcSettingName, this.client.getApiVersion(), accept, context);
}
/**
* Generate password for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 body on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono generatePasswordAsync(String resourceGroupName, String clusterName,
String arcSettingName) {
return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Generate password for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 body along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response generatePasswordWithResponse(String resourceGroupName, String clusterName,
String arcSettingName, Context context) {
return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block();
}
/**
* Generate password for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName,
String arcSettingName) {
return generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, Context.NONE).getValue();
}
/**
* Create Aad identity for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcIdentity details along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createIdentityWithResponseAsync(String resourceGroupName,
String clusterName, String arcSettingName) {
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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createIdentity(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create Aad identity for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcIdentity details along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createIdentityWithResponseAsync(String resourceGroupName,
String clusterName, String arcSettingName, 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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createIdentity(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
clusterName, arcSettingName, this.client.getApiVersion(), accept, context);
}
/**
* Create Aad identity for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcIdentity details.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ArcIdentityResponseInner>
beginCreateIdentityAsync(String resourceGroupName, String clusterName, String arcSettingName) {
Mono>> mono
= createIdentityWithResponseAsync(resourceGroupName, clusterName, arcSettingName);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ArcIdentityResponseInner.class, ArcIdentityResponseInner.class,
this.client.getContext());
}
/**
* Create Aad identity for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcIdentity details.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ArcIdentityResponseInner>
beginCreateIdentityAsync(String resourceGroupName, String clusterName, String arcSettingName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createIdentityWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ArcIdentityResponseInner.class, ArcIdentityResponseInner.class, context);
}
/**
* Create Aad identity for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcIdentity details.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ArcIdentityResponseInner>
beginCreateIdentity(String resourceGroupName, String clusterName, String arcSettingName) {
return this.beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller();
}
/**
* Create Aad identity for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcIdentity details.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ArcIdentityResponseInner>
beginCreateIdentity(String resourceGroupName, String clusterName, String arcSettingName, Context context) {
return this.beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).getSyncPoller();
}
/**
* Create Aad identity for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcIdentity details on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createIdentityAsync(String resourceGroupName, String clusterName,
String arcSettingName) {
return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create Aad identity for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcIdentity details on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createIdentityAsync(String resourceGroupName, String clusterName,
String arcSettingName, Context context) {
return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create Aad identity for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcIdentity details.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ArcIdentityResponseInner createIdentity(String resourceGroupName, String clusterName,
String arcSettingName) {
return createIdentityAsync(resourceGroupName, clusterName, arcSettingName).block();
}
/**
* Create Aad identity for arc settings.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcIdentity details.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ArcIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, String arcSettingName,
Context context) {
return createIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).block();
}
/**
* Add consent time for default extensions and initiate extensions installation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcSetting details along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> consentAndInstallDefaultExtensionsWithResponseAsync(
String resourceGroupName, String clusterName, String arcSettingName) {
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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.consentAndInstallDefaultExtensions(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, clusterName, arcSettingName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Add consent time for default extensions and initiate extensions installation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcSetting details along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> consentAndInstallDefaultExtensionsWithResponseAsync(
String resourceGroupName, String clusterName, String arcSettingName, 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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.consentAndInstallDefaultExtensions(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context);
}
/**
* Add consent time for default extensions and initiate extensions installation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcSetting details on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono consentAndInstallDefaultExtensionsAsync(String resourceGroupName, String clusterName,
String arcSettingName) {
return consentAndInstallDefaultExtensionsWithResponseAsync(resourceGroupName, clusterName, arcSettingName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Add consent time for default extensions and initiate extensions installation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcSetting details along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response consentAndInstallDefaultExtensionsWithResponse(String resourceGroupName,
String clusterName, String arcSettingName, Context context) {
return consentAndInstallDefaultExtensionsWithResponseAsync(resourceGroupName, clusterName, arcSettingName,
context).block();
}
/**
* Add consent time for default extensions and initiate extensions installation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 arcSetting details.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ArcSettingInner consentAndInstallDefaultExtensions(String resourceGroupName, String clusterName,
String arcSettingName) {
return consentAndInstallDefaultExtensionsWithResponse(resourceGroupName, clusterName, arcSettingName,
Context.NONE).getValue();
}
/**
* Initializes ARC Disable process on the cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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>> initializeDisableProcessWithResponseAsync(String resourceGroupName,
String clusterName, String arcSettingName) {
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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.initializeDisableProcess(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Initializes ARC Disable process on the cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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>> initializeDisableProcessWithResponseAsync(String resourceGroupName,
String clusterName, String arcSettingName, 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 (clusterName == null) {
return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null."));
}
if (arcSettingName == null) {
return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.initializeDisableProcess(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, clusterName, arcSettingName, this.client.getApiVersion(), accept, context);
}
/**
* Initializes ARC Disable process on the cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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> beginInitializeDisableProcessAsync(String resourceGroupName,
String clusterName, String arcSettingName) {
Mono>> mono
= initializeDisableProcessWithResponseAsync(resourceGroupName, clusterName, arcSettingName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Initializes ARC Disable process on the cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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> beginInitializeDisableProcessAsync(String resourceGroupName,
String clusterName, String arcSettingName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= initializeDisableProcessWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Initializes ARC Disable process on the cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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> beginInitializeDisableProcess(String resourceGroupName,
String clusterName, String arcSettingName) {
return this.beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller();
}
/**
* Initializes ARC Disable process on the cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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> beginInitializeDisableProcess(String resourceGroupName,
String clusterName, String arcSettingName, Context context) {
return this.beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName, context)
.getSyncPoller();
}
/**
* Initializes ARC Disable process on the cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 initializeDisableProcessAsync(String resourceGroupName, String clusterName,
String arcSettingName) {
return beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Initializes ARC Disable process on the cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 initializeDisableProcessAsync(String resourceGroupName, String clusterName,
String arcSettingName, Context context) {
return beginInitializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Initializes ARC Disable process on the cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName) {
initializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName).block();
}
/**
* Initializes ARC Disable process on the cluster.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param clusterName The name of the cluster.
* @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information.
* @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 initializeDisableProcess(String resourceGroupName, String clusterName, String arcSettingName,
Context context) {
initializeDisableProcessAsync(resourceGroupName, clusterName, arcSettingName, context).block();
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of ArcSetting proxy resources for the HCI cluster along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByClusterNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of ArcSetting proxy resources for the HCI cluster along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByClusterNextSinglePageAsync(String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
}