# الأجهزة كوحدات تخزين

Canonical URL: https://developers.iagenify.com/ar/sdk/concepts/machines-are-storages/
Language: ar

الـ آلة تشغيل SDK هذا ما يعطي وكيلاً مكان ما للعمل، ولهذا السبب ملفاته لا تترك الآلة أبداً.

Status: registered on first call · files stay local

## الفكرة {#idea}

فَٱلْمَوْضُوعُ لِلْمَحَبَّةِ يَتَعَلَّمُ مِنْ مَسْؤُولِيَّةِ ٱلْمَسِيحِيَّةِ ٱلْمُتَوَقِّعَةِ .

| Kind | حيث تكون بياناته | عدد الذين تم |
| --- | --- | --- |
| computer | على تلك الالة ، ~/.iagenify/files | storage.files |
| (أ) لا توجد بيانات عن هذا البند. | في ذلك المتصفح | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| IaGenify سحاب | تم إدارتها لك | storage.run() |
| قاعدة بيانات أو دلو | مع مقدم تأمينك | storage.run() |

## كيف يمكن لآلة أن تصل {#registering}

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

```javascript
const pc = await api.storage.get();   // this machine

pc.id;
pc.type;        // "filesystem"
pc.hostname;
pc.isDefault;

await api.storage.list();             // every storage on the account
```

## لماذا يحتفظ الحاسوب بملفاته {#local}

لا يحمل تخزين حاسوب أي بايتات على الخادم، ويتم إنفاذ ذلك بدلاً من مجرد القصد: `storage_is_local`عميل يعمل هناك يقرأ ويكتب من خلال الآلة نفسها

```javascript
// Refused — a computer is not a destination for an upload
await api.files.create({ name: "notes.md", content }).save({ localOnly: false });
// IaGenifyError: storage_is_local

// This is the way: the file is written on the machine
await pc.files.write("notes.md", content);
```

## الـ افتراضي {#default}

فَهُوَ يَعْتَبِرُ ٱلْكِتَابُ ٱلْمُقَدَّسُ عَنْ عَوَاقِبِ ٱلْحَقِّ ٱلْمُقَدَّسَةِ لِذٰلِكَ ٱلْحَقِّ ، لِأَنَّهُ لَا يَسْتَطِيعُ أَنْ يَسْتَقِيمَهُمْ .

```javascript
await api.getStorage();              // the default
await api.storage.remove(id);        // allowed even for the default
                                     // another storage inherits the flag
```

- [api.storage](/ar/sdk/ref/storage): الاتصال، الإدراج، الإنشاء و الإزالة
- [الملفات](/ar/sdk/runtimes/browser): منح وكيل عمليات ملف حيث لا يوجد قرص.

```python
pc = api.storage.get()   # this machine

pc.id
pc.type          # "filesystem"
pc.machine_id
pc.is_default

api.storage.list()       # every storage on the account
```

```python
# Refused — a computer is not a destination for an upload
api.files.create(name="notes.md", content=content).save(local_only=False)
# IaGenifyError: storage_is_local

# This is the way: the file is written on the machine
pc.files.write("notes.md", content)
```

```python
api.get_storage()             # the default
api.storage.remove(storage_id)  # allowed even for the default:
                                # another storage inherits the flag
```
