Esta é uma tradução da página de documentação original em inglês. Ajude-nos a torná-la melhor.

configuration.export

Description

string configuration.export(object parameters)

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

Parameters

(object) Parameters defining the objects to be exported and the format to use.

Parameter Type Description
format
(required)
string Format in which the data must be exported.

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

The options object has the following parameters:
groups - (array) 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;
mediaTypes - (array) IDs of media types 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

(string) Returns a serialized string containing the requested configuration data.

Examples

Exporting a host

Export the configuration of a host as an XML string.

Request:

{
           "jsonrpc": "2.0",
           "method": "configuration.export",
           "params": {
               "options": {
                   "hosts": [
                       "10161"
                   ]
               },
               "format": "xml"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<zabbix_export><version>5.0</version><date>2020-03-13T15:31:45Z</date><groups><group><name>Zabbix servers</name></group></groups><hosts><host><host>Export host</host><name>Export host</name><groups><group><name>Zabbix servers</name></group></groups><interfaces><interface><interface_ref>if1</interface_ref></interface></interfaces><applications><application><name>Application</name></application></applications><items><item><name>Item</name><key>item.key</key><delay>30s</delay><applications><application><name>Application</name></application></applications><valuemap><name>Host status</name></valuemap><interface_ref>if1</interface_ref><request_method>POST</request_method></item></items></host></hosts><value_maps><value_map><name>Host status</name><mappings><mapping><value>0</value><newvalue>Up</newvalue></mapping><mapping><value>2</value><newvalue>Unreachable</newvalue></mapping></mappings></value_map></value_maps></zabbix_export>\n",
           "id": 1
       }

Source

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