[comment]: # ({2898fc4b-2898fc4b})
# hostinterface.replacehostinterfaces

[comment]: # ({/2898fc4b-2898fc4b})

[comment]: # ({f14e7778-f14e7778})
### תיאור

`object hostinterface.replacehostinterfaces(אובייקט פרמטרים)`

שיטה זו מאפשרת להחליף את כל ממשקי המארח במארח נתון.

::: noteclassic
שיטה זו זמינה רק ל-*Admin* ו-*Super Admin*
סוגי משתמשים. ניתן לבטל הרשאות לקרוא לשיטה בתפקיד משתמש
הגדרות. ראה [משתמש
תפקידים](/manual/web_interface/frontend_sections/administration/user_roles)
למידע נוסף.
:::

[comment]: # ({/f14e7778-f14e7778})

[comment]: # ({5ad866d6-f5cf0b40})
### פרמטרים

`(object)` פרמטרים המכילים את המזהה של המארח שיש לעדכן ו
ממשקי המארח החדשים.

|פרמטר|[סוג](/manual/api/reference_commentary#data_types)|תיאור|
|--|--|------|
|**hostid**<br>(נדרש)|string|מזהה המארח שיש לעדכן.|
|**ממשקים**<br>(נדרש)|object/array|[ממשקי מארח](/manual/api/reference/hostinterface/object) להחלפת ממשקי המארח הנוכחיים ב.|

[comment]: # ({/5ad866d6-f5cf0b40})

[comment]: # ({88283807-88283807})
### החזר ערכים

`(object)` מחזירה אובייקט המכיל את המזהים של המארח שנוצר
ממשקים תחת המאפיין 'interfaceids'.

[comment]: # ({/88283807-88283807})

[comment]: # ({b41637d2-b41637d2})
### דוגמאות

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({7bb6e122-98e67db1})
#### החלפת ממשקי מארח

החלף את כל ממשקי המארח בממשק סוכן יחיד.

בַּקָשָׁה:

``` json
{
     "jsonrpc": "2.0",
     "method": "hostinterface.replacehostinterfaces",
     "params": {
         "hostid": "30052",
         "ממשקים": {
             "dns": "",
             "ip": "127.0.0.1",
             "ראשי": 1,
             "port": "10050",
             "סוג 1,
             "useip": 1
         }
     },
     "auth": "038e1d7b1735c6a5436ee9eae095879e",
     "מזהה": 1
}
```

תְגוּבָה:

``` json
{
     "jsonrpc": "2.0",
     "תוצאה": {
         "interfaceids": [
             "30081"
         ]
     },
     "מזהה": 1
}
```

[comment]: # ({/7bb6e122-98e67db1})

[comment]: # ({272c42ef-272c42ef})
### ראה גם

- [host.update](/manual/api/reference/host/update)
- [host.massupdate](/manual/api/reference/host/massupdate)

[comment]: # ({/272c42ef-272c42ef})

[comment]: # ({9d1e0b55-9d1e0b55})
### מקור

CHostInterface::replaceHostInterfaces()‎ בתוך
*ui/include/classes/api/services/CHostInterface.php*.

[comment]: # ({/9d1e0b55-9d1e0b55})
