Offer class
既存の オファー を ID で読み取ったり置き換えたりするために使用します。
すべてのプラン クエリまたは読み取りを行うプランの を参照してください。
メソッド
read(Request |
特定の オファーの OfferDefinition を読みます。 例
|
replace(Offer |
指定した オファー を、指定した OfferDefinitionに置き換えます。 例 オファーを新しいオファー定義と置き換え、スループットが更新された
|
プロパティの詳細
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に置き換えます。
例
オファーを新しいオファー定義と置き換え、スループットが更新された
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>