Offer class
Methods
read(Request |
Read the OfferDefinition for the given Offer. Example
|
replace(Offer |
Replace the given Offer with the specified OfferDefinition. Example replace offer with a new offer definition with updated throughput
|
Property Details
client
id
id: string
Property Value
string
url
Returns a reference URL to the resource. Used for linking in Permissions.
string url
Property Value
string
Method Details
read(RequestOptions)
Read the OfferDefinition for the given Offer.
Example
import { CosmosClient } from "@azure/cosmos";
const endpoint = "https://your-account.documents.azure.com";
const key = "<database account masterkey>";
const client = new CosmosClient({ endpoint, key });
const { resource: offer } = await client.offer("<offer-id>").read();
function read(options?: RequestOptions): Promise<OfferResponse>
Parameters
- options
- RequestOptions
Returns
Promise<OfferResponse>
replace(OfferDefinition, RequestOptions)
Replace the given Offer with the specified OfferDefinition.
Example
replace offer with a new offer definition with updated throughput
import { CosmosClient } from "@azure/cosmos";
const endpoint = "https://your-account.documents.azure.com";
const key = "<database account masterkey>";
const client = new CosmosClient({ endpoint, key });
const { resource: offer } = await client.offer("<offer-id>").read();
// @ts-preservewhitespace
offer.content.offerThroughput = 1000;
await client.offer("<offer-id>").replace(offer);
function replace(body: OfferDefinition, options?: RequestOptions): Promise<OfferResponse>
Parameters
- body
- OfferDefinition
The specified OfferDefinition
- options
- RequestOptions
Returns
Promise<OfferResponse>