BlobChangeFeedClient class

생성자

BlobChangeFeedClient(string, Pipeline)

BlobChangeFeedClient의 인스턴스를 만듭니다.

BlobChangeFeedClient(string, StorageSharedKeyCredential | AnonymousCredential | TokenCredential, StoragePipelineOptions, BlobChangeFeedClientOptions)

BlobChangeFeedClient의 인스턴스를 만듭니다.

메서드

fromConnectionString(string, StoragePipelineOptions, BlobChangeFeedClientOptions)

연결 문자열에서 BlobChangeFeedClient 인스턴스를 만듭니다.

listChanges(BlobChangeFeedListChangesOptions)

지정된 계정의 모든 변경 피드 이벤트를 나열하는 비동기 반복기를 반환합니다.

.byPage()는 비동기 반복 반복기를 반환하여 페이지의 변경 피드 이벤트를 나열합니다.

구문을 사용하는 for await 예제:

let i = 1;
for await (const event of blobChangeFeedClient.listChanges()) {
  console.log(`Event ${i++}, type: ${event.eventType}`);
}

iter.next()을(를) 사용하는 예제:

let i = 1;
const iter = blobChangeFeedClient.listChanges();
let eventItem = await iter.next();
while (!eventItem.done) {
  console.log(`Event ${i++}, type: ${eventItem.eventType}`);
  eventItem = await iter.next();
}

byPage()을(를) 사용하는 예제:

// passing optional maxPageSize in the page settings
let i = 1;
for await (const eventPage of blobChangeFeedClient.listChanges().byPage({ maxPageSize: 20 })) {
  if (eventPage.events) {
    for (const event of eventPage.events) {
      console.log(`Event ${i++}, type: ${event.eventType}`);
    }
  }
}

표식과 함께 페이징을 사용하는 예제:

let i = 1;
let iterator = blobChangeFeedClient.listChanges().byPage({ maxPageSize: 2 });
let eventPage = (await iterator.next()).value;

if (eventPage.events) {
  for (const container of eventPage.events) {
    console.log(`Event ${i++}, type: ${event.eventType}`);
  }
}

// Gets next marker
let marker = eventPage.continuationToken;
// Passing next marker as continuationToken
iterator = blobChangeFeedClient
  .listChanges()
  .byPage({ continuationToken: marker, maxPageSize: 10 });
eventPage = (await iterator.next()).value;

if (eventPage.events) {
  for (const container of eventPage.events) {
     console.log(`Event ${i++}, type: ${event.eventType}`);
  }
}

생성자 세부 정보

BlobChangeFeedClient(string, Pipeline)

BlobChangeFeedClient의 인스턴스를 만듭니다.

new BlobChangeFeedClient(url: string, pipeline: Pipeline)

매개 변수

url

string

Azure Storage Blob 서비스를 가리키는 클라이언트 문자열(예: "https://myaccount.blob.core.windows.net") AnonymousCredential(예: "https://myaccount.blob.core.windows.net?sasString")을 사용하는 경우 SAS를 추가할 수 있습니다.

pipeline
Pipeline

newPipeline()을 호출하여 기본 파이프라인을 만들거나 사용자 지정된 파이프라인을 제공합니다.

BlobChangeFeedClient(string, StorageSharedKeyCredential | AnonymousCredential | TokenCredential, StoragePipelineOptions, BlobChangeFeedClientOptions)

BlobChangeFeedClient의 인스턴스를 만듭니다.

new BlobChangeFeedClient(url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions, changeFeedClientOptions?: BlobChangeFeedClientOptions)

매개 변수

url

string

Azure Storage Blob 서비스를 가리키는 클라이언트 문자열(예: "https://myaccount.blob.core.windows.net") AnonymousCredential(예: "https://myaccount.blob.core.windows.net?sasString")을 사용하는 경우 SAS를 추가할 수 있습니다.

credential

StorageSharedKeyCredential | AnonymousCredential | TokenCredential

AnonymousCredential, StorageSharedKeyCredential 또는 패키지의 @azure/identity 자격 증명과 같이 서비스에 대한 요청을 인증합니다. TokenCredential 인터페이스를 구현하는 개체를 제공할 수도 있습니다. 지정하지 않으면 AnonymousCredential이 사용됩니다.

options
StoragePipelineOptions

(선택 사항) HTTP 파이프라인을 구성하는 옵션입니다.

에서 @azure/identityDefaultAzureCredential을 사용하는 예제입니다.

const account = "<storage account name>";

const defaultAzureCredential = new DefaultAzureCredential();

const blobChangeFeedClient = new BlobChangeFeedClient(
  `https://${account}.blob.core.windows.net`,
  defaultAzureCredential
);

계정 이름/키를 사용하는 예제:

const account = "<storage account name>"
const sharedKeyCredential = new StorageSharedKeyCredential(account, "<account key>");

const blobChangeFeedClient = new BlobChangeFeedClient(
  `https://${account}.blob.core.windows.net`,
  sharedKeyCredential
);
changeFeedClientOptions
BlobChangeFeedClientOptions

메서드 세부 정보

fromConnectionString(string, StoragePipelineOptions, BlobChangeFeedClientOptions)

연결 문자열에서 BlobChangeFeedClient 인스턴스를 만듭니다.

static function fromConnectionString(connectionString: string, options?: StoragePipelineOptions, changeFeedClientOptions?: BlobChangeFeedClientOptions): BlobChangeFeedClient

매개 변수

connectionString

string

계정 연결 문자열 또는 Azure Storage 계정의 SAS 연결 문자열입니다. [ 참고 - 계정 연결 문자열은 NODE.JS 런타임에서만 사용할 수 있습니다. ] 계정 연결 문자열 예제 -DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net SAS 연결 문자열 예제 - BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString

options
StoragePipelineOptions

(선택 사항) HTTP 파이프라인을 구성하는 옵션입니다.

changeFeedClientOptions
BlobChangeFeedClientOptions

반환

listChanges(BlobChangeFeedListChangesOptions)

지정된 계정의 모든 변경 피드 이벤트를 나열하는 비동기 반복기를 반환합니다.

.byPage()는 비동기 반복 반복기를 반환하여 페이지의 변경 피드 이벤트를 나열합니다.

구문을 사용하는 for await 예제:

let i = 1;
for await (const event of blobChangeFeedClient.listChanges()) {
  console.log(`Event ${i++}, type: ${event.eventType}`);
}

iter.next()을(를) 사용하는 예제:

let i = 1;
const iter = blobChangeFeedClient.listChanges();
let eventItem = await iter.next();
while (!eventItem.done) {
  console.log(`Event ${i++}, type: ${eventItem.eventType}`);
  eventItem = await iter.next();
}

byPage()을(를) 사용하는 예제:

// passing optional maxPageSize in the page settings
let i = 1;
for await (const eventPage of blobChangeFeedClient.listChanges().byPage({ maxPageSize: 20 })) {
  if (eventPage.events) {
    for (const event of eventPage.events) {
      console.log(`Event ${i++}, type: ${event.eventType}`);
    }
  }
}

표식과 함께 페이징을 사용하는 예제:

let i = 1;
let iterator = blobChangeFeedClient.listChanges().byPage({ maxPageSize: 2 });
let eventPage = (await iterator.next()).value;

if (eventPage.events) {
  for (const container of eventPage.events) {
    console.log(`Event ${i++}, type: ${event.eventType}`);
  }
}

// Gets next marker
let marker = eventPage.continuationToken;
// Passing next marker as continuationToken
iterator = blobChangeFeedClient
  .listChanges()
  .byPage({ continuationToken: marker, maxPageSize: 10 });
eventPage = (await iterator.next()).value;

if (eventPage.events) {
  for (const container of eventPage.events) {
     console.log(`Event ${i++}, type: ${event.eventType}`);
  }
}
function listChanges(options?: BlobChangeFeedListChangesOptions): PagedAsyncIterableIterator<BlobChangeFeedEvent, BlobChangeFeedEventPage, PageSettings>

매개 변수

options
BlobChangeFeedListChangesOptions

변경 피드 이벤트를 나열하는 옵션입니다.

반환

페이징을 지원하는 asyncIterableIterator입니다.