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>