Offer class
方法
read(Request |
阅读给定 套餐的 OfferDefinition。 示例
|
replace(Offer |
将给定的 套餐 替换为指定的 OfferDefinition。 示例 将 offer 替换为具有更新吞吐量的新 offer 定义
|
属性详细信息
client
id
id: string
属性值
string
url
返回资源的引用 URL。 用于在权限中链接。
string url
属性值
string
方法详细信息
read(RequestOptions)
阅读给定 套餐的 OfferDefinition。
示例
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>
参数
- options
- RequestOptions
返回
Promise<OfferResponse>
replace(OfferDefinition, RequestOptions)
将给定的 套餐 替换为指定的 OfferDefinition。
示例
将 offer 替换为具有更新吞吐量的新 offer 定义
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>
参数
- body
- OfferDefinition
指定的 OfferDefinition
- options
- RequestOptions
返回
Promise<OfferResponse>