Last active
June 18, 2019 07:19
-
-
Save sajeetharan/d38fbb251e9e57177a5e68c5735a0fef to your computer and use it in GitHub Desktop.
Set the new RU
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//5) Get the RU increment from AppSettings and parse to an int | |
if (int.TryParse(config["CosmosDB_RU"], out int RUIncrement)) | |
{ | |
//5.a) create the new offer with the throughput increment added to the current throughput | |
int newThroughput = throughputCurrent + RUIncrement; | |
offer = new OfferV2(offer, newThroughput); | |
//5.b) persist the changes | |
await client.ReplaceOfferAsync(offer); | |
log.LogInformation(string.Format("New provisioned througput: {0} RU", newThroughput.ToString())); | |
return new OkObjectResult("The collection's throughput was changed..."); | |
} | |
else | |
{ | |
//5.c) if the throughputIncrement cannot be parsed return throughput not changed | |
return new BadRequestObjectResult("PARSE ERROR: The collection's throughput was not changed..."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment