다음을 통해 공유


Offer class

기존 제품 ID로 읽거나 바꾸는 데 사용합니다.

모든 제품을 쿼리하거나 읽으려면 제안 참조하세요.

속성

client
id
url

리소스에 대한 참조 URL을 반환합니다. 사용 권한에서 연결에 사용됩니다.

메서드

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();
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);

속성 세부 정보

client

client: CosmosClient

속성 값

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>

매개 변수

options
RequestOptions

반환

Promise<OfferResponse>