CassandraResourcesClientImpl.java
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.cosmos.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.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.logging.ClientLogger;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.cosmos.fluent.CassandraResourcesClient;
import com.azure.resourcemanager.cosmos.fluent.models.CassandraKeyspaceGetResultsInner;
import com.azure.resourcemanager.cosmos.fluent.models.CassandraTableGetResultsInner;
import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner;
import com.azure.resourcemanager.cosmos.models.CassandraKeyspaceCreateUpdateParameters;
import com.azure.resourcemanager.cosmos.models.CassandraKeyspaceListResult;
import com.azure.resourcemanager.cosmos.models.CassandraTableCreateUpdateParameters;
import com.azure.resourcemanager.cosmos.models.CassandraTableListResult;
import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
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 CassandraResourcesClient. */
public final class CassandraResourcesClientImpl implements CassandraResourcesClient {
private final ClientLogger logger = new ClientLogger(CassandraResourcesClientImpl.class);
/** The proxy service used to perform REST calls. */
private final CassandraResourcesService service;
/** The service client containing this operation class. */
private final CosmosDBManagementClientImpl client;
/**
* Initializes an instance of CassandraResourcesClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
CassandraResourcesClientImpl(CosmosDBManagementClientImpl client) {
this.service =
RestProxy.create(CassandraResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for CosmosDBManagementClientCassandraResources to be used by the proxy
* service to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "CosmosDBManagementCl")
private interface CassandraResourcesService {
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<CassandraKeyspaceListResult>> listCassandraKeyspaces(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<CassandraKeyspaceGetResultsInner>> getCassandraKeyspace(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Put(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}")
@ExpectedResponses({200, 202})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> createUpdateCassandraKeyspace(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json")
CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
@Delete(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}")
@ExpectedResponses({202, 204})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> deleteCassandraKeyspace(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@QueryParam("api-version") String apiVersion,
Context context);
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<ThroughputSettingsGetResultsInner>> getCassandraKeyspaceThroughput(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Put(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default")
@ExpectedResponses({200, 202})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> updateCassandraKeyspaceThroughput(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Post(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"
+ "/migrateToAutoscale")
@ExpectedResponses({200, 202})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> migrateCassandraKeyspaceToAutoscale(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Post(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default"
+ "/migrateToManualThroughput")
@ExpectedResponses({200, 202})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> migrateCassandraKeyspaceToManualThroughput(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<CassandraTableListResult>> listCassandraTables(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<CassandraTableGetResultsInner>> getCassandraTable(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@PathParam("tableName") String tableName,
@QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Put(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}")
@ExpectedResponses({200, 202})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> createUpdateCassandraTable(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@PathParam("tableName") String tableName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
@Delete(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}")
@ExpectedResponses({202, 204})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> deleteCassandraTable(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@PathParam("tableName") String tableName,
@QueryParam("api-version") String apiVersion,
Context context);
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"
+ "/throughputSettings/default")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<ThroughputSettingsGetResultsInner>> getCassandraTableThroughput(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@PathParam("tableName") String tableName,
@QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Put(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"
+ "/throughputSettings/default")
@ExpectedResponses({200, 202})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> updateCassandraTableThroughput(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@PathParam("tableName") String tableName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Post(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"
+ "/throughputSettings/default/migrateToAutoscale")
@ExpectedResponses({200, 202})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> migrateCassandraTableToAutoscale(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@PathParam("tableName") String tableName,
@QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Post(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB"
+ "/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}"
+ "/throughputSettings/default/migrateToManualThroughput")
@ExpectedResponses({200, 202})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> migrateCassandraTableToManualThroughput(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@PathParam("keyspaceName") String keyspaceName,
@PathParam("tableName") String tableName,
@QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept,
Context context);
}
/**
* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 List operation response, that contains the Cassandra keyspaces and their properties.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<CassandraKeyspaceGetResultsInner>> listCassandraKeyspacesSinglePageAsync(
String resourceGroupName, String accountName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.listCassandraKeyspaces(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
apiVersion,
accept,
context))
.<PagedResponse<CassandraKeyspaceGetResultsInner>>map(
res ->
new PagedResponseBase<>(
res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @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 List operation response, that contains the Cassandra keyspaces and their properties.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<CassandraKeyspaceGetResultsInner>> listCassandraKeyspacesSinglePageAsync(
String resourceGroupName, String accountName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listCassandraKeyspaces(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
apiVersion,
accept,
context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));
}
/**
* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 List operation response, that contains the Cassandra keyspaces and their properties.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<CassandraKeyspaceGetResultsInner> listCassandraKeyspacesAsync(
String resourceGroupName, String accountName) {
return new PagedFlux<>(() -> listCassandraKeyspacesSinglePageAsync(resourceGroupName, accountName));
}
/**
* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @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 List operation response, that contains the Cassandra keyspaces and their properties.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux<CassandraKeyspaceGetResultsInner> listCassandraKeyspacesAsync(
String resourceGroupName, String accountName, Context context) {
return new PagedFlux<>(() -> listCassandraKeyspacesSinglePageAsync(resourceGroupName, accountName, context));
}
/**
* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 List operation response, that contains the Cassandra keyspaces and their properties.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<CassandraKeyspaceGetResultsInner> listCassandraKeyspaces(
String resourceGroupName, String accountName) {
return new PagedIterable<>(listCassandraKeyspacesAsync(resourceGroupName, accountName));
}
/**
* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @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 List operation response, that contains the Cassandra keyspaces and their properties.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<CassandraKeyspaceGetResultsInner> listCassandraKeyspaces(
String resourceGroupName, String accountName, Context context) {
return new PagedIterable<>(listCassandraKeyspacesAsync(resourceGroupName, accountName, context));
}
/**
* Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<CassandraKeyspaceGetResultsInner>> getCassandraKeyspaceWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.getCassandraKeyspace(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<CassandraKeyspaceGetResultsInner>> getCassandraKeyspaceWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.getCassandraKeyspace(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
accept,
context);
}
/**
* Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<CassandraKeyspaceGetResultsInner> getCassandraKeyspaceAsync(
String resourceGroupName, String accountName, String keyspaceName) {
return getCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName)
.flatMap(
(Response<CassandraKeyspaceGetResultsInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
}
/**
* Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public CassandraKeyspaceGetResultsInner getCassandraKeyspace(
String resourceGroupName, String accountName, String keyspaceName) {
return getCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).block();
}
/**
* Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<CassandraKeyspaceGetResultsInner> getCassandraKeyspaceWithResponse(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return getCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName, context).block();
}
/**
* Create or update an Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param createUpdateCassandraKeyspaceParameters Parameters to create and update Cosmos DB Cassandra keyspace.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB Cassandra keyspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Flux<ByteBuffer>>> createUpdateCassandraKeyspaceWithResponseAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (createUpdateCassandraKeyspaceParameters == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null."));
} else {
createUpdateCassandraKeyspaceParameters.validate();
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.createUpdateCassandraKeyspace(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
createUpdateCassandraKeyspaceParameters,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Create or update an Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param createUpdateCassandraKeyspaceParameters Parameters to create and update Cosmos DB Cassandra keyspace.
* @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 an Azure Cosmos DB Cassandra keyspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> createUpdateCassandraKeyspaceWithResponseAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters,
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (createUpdateCassandraKeyspaceParameters == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null."));
} else {
createUpdateCassandraKeyspaceParameters.validate();
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.createUpdateCassandraKeyspace(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
createUpdateCassandraKeyspaceParameters,
accept,
context);
}
/**
* Create or update an Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param createUpdateCassandraKeyspaceParameters Parameters to create and update Cosmos DB Cassandra keyspace.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB Cassandra keyspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<CassandraKeyspaceGetResultsInner>, CassandraKeyspaceGetResultsInner>
beginCreateUpdateCassandraKeyspaceAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) {
Mono<Response<Flux<ByteBuffer>>> mono =
createUpdateCassandraKeyspaceWithResponseAsync(
resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters);
return this
.client
.<CassandraKeyspaceGetResultsInner, CassandraKeyspaceGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
CassandraKeyspaceGetResultsInner.class,
CassandraKeyspaceGetResultsInner.class,
Context.NONE);
}
/**
* Create or update an Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param createUpdateCassandraKeyspaceParameters Parameters to create and update Cosmos DB Cassandra keyspace.
* @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 an Azure Cosmos DB Cassandra keyspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<CassandraKeyspaceGetResultsInner>, CassandraKeyspaceGetResultsInner>
beginCreateUpdateCassandraKeyspaceAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters,
Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
createUpdateCassandraKeyspaceWithResponseAsync(
resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, context);
return this
.client
.<CassandraKeyspaceGetResultsInner, CassandraKeyspaceGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
CassandraKeyspaceGetResultsInner.class,
CassandraKeyspaceGetResultsInner.class,
context);
}
/**
* Create or update an Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param createUpdateCassandraKeyspaceParameters Parameters to create and update Cosmos DB Cassandra keyspace.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB Cassandra keyspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<CassandraKeyspaceGetResultsInner>, CassandraKeyspaceGetResultsInner>
beginCreateUpdateCassandraKeyspace(
String resourceGroupName,
String accountName,
String keyspaceName,
CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) {
return beginCreateUpdateCassandraKeyspaceAsync(
resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters)
.getSyncPoller();
}
/**
* Create or update an Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param createUpdateCassandraKeyspaceParameters Parameters to create and update Cosmos DB Cassandra keyspace.
* @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 an Azure Cosmos DB Cassandra keyspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<CassandraKeyspaceGetResultsInner>, CassandraKeyspaceGetResultsInner>
beginCreateUpdateCassandraKeyspace(
String resourceGroupName,
String accountName,
String keyspaceName,
CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters,
Context context) {
return beginCreateUpdateCassandraKeyspaceAsync(
resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, context)
.getSyncPoller();
}
/**
* Create or update an Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param createUpdateCassandraKeyspaceParameters Parameters to create and update Cosmos DB Cassandra keyspace.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB Cassandra keyspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<CassandraKeyspaceGetResultsInner> createUpdateCassandraKeyspaceAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) {
return beginCreateUpdateCassandraKeyspaceAsync(
resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update an Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param createUpdateCassandraKeyspaceParameters Parameters to create and update Cosmos DB Cassandra keyspace.
* @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 an Azure Cosmos DB Cassandra keyspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<CassandraKeyspaceGetResultsInner> createUpdateCassandraKeyspaceAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters,
Context context) {
return beginCreateUpdateCassandraKeyspaceAsync(
resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update an Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param createUpdateCassandraKeyspaceParameters Parameters to create and update Cosmos DB Cassandra keyspace.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB Cassandra keyspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(
String resourceGroupName,
String accountName,
String keyspaceName,
CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) {
return createUpdateCassandraKeyspaceAsync(
resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters)
.block();
}
/**
* Create or update an Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param createUpdateCassandraKeyspaceParameters Parameters to create and update Cosmos DB Cassandra keyspace.
* @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 an Azure Cosmos DB Cassandra keyspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(
String resourceGroupName,
String accountName,
String keyspaceName,
CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters,
Context context) {
return createUpdateCassandraKeyspaceAsync(
resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, context)
.block();
}
/**
* Deletes an existing Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Flux<ByteBuffer>>> deleteCassandraKeyspaceWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
return FluxUtil
.withContext(
context ->
service
.deleteCassandraKeyspace(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Deletes an existing Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> deleteCassandraKeyspaceWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
context = this.client.mergeContext(context);
return service
.deleteCassandraKeyspace(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
context);
}
/**
* Deletes an existing Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<Void>, Void> beginDeleteCassandraKeyspaceAsync(
String resourceGroupName, String accountName, String keyspaceName) {
Mono<Response<Flux<ByteBuffer>>> mono =
deleteCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName);
return this
.client
.<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
}
/**
* Deletes an existing Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<Void>, Void> beginDeleteCassandraKeyspaceAsync(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
deleteCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName, context);
return this
.client
.<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
}
/**
* Deletes an existing Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<Void>, Void> beginDeleteCassandraKeyspace(
String resourceGroupName, String accountName, String keyspaceName) {
return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).getSyncPoller();
}
/**
* Deletes an existing Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<Void>, Void> beginDeleteCassandraKeyspace(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context).getSyncPoller();
}
/**
* Deletes an existing Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) {
return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an existing Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Void> deleteCassandraKeyspaceAsync(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an existing Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @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 deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName) {
deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).block();
}
/**
* Deletes an existing Azure Cosmos DB Cassandra keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 deleteCassandraKeyspace(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context).block();
}
/**
* Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the
* provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the
* provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<ThroughputSettingsGetResultsInner>> getCassandraKeyspaceThroughputWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.getCassandraKeyspaceThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the
* provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the
* provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<ThroughputSettingsGetResultsInner>> getCassandraKeyspaceThroughputWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.getCassandraKeyspaceThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
accept,
context);
}
/**
* Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the
* provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the
* provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ThroughputSettingsGetResultsInner> getCassandraKeyspaceThroughputAsync(
String resourceGroupName, String accountName, String keyspaceName) {
return getCassandraKeyspaceThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName)
.flatMap(
(Response<ThroughputSettingsGetResultsInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
}
/**
* Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the
* provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the
* provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner getCassandraKeyspaceThroughput(
String resourceGroupName, String accountName, String keyspaceName) {
return getCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName).block();
}
/**
* Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the
* provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the
* provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<ThroughputSettingsGetResultsInner> getCassandraKeyspaceThroughputWithResponse(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return getCassandraKeyspaceThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, context)
.block();
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Flux<ByteBuffer>>> updateCassandraKeyspaceThroughputWithResponseAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (updateThroughputParameters == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter updateThroughputParameters is required and cannot be null."));
} else {
updateThroughputParameters.validate();
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.updateCassandraKeyspaceThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
updateThroughputParameters,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> updateCassandraKeyspaceThroughputWithResponseAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
ThroughputSettingsUpdateParameters updateThroughputParameters,
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (updateThroughputParameters == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter updateThroughputParameters is required and cannot be null."));
} else {
updateThroughputParameters.validate();
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.updateCassandraKeyspaceThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
updateThroughputParameters,
accept,
context);
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginUpdateCassandraKeyspaceThroughputAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
Mono<Response<Flux<ByteBuffer>>> mono =
updateCassandraKeyspaceThroughputWithResponseAsync(
resourceGroupName, accountName, keyspaceName, updateThroughputParameters);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
Context.NONE);
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginUpdateCassandraKeyspaceThroughputAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
ThroughputSettingsUpdateParameters updateThroughputParameters,
Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
updateCassandraKeyspaceThroughputWithResponseAsync(
resourceGroupName, accountName, keyspaceName, updateThroughputParameters, context);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
context);
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginUpdateCassandraKeyspaceThroughput(
String resourceGroupName,
String accountName,
String keyspaceName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
return beginUpdateCassandraKeyspaceThroughputAsync(
resourceGroupName, accountName, keyspaceName, updateThroughputParameters)
.getSyncPoller();
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginUpdateCassandraKeyspaceThroughput(
String resourceGroupName,
String accountName,
String keyspaceName,
ThroughputSettingsUpdateParameters updateThroughputParameters,
Context context) {
return beginUpdateCassandraKeyspaceThroughputAsync(
resourceGroupName, accountName, keyspaceName, updateThroughputParameters, context)
.getSyncPoller();
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ThroughputSettingsGetResultsInner> updateCassandraKeyspaceThroughputAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
return beginUpdateCassandraKeyspaceThroughputAsync(
resourceGroupName, accountName, keyspaceName, updateThroughputParameters)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ThroughputSettingsGetResultsInner> updateCassandraKeyspaceThroughputAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
ThroughputSettingsUpdateParameters updateThroughputParameters,
Context context) {
return beginUpdateCassandraKeyspaceThroughputAsync(
resourceGroupName, accountName, keyspaceName, updateThroughputParameters, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(
String resourceGroupName,
String accountName,
String keyspaceName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
return updateCassandraKeyspaceThroughputAsync(
resourceGroupName, accountName, keyspaceName, updateThroughputParameters)
.block();
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(
String resourceGroupName,
String accountName,
String keyspaceName,
ThroughputSettingsUpdateParameters updateThroughputParameters,
Context context) {
return updateCassandraKeyspaceThroughputAsync(
resourceGroupName, accountName, keyspaceName, updateThroughputParameters, context)
.block();
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Flux<ByteBuffer>>> migrateCassandraKeyspaceToAutoscaleWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.migrateCassandraKeyspaceToAutoscale(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> migrateCassandraKeyspaceToAutoscaleWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.migrateCassandraKeyspaceToAutoscale(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
accept,
context);
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraKeyspaceToAutoscaleAsync(
String resourceGroupName, String accountName, String keyspaceName) {
Mono<Response<Flux<ByteBuffer>>> mono =
migrateCassandraKeyspaceToAutoscaleWithResponseAsync(resourceGroupName, accountName, keyspaceName);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
Context.NONE);
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraKeyspaceToAutoscaleAsync(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
migrateCassandraKeyspaceToAutoscaleWithResponseAsync(resourceGroupName, accountName, keyspaceName, context);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
context);
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, String keyspaceName) {
return beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraKeyspaceToAutoscale(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, context)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ThroughputSettingsGetResultsInner> migrateCassandraKeyspaceToAutoscaleAsync(
String resourceGroupName, String accountName, String keyspaceName) {
return beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ThroughputSettingsGetResultsInner> migrateCassandraKeyspaceToAutoscaleAsync(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(
String resourceGroupName, String accountName, String keyspaceName) {
return migrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName).block();
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return migrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, context).block();
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Flux<ByteBuffer>>> migrateCassandraKeyspaceToManualThroughputWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.migrateCassandraKeyspaceToManualThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> migrateCassandraKeyspaceToManualThroughputWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.migrateCassandraKeyspaceToManualThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
accept,
context);
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraKeyspaceToManualThroughputAsync(
String resourceGroupName, String accountName, String keyspaceName) {
Mono<Response<Flux<ByteBuffer>>> mono =
migrateCassandraKeyspaceToManualThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
Context.NONE);
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraKeyspaceToManualThroughputAsync(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
migrateCassandraKeyspaceToManualThroughputWithResponseAsync(
resourceGroupName, accountName, keyspaceName, context);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
context);
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraKeyspaceToManualThroughput(
String resourceGroupName, String accountName, String keyspaceName) {
return beginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraKeyspaceToManualThroughput(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return beginMigrateCassandraKeyspaceToManualThroughputAsync(
resourceGroupName, accountName, keyspaceName, context)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ThroughputSettingsGetResultsInner> migrateCassandraKeyspaceToManualThroughputAsync(
String resourceGroupName, String accountName, String keyspaceName) {
return beginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ThroughputSettingsGetResultsInner> migrateCassandraKeyspaceToManualThroughputAsync(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return beginMigrateCassandraKeyspaceToManualThroughputAsync(
resourceGroupName, accountName, keyspaceName, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThroughput(
String resourceGroupName, String accountName, String keyspaceName) {
return migrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName).block();
}
/**
* Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThroughput(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return migrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, context)
.block();
}
/**
* Lists the Cassandra table under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 List operation response, that contains the Cassandra tables and their properties.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<CassandraTableGetResultsInner>> listCassandraTablesSinglePageAsync(
String resourceGroupName, String accountName, String keyspaceName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.listCassandraTables(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
accept,
context))
.<PagedResponse<CassandraTableGetResultsInner>>map(
res ->
new PagedResponseBase<>(
res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Lists the Cassandra table under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 List operation response, that contains the Cassandra tables and their properties.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<CassandraTableGetResultsInner>> listCassandraTablesSinglePageAsync(
String resourceGroupName, String accountName, String keyspaceName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listCassandraTables(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
apiVersion,
accept,
context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));
}
/**
* Lists the Cassandra table under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 List operation response, that contains the Cassandra tables and their properties.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<CassandraTableGetResultsInner> listCassandraTablesAsync(
String resourceGroupName, String accountName, String keyspaceName) {
return new PagedFlux<>(() -> listCassandraTablesSinglePageAsync(resourceGroupName, accountName, keyspaceName));
}
/**
* Lists the Cassandra table under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 List operation response, that contains the Cassandra tables and their properties.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux<CassandraTableGetResultsInner> listCassandraTablesAsync(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return new PagedFlux<>(
() -> listCassandraTablesSinglePageAsync(resourceGroupName, accountName, keyspaceName, context));
}
/**
* Lists the Cassandra table under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 List operation response, that contains the Cassandra tables and their properties.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<CassandraTableGetResultsInner> listCassandraTables(
String resourceGroupName, String accountName, String keyspaceName) {
return new PagedIterable<>(listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName));
}
/**
* Lists the Cassandra table under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @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 List operation response, that contains the Cassandra tables and their properties.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<CassandraTableGetResultsInner> listCassandraTables(
String resourceGroupName, String accountName, String keyspaceName, Context context) {
return new PagedIterable<>(listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName, context));
}
/**
* Gets the Cassandra table under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 Cassandra table under an existing Azure Cosmos DB database account.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<CassandraTableGetResultsInner>> getCassandraTableWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.getCassandraTable(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Gets the Cassandra table under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 Cassandra table under an existing Azure Cosmos DB database account.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<CassandraTableGetResultsInner>> getCassandraTableWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.getCassandraTable(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
accept,
context);
}
/**
* Gets the Cassandra table under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 Cassandra table under an existing Azure Cosmos DB database account.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<CassandraTableGetResultsInner> getCassandraTableAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return getCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName)
.flatMap(
(Response<CassandraTableGetResultsInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
}
/**
* Gets the Cassandra table under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 Cassandra table under an existing Azure Cosmos DB database account.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public CassandraTableGetResultsInner getCassandraTable(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return getCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).block();
}
/**
* Gets the Cassandra table under an existing Azure Cosmos DB database account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 Cassandra table under an existing Azure Cosmos DB database account.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<CassandraTableGetResultsInner> getCassandraTableWithResponse(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
return getCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, context)
.block();
}
/**
* Create or update an Azure Cosmos DB Cassandra Table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param createUpdateCassandraTableParameters Parameters to create and update Cosmos DB Cassandra table.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB Cassandra table.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Flux<ByteBuffer>>> createUpdateCassandraTableWithResponseAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
if (createUpdateCassandraTableParameters == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter createUpdateCassandraTableParameters is required and cannot be null."));
} else {
createUpdateCassandraTableParameters.validate();
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.createUpdateCassandraTable(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
createUpdateCassandraTableParameters,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Create or update an Azure Cosmos DB Cassandra Table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param createUpdateCassandraTableParameters Parameters to create and update Cosmos DB Cassandra table.
* @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 an Azure Cosmos DB Cassandra table.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> createUpdateCassandraTableWithResponseAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters,
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
if (createUpdateCassandraTableParameters == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter createUpdateCassandraTableParameters is required and cannot be null."));
} else {
createUpdateCassandraTableParameters.validate();
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.createUpdateCassandraTable(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
createUpdateCassandraTableParameters,
accept,
context);
}
/**
* Create or update an Azure Cosmos DB Cassandra Table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param createUpdateCassandraTableParameters Parameters to create and update Cosmos DB Cassandra table.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB Cassandra table.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<CassandraTableGetResultsInner>, CassandraTableGetResultsInner>
beginCreateUpdateCassandraTableAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) {
Mono<Response<Flux<ByteBuffer>>> mono =
createUpdateCassandraTableWithResponseAsync(
resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters);
return this
.client
.<CassandraTableGetResultsInner, CassandraTableGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
CassandraTableGetResultsInner.class,
CassandraTableGetResultsInner.class,
Context.NONE);
}
/**
* Create or update an Azure Cosmos DB Cassandra Table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param createUpdateCassandraTableParameters Parameters to create and update Cosmos DB Cassandra table.
* @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 an Azure Cosmos DB Cassandra table.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<CassandraTableGetResultsInner>, CassandraTableGetResultsInner>
beginCreateUpdateCassandraTableAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters,
Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
createUpdateCassandraTableWithResponseAsync(
resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, context);
return this
.client
.<CassandraTableGetResultsInner, CassandraTableGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
CassandraTableGetResultsInner.class,
CassandraTableGetResultsInner.class,
context);
}
/**
* Create or update an Azure Cosmos DB Cassandra Table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param createUpdateCassandraTableParameters Parameters to create and update Cosmos DB Cassandra table.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB Cassandra table.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<CassandraTableGetResultsInner>, CassandraTableGetResultsInner>
beginCreateUpdateCassandraTable(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) {
return beginCreateUpdateCassandraTableAsync(
resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters)
.getSyncPoller();
}
/**
* Create or update an Azure Cosmos DB Cassandra Table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param createUpdateCassandraTableParameters Parameters to create and update Cosmos DB Cassandra table.
* @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 an Azure Cosmos DB Cassandra table.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<CassandraTableGetResultsInner>, CassandraTableGetResultsInner>
beginCreateUpdateCassandraTable(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters,
Context context) {
return beginCreateUpdateCassandraTableAsync(
resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, context)
.getSyncPoller();
}
/**
* Create or update an Azure Cosmos DB Cassandra Table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param createUpdateCassandraTableParameters Parameters to create and update Cosmos DB Cassandra table.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB Cassandra table.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<CassandraTableGetResultsInner> createUpdateCassandraTableAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) {
return beginCreateUpdateCassandraTableAsync(
resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update an Azure Cosmos DB Cassandra Table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param createUpdateCassandraTableParameters Parameters to create and update Cosmos DB Cassandra table.
* @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 an Azure Cosmos DB Cassandra table.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<CassandraTableGetResultsInner> createUpdateCassandraTableAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters,
Context context) {
return beginCreateUpdateCassandraTableAsync(
resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update an Azure Cosmos DB Cassandra Table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param createUpdateCassandraTableParameters Parameters to create and update Cosmos DB Cassandra table.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB Cassandra table.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public CassandraTableGetResultsInner createUpdateCassandraTable(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) {
return createUpdateCassandraTableAsync(
resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters)
.block();
}
/**
* Create or update an Azure Cosmos DB Cassandra Table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param createUpdateCassandraTableParameters Parameters to create and update Cosmos DB Cassandra table.
* @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 an Azure Cosmos DB Cassandra table.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public CassandraTableGetResultsInner createUpdateCassandraTable(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters,
Context context) {
return createUpdateCassandraTableAsync(
resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, context)
.block();
}
/**
* Deletes an existing Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Flux<ByteBuffer>>> deleteCassandraTableWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
return FluxUtil
.withContext(
context ->
service
.deleteCassandraTable(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Deletes an existing Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> deleteCassandraTableWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
context = this.client.mergeContext(context);
return service
.deleteCassandraTable(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
context);
}
/**
* Deletes an existing Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<Void>, Void> beginDeleteCassandraTableAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
Mono<Response<Flux<ByteBuffer>>> mono =
deleteCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName);
return this
.client
.<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
}
/**
* Deletes an existing Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<Void>, Void> beginDeleteCassandraTableAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
deleteCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, context);
return this
.client
.<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
}
/**
* Deletes an existing Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<Void>, Void> beginDeleteCassandraTable(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).getSyncPoller();
}
/**
* Deletes an existing Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<Void>, Void> beginDeleteCassandraTable(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context)
.getSyncPoller();
}
/**
* Deletes an existing Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> deleteCassandraTableAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an existing Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Void> deleteCassandraTableAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an existing Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @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 deleteCassandraTable(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).block();
}
/**
* Deletes an existing Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 deleteCassandraTable(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context).block();
}
/**
* Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the
* provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the
* provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<ThroughputSettingsGetResultsInner>> getCassandraTableThroughputWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.getCassandraTableThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the
* provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the
* provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<ThroughputSettingsGetResultsInner>> getCassandraTableThroughputWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.getCassandraTableThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
accept,
context);
}
/**
* Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the
* provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the
* provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ThroughputSettingsGetResultsInner> getCassandraTableThroughputAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return getCassandraTableThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName)
.flatMap(
(Response<ThroughputSettingsGetResultsInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
}
/**
* Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the
* provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws 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 RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the
* provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner getCassandraTableThroughput(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return getCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName).block();
}
/**
* Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the
* provided name.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the
* provided name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<ThroughputSettingsGetResultsInner> getCassandraTableThroughputWithResponse(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
return getCassandraTableThroughputWithResponseAsync(
resourceGroupName, accountName, keyspaceName, tableName, context)
.block();
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Flux<ByteBuffer>>> updateCassandraTableThroughputWithResponseAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
if (updateThroughputParameters == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter updateThroughputParameters is required and cannot be null."));
} else {
updateThroughputParameters.validate();
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.updateCassandraTableThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
updateThroughputParameters,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> updateCassandraTableThroughputWithResponseAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
ThroughputSettingsUpdateParameters updateThroughputParameters,
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
if (updateThroughputParameters == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter updateThroughputParameters is required and cannot be null."));
} else {
updateThroughputParameters.validate();
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.updateCassandraTableThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
updateThroughputParameters,
accept,
context);
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginUpdateCassandraTableThroughputAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
Mono<Response<Flux<ByteBuffer>>> mono =
updateCassandraTableThroughputWithResponseAsync(
resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
Context.NONE);
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginUpdateCassandraTableThroughputAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
ThroughputSettingsUpdateParameters updateThroughputParameters,
Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
updateCassandraTableThroughputWithResponseAsync(
resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, context);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
context);
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginUpdateCassandraTableThroughput(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
return beginUpdateCassandraTableThroughputAsync(
resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters)
.getSyncPoller();
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginUpdateCassandraTableThroughput(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
ThroughputSettingsUpdateParameters updateThroughputParameters,
Context context) {
return beginUpdateCassandraTableThroughputAsync(
resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, context)
.getSyncPoller();
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ThroughputSettingsGetResultsInner> updateCassandraTableThroughputAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
return beginUpdateCassandraTableThroughputAsync(
resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ThroughputSettingsGetResultsInner> updateCassandraTableThroughputAsync(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
ThroughputSettingsUpdateParameters updateThroughputParameters,
Context context) {
return beginUpdateCassandraTableThroughputAsync(
resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner updateCassandraTableThroughput(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
ThroughputSettingsUpdateParameters updateThroughputParameters) {
return updateCassandraTableThroughputAsync(
resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters)
.block();
}
/**
* Update RUs per second of an Azure Cosmos DB Cassandra table.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @param updateThroughputParameters Parameters to update Cosmos DB resource throughput.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner updateCassandraTableThroughput(
String resourceGroupName,
String accountName,
String keyspaceName,
String tableName,
ThroughputSettingsUpdateParameters updateThroughputParameters,
Context context) {
return updateCassandraTableThroughputAsync(
resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, context)
.block();
}
/**
* Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Flux<ByteBuffer>>> migrateCassandraTableToAutoscaleWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.migrateCassandraTableToAutoscale(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> migrateCassandraTableToAutoscaleWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.migrateCassandraTableToAutoscale(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
accept,
context);
}
/**
* Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraTableToAutoscaleAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
Mono<Response<Flux<ByteBuffer>>> mono =
migrateCassandraTableToAutoscaleWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
Context.NONE);
}
/**
* Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraTableToAutoscaleAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
migrateCassandraTableToAutoscaleWithResponseAsync(
resourceGroupName, accountName, keyspaceName, tableName, context);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
context);
}
/**
* Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraTableToAutoscale(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return beginMigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraTableToAutoscale(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
return beginMigrateCassandraTableToAutoscaleAsync(
resourceGroupName, accountName, keyspaceName, tableName, context)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ThroughputSettingsGetResultsInner> migrateCassandraTableToAutoscaleAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return beginMigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ThroughputSettingsGetResultsInner> migrateCassandraTableToAutoscaleAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
return beginMigrateCassandraTableToAutoscaleAsync(
resourceGroupName, accountName, keyspaceName, tableName, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateCassandraTableToAutoscale(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return migrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName).block();
}
/**
* Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateCassandraTableToAutoscale(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
return migrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName, context)
.block();
}
/**
* Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Flux<ByteBuffer>>> migrateCassandraTableToManualThroughputWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.migrateCassandraTableToManualThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
accept,
context))
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
}
/**
* Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> migrateCassandraTableToManualThroughputWithResponseAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (keyspaceName == null) {
return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."));
}
if (tableName == null) {
return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null."));
}
final String apiVersion = "2020-09-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.migrateCassandraTableToManualThroughput(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
keyspaceName,
tableName,
apiVersion,
accept,
context);
}
/**
* Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraTableToManualThroughputAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
Mono<Response<Flux<ByteBuffer>>> mono =
migrateCassandraTableToManualThroughputWithResponseAsync(
resourceGroupName, accountName, keyspaceName, tableName);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
Context.NONE);
}
/**
* Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraTableToManualThroughputAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
migrateCassandraTableToManualThroughputWithResponseAsync(
resourceGroupName, accountName, keyspaceName, tableName, context);
return this
.client
.<ThroughputSettingsGetResultsInner, ThroughputSettingsGetResultsInner>getLroResult(
mono,
this.client.getHttpPipeline(),
ThroughputSettingsGetResultsInner.class,
ThroughputSettingsGetResultsInner.class,
context);
}
/**
* Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraTableToManualThroughput(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return beginMigrateCassandraTableToManualThroughputAsync(
resourceGroupName, accountName, keyspaceName, tableName)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner>
beginMigrateCassandraTableToManualThroughput(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
return beginMigrateCassandraTableToManualThroughputAsync(
resourceGroupName, accountName, keyspaceName, tableName, context)
.getSyncPoller();
}
/**
* Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ThroughputSettingsGetResultsInner> migrateCassandraTableToManualThroughputAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return beginMigrateCassandraTableToManualThroughputAsync(
resourceGroupName, accountName, keyspaceName, tableName)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ThroughputSettingsGetResultsInner> migrateCassandraTableToManualThroughputAsync(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
return beginMigrateCassandraTableToManualThroughputAsync(
resourceGroupName, accountName, keyspaceName, tableName, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(
String resourceGroupName, String accountName, String keyspaceName, String tableName) {
return migrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName)
.block();
}
/**
* Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param keyspaceName Cosmos DB keyspace name.
* @param tableName Cosmos DB table name.
* @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 an Azure Cosmos DB resource throughput.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(
String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) {
return migrateCassandraTableToManualThroughputAsync(
resourceGroupName, accountName, keyspaceName, tableName, context)
.block();
}
}