# usage()

Canonical URL: https://developers.iagenify.com/ar/sdk/ref/hosts/usage/
Language: ar

`api.hosts.usage() → Promise<Usage>`

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

Status: free · read the zero · quota is the object storage

```javascript
const usage = await api.hosts.usage();

if (!usage.maxHosts) {
  // This plan has no hosting. Show the limit, with a link to the plans.
}
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `pack` | string |  | أي خطة |
| `hosts · maxHosts` | integer |  | كم عدد الموجودين، وكم عدد الخطط المسموح بها |
| `usedBytes` | integer |  | ما يبقيه المضيفون على الإنترنت |
| `quotaBytes` | integer |  | **الحساب هو هدف من حصص التخزين** |

## اقر {#zero}

> **مُخ ماكس: 0 يعني أن الخطة ليس لديها مُضيف**
>
> نفس شكل ماكس مايلبوكس: صفر للبريد. اقرأ الرقم بدلا من المطابقة على اسم الخطة -- اليوم الذي تتغير فيه الخطط، الصفحة التي تطابق هي التي تقع.

## النصيب الـ ليس a بدل استضافة {#quota}

وهو مخزن أغراض الحساب - الذي يتقاسمه مع الملفات وصناديق البريد وكل شيء آخر يحتفظ به للحساب. [cloud.usage()](/ar/sdk/ref/cloud/usage) هذا العدد نفسه من الضلع الآخر، مع `object.hostingBytes` ما مقدار ما يستضيفه منه

## عرض {#ui}

```javascript
const u = await api.hosts.usage();

if (!u.maxHosts)             return showPlanLimit();
if (u.hosts >= u.maxHosts)   return showAtLimit();
return showCreateButton();
```

- [cloud.usage()](/ar/sdk/ref/cloud/usage): المخزن الذي خلفها
- [host.usage()](/ar/sdk/ref/host/usage): واحد من المضيفات في التفاصيل.

```python
usage = api.hosts.usage()

if not usage["maxHosts"]:
    pass  # This plan has no hosting. Show the limit, with a link to the plans.
```

```python
def hosting_screen():
    u = api.hosts.usage()
    if not u["maxHosts"]:
        return show_plan_limit()
    if u["hosts"] >= u["maxHosts"]:
        return show_at_limit()
    return show_create_button()
```
