api.cloud

usage()

api.cloud.usage() → Promise<Usage>

كل ما يُبقي الحساب في IaGenify سحابة، في كائن واحد: الخطة، الخدمات الثلاث، كل تخزين مع سقفه الخاص، والإضافات.

GET /api/cloud/usagefreecomputed on read
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

لا شيء هنا هو مخبأ: الأحجام هي الأحجام المسجلة لكل مخزن، والسقفات يعاد حسابها من الخطة و الإضافات في اللحظة التي تسأل. يدعو اثنان أي جانب من الكتابة الكبيرة يعطي جوابين مختلفين.

القيمة المُعادة

{
  pack: "go",                              // "free" | "go" | "starter"

  nosql: {
    usedBytes: 8_720_384,
    includedBytes: 1_048_576_000,          // ceiling × how many the plan allows
    quotaBytes: 1_048_576_000,             // included + the add-on pool
    perBaseBytes: 524_288_000,             // the ceiling of ONE storage
    bases: 2,
    maxBases: 2,
    overQuota: false,
    available: true,
    storages: [
      { id: "…", label: "App data",  usedBytes: 8_716_288, quotaBytes: 524_288_000, overQuota: false },
      { id: "…", label: "Reporting", usedBytes: 4_096,     quotaBytes: 524_288_000, overQuota: false }
    ]
  },

  sql:    { /* same shape */ },
  object: { /* same shape */ , hostingBytes: 2_310_144 },

  addons: {
    databaseGb: 0,
    objectGb: 1,
    renewsAt: "2026-11-02T10:14:00.000Z",
    lapsed: false,
    monthlyCredits: 200,
    pricePerGb: { database: 100, object: 200 }
  }
}
{
    "pack": "go",                              # "free" | "go" | "starter"

    "nosql": {
        "usedBytes": 8_720_384,
        "includedBytes": 1_048_576_000,        # ceiling × how many the plan allows
        "quotaBytes": 1_048_576_000,           # included + the add-on pool
        "perBaseBytes": 524_288_000,           # the ceiling of ONE storage
        "bases": 2,
        "maxBases": 2,
        "overQuota": False,
        "available": True,
        "storages": [
            {"id": "…", "label": "App data",  "usedBytes": 8_716_288, "quotaBytes": 524_288_000, "overQuota": False},
            {"id": "…", "label": "Reporting", "usedBytes": 4_096,     "quotaBytes": 524_288_000, "overQuota": False},
        ],
    },

    "sql": {},                                 # same shape as nosql
    "object": {"hostingBytes": 2_310_144},     # same shape as nosql, plus hostingBytes

    "addons": {
        "databaseGb": 0,
        "objectGb": 1,
        "renewsAt": "2026-11-02T10:14:00.000Z",
        "lapsed": False,
        "monthlyCredits": 200,
        "pricePerGb": {"database": 100, "object": 200},
    },
}

مجموع الخدمة، الميدان حسب الميدان

usedBytesinteger

كل ما تحمله الخدمة object أنه مُدرج hostingBytes.

includedBytesinteger

perBaseBytes × maxBases - ما تقدمه الخطة قبل أي إضافة

quotaBytesinteger

includedBytes بالإضافة إلى المسبح الإضافي المتاح لهذه الخدمة

perBaseBytesinteger

سقف مخزن وحيد الرقم الذي تم الحكم عليه بالكتابة

basesinteger

كم عدد المخازن الموجودة لهذه الخدمة.

maxBasesinteger

عدد ما تسمح به الخطة. bases يعني رفض واحد آخر.

overQuotaboolean

« متى المجمل » أي ما يكون المحق : quotaBytes أو أي تخزين واحد يمر بسقفه الخاص

availableboolean

ما إذا كان يمكن استخدام الخدمة الآن.

storagesarray

قيد واحد لكل مخزن: id, label, usedBytes, quotaBytes, overQuota.

ما هو العدد الذي يظهر، وما الذي يجب العمل على

الدالة الدالة الدالة الدالة الدالة الدالة الدالة الدالة الدالة الدالة الدالة الدالة الدالة الدالة الدالة na

يمكن أن يكون شريط التقدم في مجموع الخدمة عند 40% بينما يتم رفض إدخال، لأن تخزين واحد كامل. أظهر الرقم لكل مخزن حيثما كان المستخدم على وشك الكتابة، واحتفظ بالمجموع لموجز.

function roomFor(usage, storage) {
  const service = usage[storage.service];                       // "nosql" | "sql" | "object"
  const base = service.storages.find((s) => s.id === storage.id);
  return base ? Math.max(0, base.quotaBytes - base.usedBytes) : null;
}
def room_for(usage, storage):
    service = usage[storage.service]                    # "nosql" | "sql" | "object"
    base = next((s for s in service["storages"] if s["id"] == storage.id), None)
    return max(0, base["quotaBytes"] - base["usedBytes"]) if base else None

لـ سببان

It is true when the service total passes what the account has, and when a single storage passes its own ceiling — the second being the case a total can never reveal. Reading the per-storage flag tells you which.

جاريتات، على كائن فقط

ما يبقيه مضيفي الحساب على الإنترنت. يتم إخراجه من سقف الجسم قبل حساب الرقم المطابق للخزنة، IaGenify -لحساب الحساب

الـ اض// كتلة

databaseGb · objectGbinteger

Gigabytes حالياً محتجزة، حسب الإضافة.

renewsAtstring|null

عندما تنتهي الفترة، يقسم المبلغ الذي يُشتري قبل ذلك المبلغ تناسبيا.

lapsedboolean

ولم يكن من الممكن دفع مبلغ التجديد: فصندوق النقدية المشترك معلق، والسقف يعود إلى الخطة.

monthlyCreditsinteger

ما هي تكلفة إضافة إلى كل فترة، كل معا.

pricePerGbobject

{ database: 100, object: 200 } - الأرصدة الدائنة لكل غيغابايت عن كل فترة.

"مُمَا سَيُثَقَتَمَتَهُ هَيَز

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

هناك أمران يستحقان أن يفعلا بها

// 1. Before creating a storage — is one allowed at all?
const usage = await api.cloud.usage();
if (usage.nosql.bases >= usage.nosql.maxBases) {
  // api.storage.create() would answer cloud_storage_limit
}

// 2. Before a large write — will it fit?
const bytes = Buffer.byteLength(payload);
const left = usage.object.storages[0].quotaBytes - usage.object.storages[0].usedBytes;
if (bytes > left) {
  // Free something, or api.cloud.addons.buy({ service: "object", gb: 1 })
}
# 1. Before creating a storage — is one allowed at all?
usage = api.cloud.usage()
if usage["nosql"]["bases"] >= usage["nosql"]["maxBases"]:
    pass  # api.storage.create() would answer cloud_storage_limit

# 2. Before a large write — will it fit?
size = len(payload)
first = usage["object"]["storages"][0]
if size > first["quotaBytes"] - first["usedBytes"]:
    pass  # Free something, or api.cloud.addons.buy(service="object", gb=1)