Share via


Database.ReplaceThroughputAsync Method

Definition

Overloads

ReplaceThroughputAsync(ThroughputProperties, RequestOptions, CancellationToken)

Sets throughput provisioned for a database in measurement of request units per second in the Azure Cosmos service.

ReplaceThroughputAsync(Int32, RequestOptions, CancellationToken)

Sets throughput provisioned for a database in measurement of request units per second in the Azure Cosmos service.

ReplaceThroughputAsync(ThroughputProperties, RequestOptions, CancellationToken)

Source:
Database.cs

Sets throughput provisioned for a database in measurement of request units per second in the Azure Cosmos service.

public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ThroughputResponse> ReplaceThroughputAsync (Microsoft.Azure.Cosmos.ThroughputProperties throughputProperties, Microsoft.Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ReplaceThroughputAsync : Microsoft.Azure.Cosmos.ThroughputProperties * Microsoft.Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ThroughputResponse>
Public MustOverride Function ReplaceThroughputAsync (throughputProperties As ThroughputProperties, Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ThroughputResponse)

Parameters

throughputProperties
ThroughputProperties

The Cosmos database throughput expressed in Request Units per second.

requestOptions
RequestOptions

(Optional) The options for the throughput request.

cancellationToken
CancellationToken

(Optional) CancellationToken representing request cancellation.

Returns

The throughput response.

Examples

The following example shows how to replace the manual throughput.

ThroughputResponse throughput = await this.cosmosDatabase.ReplaceThroughputAsync(
    ThroughputProperties.CreateManualThroughput(10000));

The following example shows how to replace the autoscale provisioned throughput.

ThroughputResponse throughput = await this.cosmosDatabase.ReplaceThroughputAsync(
    ThroughputProperties.CreateAutoscaleThroughput(10000));

Remarks

Request Units Set throughput on a database

Applies to

ReplaceThroughputAsync(Int32, RequestOptions, CancellationToken)

Source:
Database.cs

Sets throughput provisioned for a database in measurement of request units per second in the Azure Cosmos service.

public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ThroughputResponse> ReplaceThroughputAsync (int throughput, Microsoft.Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ReplaceThroughputAsync : int * Microsoft.Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ThroughputResponse>
Public MustOverride Function ReplaceThroughputAsync (throughput As Integer, Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ThroughputResponse)

Parameters

throughput
Int32

The Cosmos database throughput expressed in Request Units per second.

requestOptions
RequestOptions

(Optional) The options for the throughput request.

cancellationToken
CancellationToken

(Optional) CancellationToken representing request cancellation.

Returns

The throughput response.

Examples

The following example shows how to get the throughput.

ThroughputResponse throughput = await this.cosmosDatabase.ReplaceThroughputAsync(10000);

Remarks

Request Units

Applies to