此方法允许将配置数据导出并序列化为字符串。

    参数

    (object) 参数定义了导出的对象以及使用的格式。

    返回值

    (string) 返回一个包含请求配置数据的序列化字符串

    导出一个主机

    导出一个 XML 字符串的主机配置。

    响应:

    来源

    CConfiguration::export() in frontends/php/include/classes/api/services/CConfiguration.php.

    Description

    string configuration.export(object **parameters**)

    This method allows to export configuration data as a serialized string.

    ParameterTypeDescription
    format
    (required)
    stringFormat in which the data must be exported.

    Possible values:
    json - JSON;
    xml - XML.
    options
    (required)
    objectObjects to be exported.

    The options object has the following parameters:
    groups - IDs of host groups to export;
    hosts - (array) IDs of hosts to export;
    images - (array) IDs of images to export;
    maps - (array) IDs of maps to export.
    screens - (array) IDs of screens to export;
    templates - (array) IDs of templates to export;
    valueMaps - (array) IDs of value maps to export;

    Return values

    Returns a serialized string containing the requested configuration data.

    Examples

    Exporting a host

    Export the configuration of a host as an XML string.

    Request:

    Response: