导出数据 - export-v2.php

需要更新: 记录为 Excel (XLSX) 格式.

目的

iTop提供了一个通用Web服务,可以基于OQL查询导出任何数据。该服务可用于从iTop提取数据,以便与第三方工具集成。此Web服务可以返回几种格式的数据:

  • HTML

  • CSV

  • XML格式

  • 电子表格(用于导入Excel或OpenOffice的纯HTML)

  • XLSX(Excel 2007、2010、2013…)

  • PDF格式

可以通过命令行界面在iTop服务器上本地调用此服务,也可以通过HTTP请求远程调用此服务。

为了与以前的iTop版本具有100%的向后兼容性,您可以使用旧的Export data-export.php页面。

用法

命令行界面

php /var/www/itop/webservices/export-v2.php --auth_user=login --auth_pwd=password --expression=query --format=csv --fields=<list of fields separated by a comma>

远程Web访问

有几种方法可以通过Web连接远程访问服务。这是与wget命令一起使用的语法(如果 启用了 基本身份验证):

wget --http-user=login --http-password=password http://itopserver/webservices/export-v2.php?expression=query&format=csv&fields=<list of fields separated by a comma>

参数

参数描述缺省值
param_file参数文件-请参阅 Parameters file-
auth_userUser login - 仅CLI 模式-
auth_pwdUser login - 仅CLI 模式-
expressionObject Query Language Reference 查询如果'query'缺失,则必须
query存储在所谓的查询短语簿(Query Phrasebook)中的查询的标识符。请参阅 Query Phrasebook如果 'expression' 缺失,则必须
format电子表格(推荐同 MS-Excel网页查询整合), html, xml, csv or xlsxhtml
fields逗号分隔的属性列表 (例如 “name,brand,model”)。支持扩展属性代码 (例如 caller_id->org_id->code),但可能会大大降低导出速度(因为它们需要其他数据库查询)。小心使用!

<expression>指定的类的所有属性代码。那些没有本地化。

with_archive1: 导出将包括存档的对象. 0 或省略参数: 它不返回已归档的对象。0
arg_xxx如果OQL查询具有参数,则需要:参数'xxx'的值 none

与先前版本的导出的主要区别在于,输出中字段的顺序遵循 fields 参数中指定属性的顺序 。

输出

HTML

该HTML格式提供作为一个HTML表的输出,如下图所示:

https://www.itophub.io/wiki/media?media=mediawiki%3Aexport-html.png

电子表格

此格式专用于集成到电子表格中。特别是,建议将其与Excel Web查询一起使用。有关此Excel集成的更多信息,请参阅文章如何使用iTop查询创建Excel报表

特定参数的形式

使用电子表格格式时,可以使用以下附加参数:

参数名

描述

默认值
date_format用于导出日期和时间字段的格式(指定使用PHP日期和时间说明符指定)。与 GUI 中相同
formatted_text是否使用HTML标记导出富文本字段。1 =导出标记,0 =无标记。1
no_localize如果设置为0,则标头和值应以登录用户的语言进行本地化。设置为1以使用内部属性代码和值(枚举)0

XML

当以XML格式导出时,fields参数将被忽略,因为始终会检索目标类的所有字段。当对具有子类的一类对象执行查询时,字段的数量可以从集合中的一个对象变化到另一个。导出还可以包含关系,当调用时使用 linksets=1参数,如下所示。

<?xml version="1.0" encoding="UTF-8"?>
<Set>
  <Server alias="Server" id="1">
    <name>Server1</name>
    <description></description>
    <org_id>3</org_id>
    <org_id_friendlyname>Demo</org_id_friendlyname>
    <organization_name>Demo</organization_name>
    <business_criticity>low</business_criticity>
    <move2production></move2production>
    <contacts_list>
      <Set>
        <lnkContactToFunctionalCI id="1">
          <contact_id>3</contact_id>
          <contact_name>Monet</contact_name>
          <contact_id_friendlyname>Claude Monet
          </contact_id_friendlyname>
          <contact_id_finalclass_recall>Person
          </contact_id_finalclass_recall>
        </lnkContactToFunctionalCI>
      </Set>
    </contacts_list>
    <documents_list>
      <Set>
      </Set>
    </documents_list>
    <applicationsolution_list>
      <Set>
      </Set>
    </applicationsolution_list>
    <providercontracts_list>
      <Set>
      </Set>
    </providercontracts_list>
    <services_list>
      <Set>
      </Set>
    </services_list>
    <softwares_list>
      <Set>
      </Set>
    </softwares_list>
    <tickets_list>
      <Set>
      </Set>
    </tickets_list>
    <serialnumber></serialnumber>
    <location_id>1</location_id>
    <location_id_friendlyname>Bordeaux</location_id_friendlyname>
    <location_name>Bordeaux</location_name>
    <status>production</status>
    <brand_id>2</brand_id>
    <brand_id_friendlyname>HP</brand_id_friendlyname>
    <brand_name>HP</brand_name>
    <model_id>4</model_id>
    <model_id_friendlyname>DL380</model_id_friendlyname>
    <model_name>DL380</model_name>
    <asset_number></asset_number>
    <purchase_date></purchase_date>
    <end_of_warranty></end_of_warranty>
    <networkdevice_list>
      <Set>
      </Set>
    </networkdevice_list>
    <physicalinterface_list>
      <Set>
        <PhysicalInterface id="1">
          <name>eth0</name>
          <ipaddress>192.168.10.12</ipaddress>
          <macaddress>FB:0A:AF:00:12:3F:54:FF</macaddress>
          <comment></comment>
          <ipgateway>192.168.10.1</ipgateway>
          <ipmask>255.255.255.0</ipmask>
          <speed>1000.00</speed>
        </PhysicalInterface>
      </Set>
    </physicalinterface_list>
    <rack_id>0</rack_id>
    <rack_id_friendlyname></rack_id_friendlyname>
    <rack_name></rack_name>
    <enclosure_id>0</enclosure_id>
    <enclosure_id_friendlyname></enclosure_id_friendlyname>
    <enclosure_name></enclosure_name>
    <nb_u></nb_u>
    <managementip></managementip>
    <powerA_id>0</powerA_id>
    <powerA_id_friendlyname></powerA_id_friendlyname>
    <powerA_name></powerA_name>
    <powerA_id_finalclass_recall></powerA_id_finalclass_recall>
    <powerB_id>0</powerB_id>
    <powerB_id_friendlyname></powerB_id_friendlyname>
    <powerB_name></powerB_name>
    <powerB_id_finalclass_recall></powerB_id_finalclass_recall>
    <fiberinterfacelist_list>
      <Set>
      </Set>
    </fiberinterfacelist_list>
    <san_list>
      <Set>
      </Set>
    </san_list>
    <osfamily_id>6</osfamily_id>
    <osfamily_id_friendlyname>Linux</osfamily_id_friendlyname>
    <osfamily_name>Linux</osfamily_name>
    <osversion_id>8</osversion_id>
    <osversion_id_friendlyname>Unbuntu 11.10</osversion_id_friendlyname>
    <osversion_name>Unbuntu 11.10</osversion_name>
    <oslicence_id>0</oslicence_id>
    <oslicence_id_friendlyname></oslicence_id_friendlyname>
    <oslicence_name></oslicence_name>
    <cpu></cpu>
    <ram></ram>
    <logicalvolumes_list>
      <Set>
      </Set>
    </logicalvolumes_list>
  </Server>
  <Server alias="Server" id="2">
    <name>Server2</name>
    <description></description>
    <org_id>3</org_id>
    <org_id_friendlyname>Demo</org_id_friendlyname>
    <organization_name>Demo</organization_name>
    <business_criticity>low</business_criticity>
    <move2production></move2production>
    <contacts_list>
      <Set>
      </Set>
    </contacts_list>
    <documents_list>
      <Set>
      </Set>
    </documents_list>
    <applicationsolution_list>
      <Set>
      </Set>
    </applicationsolution_list>
    <providercontracts_list>
      <Set>
      </Set>
    </providercontracts_list>
    <services_list>
      <Set>
      </Set>
    </services_list>
    <softwares_list>
      <Set>
        <DBServer id="7">
          <name>Oracle</name>
          <description></description>
          <org_id>3</org_id>
          <organization_name>Demo</organization_name>
          <business_criticity>low</business_criticity>
          <move2production></move2production>
          <software_id>1</software_id>
          <software_name>MySql</software_name>
          <softwarelicence_id>0</softwarelicence_id>
          <softwarelicence_name></softwarelicence_name>
          <path></path>
          <status></status>
          <finalclass>DB Server</finalclass>
          <org_id_friendlyname>Demo</org_id_friendlyname>
          <software_id_friendlyname>MySql 5.3</software_id_friendlyname>
          <softwarelicence_id_friendlyname></softwarelicence_id_friendlyname>
        </DBServer>
      </Set>
    </softwares_list>
    <tickets_list>
      <Set>
      </Set>
    </tickets_list>
    <serialnumber></serialnumber>
    <location_id>2</location_id>
    <location_id_friendlyname>Grenoble</location_id_friendlyname>
    <location_name>Grenoble</location_name>
    <status>production</status>
    <brand_id>0</brand_id>
    <brand_id_friendlyname></brand_id_friendlyname>
    <brand_name></brand_name>
    <model_id>0</model_id>
    <model_id_friendlyname></model_id_friendlyname>
    <model_name></model_name>
    <asset_number></asset_number>
    <purchase_date></purchase_date>
    <end_of_warranty></end_of_warranty>
    <networkdevice_list>
      <Set>
      </Set>
    </networkdevice_list>
    <physicalinterface_list>
      <Set>
      </Set>
    </physicalinterface_list>
    <rack_id>0</rack_id>
    <rack_id_friendlyname></rack_id_friendlyname>
    <rack_name></rack_name>
    <enclosure_id>0</enclosure_id>
    <enclosure_id_friendlyname></enclosure_id_friendlyname>
    <enclosure_name></enclosure_name>
    <nb_u></nb_u>
    <managementip></managementip>
    <powerA_id>0</powerA_id>
    <powerA_id_friendlyname></powerA_id_friendlyname>
    <powerA_name></powerA_name>
    <powerA_id_finalclass_recall></powerA_id_finalclass_recall>
    <powerB_id>0</powerB_id>
    <powerB_id_friendlyname></powerB_id_friendlyname>
    <powerB_name></powerB_name>
    <powerB_id_finalclass_recall></powerB_id_finalclass_recall>
    <fiberinterfacelist_list>
      <Set>
      </Set>
    </fiberinterfacelist_list>
    <san_list>
      <Set>
      </Set>
    </san_list>
    <osfamily_id>0</osfamily_id>
    <osfamily_id_friendlyname></osfamily_id_friendlyname>
    <osfamily_name></osfamily_name>
    <osversion_id>0</osversion_id>
    <osversion_id_friendlyname></osversion_id_friendlyname>
    <osversion_name></osversion_name>
    <oslicence_id>0</oslicence_id>
    <oslicence_id_friendlyname></oslicence_id_friendlyname>
    <oslicence_name></oslicence_name>
    <cpu></cpu>
    <ram></ram>
    <logicalvolumes_list>
      <Set>
      </Set>
    </logicalvolumes_list>
  </Server>
</Set>

特定参数的形式

使用XML格式时,可以使用以下附加参数:

参数名描述缺省值
linksets设置为1可以检索到相关对象的链接(一对多或多对多关系)。0表示仅对象的“标量”值。0
no_localize如果设置为0,则标头和值应以登录用户的语言进行本地化。设置为1以使用内部属性代码和值(枚举).0

CSV

CSV格式产生的输出示例:

id,Name,Management IP
1,"dbserver1.demo.com","10.1.1.10"
6,"webserver.demo.com","10.1.1.20"

特定参数的形式

使用CSV格式时,可以使用以下附加参数:

参数名描述缺省值
charset用于对输出进行编码的字符集。UTF-8
date_format用于导出日期和时间字段的格式(使用PHP日期和时间说明符指定)。与 GUI 中相同
formatted_text是否使用HTML标记导出富文本字段。1 =导出标记,0 =无标记。0
no_localize如果设置为0,则标头和值应以登录用户的语言进行本地化。设置为1以使用内部属性代码和值(枚举)0
separator用作输出中字段之间分隔符的字符, (逗号)
text-qualifier文本字符串周围要使用的字符" (双引号)

PDF

这种格式会生成一个PDF文档,其中包含一张包含所需数据的大表。注意:表格的自动布局使所有列的宽度相同。因此,它最适合于少量(<10)的列。要容纳更多列,请使用纵向页面的方向。

特定参数的形式

使用PDF格式时,可以使用以下附加参数:

Parameter nameDescriptionDefault value
date_format用于导出日期和时间字段的格式(使用PHP日期和时间说明符)。同 GUI相同
page_size用于布局的页面纸张尺寸。可能的值: A3, A4 or LetterA4
page_orientation版面页面纸张的方向。可能的值:横向或纵向纵向

XLSX

特定参数的形式

使用XLSX格式时,可以使用以下附加参数:

Parameter nameDescriptionDefault value
date_format用于导出日期和时间字段的格式(使用PHP日期和时间说明符)。同 GUI相同
formatted_text是否使用HTML标记导出富文本字段。1 =导出标记,0 =无标记。0

允许的用户

Portal users 不允许访问此服务,因为此概要文件不包含安全性,安全性由门户网站自行完成。

用户必须有对指定对象类具有批量读取权限。在标准iTOP的数据模型,所有用户对所有类都有读和批量读的权利。

历史

  • 0.9 此功能的首次实现

  • 1.2.1 添加了参数“查询”,以替代“表达式”。

  • 1.2.1 添加了“电子表格”格式,该格式可拆分日期和时间列。

  • 1.2.1 修复了HTTPS和MS-IIS的停止问题(Trac: #485).

  • 分支1.2.1电子表格格式:修复了带时间的问题 (Trac: #541). 解决方法是使用XML格式(XCel支持此格式)

  • 2.0: 添加了标记no_localize

  • 2.1.0: 添加了XLSX格式

  • 2.2.0: 通过创建新export-v2.php页面重新设计导出

原贴链接:https://www.itophub.io/wiki/page?id=2_7_0%3Aadvancedtopics%3Aexportdata


Export data - export-v2.php

To Be Updated: document the Excel (XLSX) format.

Purpose

iTop provides a generic web service to export whatever data based on an OQL query. This service can be used to extract data from iTop in order to integrate with third party tools. This web service can return data in several formats:

  • HTML

  • CSV

  • XML

  • Spreadsheet (plain HTML for importing into Excel or OpenOffice)

  • XLSX (Excel 2007, 2010, 2013…)

  • PDF

This service can be called locally on the iTop server via the command line interface, or remotely via an HTTP request.

For 100% backward compatibility with previous versions of iTop, you can use the old Export data - export.php page.

Usage

Command line interface

php /var/www/itop/webservices/export-v2.php --auth_user=login --auth_pwd=password --expression=query --format=csv --fields=<list of fields separated by a comma>

Remote web access

There are several ways to access the service remotely via a web connection. Here is the syntax to use with the wget command (if the Basic Authentication is enabled):

wget --http-user=login --http-password=password http://itopserver/webservices/export-v2.php?expression=query&format=csv&fields=<list of fields separated by a comma>

Arguments

ArgumentDescriptionDefaut value
param_fileParameters file - see Parameters file-
auth_userUser login - CLI mode only-
auth_pwdUser password - CLI mode only-
expressionObject Query Language Reference queryMandatory if 'query' is missing
queryIdentifier of a query stored in the so-called query phrasebook. See Query PhrasebookMandatory if 'expression' is missing
formatspreadsheet (recommended for integration with MS-Excel web queries), html, xml, csv or xlsxhtml
fieldscoma separated list of attributes (e.g. “name,brand,model”). Extended attribute codes (e.g. caller_id->org_id->code) are supported but may significantly slow down the export (since they require additional database queries). Use with care!All the attributes code of the class specified by <expression>. Those one are not localized
with_archive1: the export will include archived objects. 0 or if argument omitted: it does not return archived objects0
arg_xxxNeeded if the OQL query has parameters: the value of the parameter 'xxx'none

One major difference with the previous version of the export is that the order of the fields in the output follows the order in which the attributes are specified in the fields parameter.

Output

HTML

The HTML format provides the output as an HTML table, as shown below:

https://www.itophub.io/wiki/media?media=mediawiki%3Aexport-html.png

Spreadsheet

This format is dedicated to the integration into spreadsheets. In particular, it is the recommended method to use with Excel web queries. Refer to the article How to create an Excel report using iTop queries for more information about this Excel integration.

Format specific parameters

When using the Spreadsheet format, the following additional parameters are available:

Parameter nameDescriptionDefault value
date_formatThe format to use for exporting date and time fields (specified using PHP date & time specifiers).Same as in the GUI
formatted_textWhether or not to export rich text fields with their HTML markup. 1 = export the markup, 0 = no markup.1
no_localizeIf set to 0, then header and values are supposed to be localized in the language of the logged in user. Set to 1 to use internal attribute codes and values (enums)0

XML

The fields parameter is ignored when exporting in XML format, since all fields of the target class(es) are always retrieved. The number of fields can vary from one object in the set to another when the query is performed on a class of objects which has subclasses. The export can also include the relations when called with the parameter linksets=1, as shown below.

<?xml version="1.0" encoding="UTF-8"?>
<Set>
  <Server alias="Server" id="1">
    <name>Server1</name>
    <description></description>
    <org_id>3</org_id>
    <org_id_friendlyname>Demo</org_id_friendlyname>
    <organization_name>Demo</organization_name>
    <business_criticity>low</business_criticity>
    <move2production></move2production>
    <contacts_list>
      <Set>
        <lnkContactToFunctionalCI id="1">
          <contact_id>3</contact_id>
          <contact_name>Monet</contact_name>
          <contact_id_friendlyname>Claude Monet
          </contact_id_friendlyname>
          <contact_id_finalclass_recall>Person
          </contact_id_finalclass_recall>
        </lnkContactToFunctionalCI>
      </Set>
    </contacts_list>
    <documents_list>
      <Set>
      </Set>
    </documents_list>
    <applicationsolution_list>
      <Set>
      </Set>
    </applicationsolution_list>
    <providercontracts_list>
      <Set>
      </Set>
    </providercontracts_list>
    <services_list>
      <Set>
      </Set>
    </services_list>
    <softwares_list>
      <Set>
      </Set>
    </softwares_list>
    <tickets_list>
      <Set>
      </Set>
    </tickets_list>
    <serialnumber></serialnumber>
    <location_id>1</location_id>
    <location_id_friendlyname>Bordeaux</location_id_friendlyname>
    <location_name>Bordeaux</location_name>
    <status>production</status>
    <brand_id>2</brand_id>
    <brand_id_friendlyname>HP</brand_id_friendlyname>
    <brand_name>HP</brand_name>
    <model_id>4</model_id>
    <model_id_friendlyname>DL380</model_id_friendlyname>
    <model_name>DL380</model_name>
    <asset_number></asset_number>
    <purchase_date></purchase_date>
    <end_of_warranty></end_of_warranty>
    <networkdevice_list>
      <Set>
      </Set>
    </networkdevice_list>
    <physicalinterface_list>
      <Set>
        <PhysicalInterface id="1">
          <name>eth0</name>
          <ipaddress>192.168.10.12</ipaddress>
          <macaddress>FB:0A:AF:00:12:3F:54:FF</macaddress>
          <comment></comment>
          <ipgateway>192.168.10.1</ipgateway>
          <ipmask>255.255.255.0</ipmask>
          <speed>1000.00</speed>
        </PhysicalInterface>
      </Set>
    </physicalinterface_list>
    <rack_id>0</rack_id>
    <rack_id_friendlyname></rack_id_friendlyname>
    <rack_name></rack_name>
    <enclosure_id>0</enclosure_id>
    <enclosure_id_friendlyname></enclosure_id_friendlyname>
    <enclosure_name></enclosure_name>
    <nb_u></nb_u>
    <managementip></managementip>
    <powerA_id>0</powerA_id>
    <powerA_id_friendlyname></powerA_id_friendlyname>
    <powerA_name></powerA_name>
    <powerA_id_finalclass_recall></powerA_id_finalclass_recall>
    <powerB_id>0</powerB_id>
    <powerB_id_friendlyname></powerB_id_friendlyname>
    <powerB_name></powerB_name>
    <powerB_id_finalclass_recall></powerB_id_finalclass_recall>
    <fiberinterfacelist_list>
      <Set>
      </Set>
    </fiberinterfacelist_list>
    <san_list>
      <Set>
      </Set>
    </san_list>
    <osfamily_id>6</osfamily_id>
    <osfamily_id_friendlyname>Linux</osfamily_id_friendlyname>
    <osfamily_name>Linux</osfamily_name>
    <osversion_id>8</osversion_id>
    <osversion_id_friendlyname>Unbuntu 11.10</osversion_id_friendlyname>
    <osversion_name>Unbuntu 11.10</osversion_name>
    <oslicence_id>0</oslicence_id>
    <oslicence_id_friendlyname></oslicence_id_friendlyname>
    <oslicence_name></oslicence_name>
    <cpu></cpu>
    <ram></ram>
    <logicalvolumes_list>
      <Set>
      </Set>
    </logicalvolumes_list>
  </Server>
  <Server alias="Server" id="2">
    <name>Server2</name>
    <description></description>
    <org_id>3</org_id>
    <org_id_friendlyname>Demo</org_id_friendlyname>
    <organization_name>Demo</organization_name>
    <business_criticity>low</business_criticity>
    <move2production></move2production>
    <contacts_list>
      <Set>
      </Set>
    </contacts_list>
    <documents_list>
      <Set>
      </Set>
    </documents_list>
    <applicationsolution_list>
      <Set>
      </Set>
    </applicationsolution_list>
    <providercontracts_list>
      <Set>
      </Set>
    </providercontracts_list>
    <services_list>
      <Set>
      </Set>
    </services_list>
    <softwares_list>
      <Set>
        <DBServer id="7">
          <name>Oracle</name>
          <description></description>
          <org_id>3</org_id>
          <organization_name>Demo</organization_name>
          <business_criticity>low</business_criticity>
          <move2production></move2production>
          <software_id>1</software_id>
          <software_name>MySql</software_name>
          <softwarelicence_id>0</softwarelicence_id>
          <softwarelicence_name></softwarelicence_name>
          <path></path>
          <status></status>
          <finalclass>DB Server</finalclass>
          <org_id_friendlyname>Demo</org_id_friendlyname>
          <software_id_friendlyname>MySql 5.3</software_id_friendlyname>
          <softwarelicence_id_friendlyname></softwarelicence_id_friendlyname>
        </DBServer>
      </Set>
    </softwares_list>
    <tickets_list>
      <Set>
      </Set>
    </tickets_list>
    <serialnumber></serialnumber>
    <location_id>2</location_id>
    <location_id_friendlyname>Grenoble</location_id_friendlyname>
    <location_name>Grenoble</location_name>
    <status>production</status>
    <brand_id>0</brand_id>
    <brand_id_friendlyname></brand_id_friendlyname>
    <brand_name></brand_name>
    <model_id>0</model_id>
    <model_id_friendlyname></model_id_friendlyname>
    <model_name></model_name>
    <asset_number></asset_number>
    <purchase_date></purchase_date>
    <end_of_warranty></end_of_warranty>
    <networkdevice_list>
      <Set>
      </Set>
    </networkdevice_list>
    <physicalinterface_list>
      <Set>
      </Set>
    </physicalinterface_list>
    <rack_id>0</rack_id>
    <rack_id_friendlyname></rack_id_friendlyname>
    <rack_name></rack_name>
    <enclosure_id>0</enclosure_id>
    <enclosure_id_friendlyname></enclosure_id_friendlyname>
    <enclosure_name></enclosure_name>
    <nb_u></nb_u>
    <managementip></managementip>
    <powerA_id>0</powerA_id>
    <powerA_id_friendlyname></powerA_id_friendlyname>
    <powerA_name></powerA_name>
    <powerA_id_finalclass_recall></powerA_id_finalclass_recall>
    <powerB_id>0</powerB_id>
    <powerB_id_friendlyname></powerB_id_friendlyname>
    <powerB_name></powerB_name>
    <powerB_id_finalclass_recall></powerB_id_finalclass_recall>
    <fiberinterfacelist_list>
      <Set>
      </Set>
    </fiberinterfacelist_list>
    <san_list>
      <Set>
      </Set>
    </san_list>
    <osfamily_id>0</osfamily_id>
    <osfamily_id_friendlyname></osfamily_id_friendlyname>
    <osfamily_name></osfamily_name>
    <osversion_id>0</osversion_id>
    <osversion_id_friendlyname></osversion_id_friendlyname>
    <osversion_name></osversion_name>
    <oslicence_id>0</oslicence_id>
    <oslicence_id_friendlyname></oslicence_id_friendlyname>
    <oslicence_name></oslicence_name>
    <cpu></cpu>
    <ram></ram>
    <logicalvolumes_list>
      <Set>
      </Set>
    </logicalvolumes_list>
  </Server>
</Set>

Format specific parameters

When using the XML format, the following additional parameters are available:

Parameter nameDescriptionDefault value
linksetsSet to 1 to retrieve links to related objects (1-Many or Many-Many relations). 0 means only “scalar” values of the object.0
no_localizeIf set to 0, then header and values are supposed to be localized in the language of the logged in user. Set to 1 to use internal attribute codes and values (enums)0

CSV

Example of output produced by the CSV format:

id,Name,Management IP
1,"dbserver1.demo.com","10.1.1.10"
6,"webserver.demo.com","10.1.1.20"

Format specific parameters

When using the CSV format, the following additional parameters are available:

Parameter nameDescriptionDefault value
charsetThe character set to be used for encoding the output.UTF-8
date_formatThe format to use for exporting date and time fields (specified using PHP date & time specifiers).Same as in the GUI
formatted_textWhether or not to export rich text fields with their HTML markup. 1 = export the markup, 0 = no markup.0
no_localizeIf set to 0, then header and values are supposed to be localized in the language of the logged in user. Set to 1 to use internal attribute codes and values (enums)0
separatorThe character to be used as the separator between fields in the output, (comma)
text-qualifierThe character to be used around text strings" (double quotes)

PDF

This format produces a PDF document, containing one big table with the requested data. Note: the automatic layout of the table makes all columns the same width. Therefore it is best suited for a small (<10) number of columns. To fit a larger number of columns, use the Portrait orientation of the page.

Format specific parameters

When using the PDF format, the following additional parameters are available:

Parameter nameDescriptionDefault value
date_formatThe format to use for exporting date and time fields (specified using PHP date & time specifiers).Same as in the GUI
page_sizeThe page's paper size to use for the layout. Possible values: A3, A4 or LetterA4
page_orientationThe orientation of the page's paper for the layout. Possible values: Landscape or PortraitPortrait

XLSX

Format specific parameters

When using the XLSX format, the following additional parameters are available:

Parameter nameDescriptionDefault value
date_formatThe format to use for exporting date and time fields (specified using PHP date & time specifiers).Same as in the GUI
formatted_textWhether or not to export rich text fields with their HTML markup. 1 = export the markup, 0 = no markup.0

Allowed users

Portal users are not allowed to access this service, as this profile has no security included, security being done by the Portal it-self.

The users must have the bulk read privilege on the specified class of object. In the standard iTop data model, all users have read and bulk read rights on all classes.

History

  • 0.9 First implementation of this feature

  • 1.2.1 Added the argument 'query', as an alternative to 'expression'.

  • 1.2.1 Added the format 'spreadsheet', which splits date and time columns.

  • 1.2.1 Fixed stopper issues with HTTPS and MS-IIS (Trac: #485).

  • 1.2.1 The parameter file can be specified as an argument (the documentation was wrong: it was not actually implemented).

  • Branch 1.2.1 Spreadsheet format: fixed issue with times (Trac: #541). The workaround is to use the XML format (XCel does support this)

  • 2.0: added the flag no_localize

  • 2.1.0: added the XLSX format

  • 2.2.0: redesign of the export by creating the new export-v2.php page

标签:
由 superadmin 在 2020/08/27, 16:20 创建
    

需要帮助?

如果您需要有关XWiki的帮助,可以联系:

深圳市艾拓先锋企业管理咨询有限公司