# (أ) انظر الملاحظة 5.

Canonical URL: https://developers.iagenify.com/ar/sdk/ref/connected-storage/run/usage/
Language: ar

`storage.run({ action: "usage" })`

كم المساحة التي يأخذها هذا التخزين، الرقم الذي يقرأ قبل الكتابة يفشل بسبب عدم وجود غرفة.

Status: any storage · free · a reading

```javascript
await storage.run({ action: "usage" });
```

## لماذا تسأل قبل {#why}

كتابه ماضيه تم رفض مساحة الخطة مع `quota_exceeded`● القراء والحذف يواصلون العمل - ذلك أن عدم التماثل هو متعمد، حتى تتمكن دائما من الحصول على البيانات وإفساح المجال - ولكن الكتابة التي تفشل في منتصف الطريق من خلال دفعة أوراقك لمعرفة ما الذي هبط.

```javascript
const before = await storage.run({ action: "usage" });

// Write in batches, and stop on the first refusal rather than pushing through
for (const batch of batches) {
  try {
    await storage.run({ action: "insert", collection, documents: JSON.stringify(batch) });
  } catch (err) {
    if (err.code === "quota_exceeded") break;
    throw err;
  }
}
```

## هذا التخزين أو الحساب {#account}

| مسألة | Ask |
| --- | --- |
| كم هو كامل هذا واحد؟ | (يُنْفَر (يُع الإجراء: "الاستخدام") |
| ماذا تعطي الخطة، عبر الخدمات؟ | api.cloud.usage() |
| أي ملفات تأخذ المساحة؟ | api.files.list()وصنف حسب الحجم |

وجهة نظر مستوى الحساب هي التي تخبرك ما إذا كان شراء الحيز سيساعد لأن هذا هو المكان الذي تعيش فيه علاوة الخطة.

- [api.cloud.usage()](/ar/sdk/ref/cloud/usage): "لسبيس دو كومبت" خدمة الخدمات
- [run()](/ar/sdk/ref/connected-storage/run): إلى حد ما أفعال، مثل garede-fuus و se que chacune coamte.

```python
storage.run(action="usage")
```

```python
import json
from iagenify import IaGenifyError

before = storage.run(action="usage")

# Write in batches, and stop on the first refusal rather than pushing through
for batch in batches:
    try:
        storage.run(action="insert", collection=collection, documents=json.dumps(batch))
    except IaGenifyError as error:
        if error.code == "quota_exceeded":
            break
        raise
```
