Megosztás:


Offer class

Meglévő Ajánlat azonosító alapján történő olvasására vagy cseréjére használható.

Tekintse meg Ajánlatok az összes ajánlat lekérdezéséhez vagy olvasásához.

Tulajdonságok

client
id
url

Az erőforrás hivatkozási URL-címét adja vissza. Az engedélyek csatolásához használatos.

Metódusok

read(RequestOptions)

Olvassa el az adott AjánlatOfferDefinition.

Példa

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)

Cserélje le a megadott Ajánlati a megadott OfferDefinition.

Példa

Cserélje le az ajánlatot egy új, frissített átviteli sebességű ajánlatdefinícióra

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

Tulajdonság adatai

client

client: CosmosClient

Tulajdonság értéke

id

id: string

Tulajdonság értéke

string

url

Az erőforrás hivatkozási URL-címét adja vissza. Az engedélyek csatolásához használatos.

string url

Tulajdonság értéke

string

Metódus adatai

read(RequestOptions)

Olvassa el az adott AjánlatOfferDefinition.

Példa

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>

Paraméterek

options
RequestOptions

Válaszok

Promise<OfferResponse>

replace(OfferDefinition, RequestOptions)

Cserélje le a megadott Ajánlati a megadott OfferDefinition.

Példa

Cserélje le az ajánlatot egy új, frissített átviteli sebességű ajánlatdefinícióra

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>

Paraméterek

options
RequestOptions

Válaszok

Promise<OfferResponse>