BlobChangeFeedClient class
BlobChangeFeedClient.
راجع https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-change-feed?tabs=azure-portal
المنشئون
| Blob |
إنشاء مثيل BlobChangeFeedClient. |
| Blob |
إنشاء مثيل BlobChangeFeedClient. |
الأساليب
| from |
إنشاء مثيل BlobChangeFeedClient من سلسلة الاتصال. |
| list |
إرجاع مكرر غير متزامن قابل للتكبير لسرد جميع أحداث موجز التغيير في الحساب المحدد. يقوم .byPage() بإرجاع مكرر غير متزامن قابل للتكريب لسرد أحداث موجز التغيير في الصفحات. مثال على استخدام بناء جملة
مثال على استخدام
مثال على استخدام
مثال على استخدام الترحيل مع علامة:
|
تفاصيل المنشئ
BlobChangeFeedClient(string, Pipeline)
إنشاء مثيل BlobChangeFeedClient.
new BlobChangeFeedClient(url: string, pipeline: Pipeline)
المعلمات
- url
-
string
سلسلة عميل تشير إلى خدمة Azure Storage blob، مثل "https://myaccount.blob.core.windows.net". يمكنك إلحاق SAS إذا كنت تستخدم AnonymousCredential، مثل "https://myaccount.blob.core.windows.net?sasString".
- 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". يمكنك إلحاق SAS إذا كنت تستخدم AnonymousCredential، مثل "https://myaccount.blob.core.windows.net?sasString".
- credential
-
StorageSharedKeyCredential | AnonymousCredential | TokenCredential
مثل AnonymousCredential أو StorageSharedKeyCredential أو أي بيانات اعتماد من حزمة @azure/identity لمصادقة الطلبات إلى الخدمة. يمكنك أيضا توفير كائن ينفذ واجهة TokenCredential. إذا لم يتم تحديده، يتم استخدام AnonymousCredential.
- options
- StoragePipelineOptions
اختياري. خيارات لتكوين البنية الأساسية لبرنامج ربط العمليات التجارية HTTP.
مثال على استخدام DefaultAzureCredential من @azure/identity:
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
سلسلة اتصال الحساب أو سلسلة اتصال SAS لحساب تخزين Azure.
[ ملاحظة - يمكن استخدام سلسلة اتصال الحساب فقط في وقت تشغيل 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 يدعم الترحيل.