Você está na página 1de 236

BMC Atrium Core 7.6.

03

Developers Reference Guide

August 2010

www.bmc.com

Contacting BMC Software


You can access the BMC Software website at http://www.bmc.com. From this website, you can obtain information
about the company, its products, corporate offices, special events, and career opportunities.

United States and Canada


Address

BMC SOFTWARE INC


2101 CITYWEST BLVD
HOUSTON TX 77042-2827
USA

Telephone

713 918 8800 or


800 841 2031

Fax

(01) 713 918 8000

Fax

713 918 8000

Outside United States and Canada


Telephone

(01) 713 918 8800

If you have comments or suggestions about this documentation, contact Information Design and Development by email at
doc_feedback@bmc.com.

Copyright 20062007, 2009-2010 BMC Software, Inc.


BMC, BMC Software, and the BMC Software logo are the exclusive properties of BMC Software, Inc., are registered with the U.S. Patent
and Trademark Office, and may be registered or pending registration in other countries. All other BMC trademarks, service marks, and
logos may be registered or pending registration in the U.S. or in other countries. All other trademarks or registered trademarks are the
property of their respective owners.
AIX and IBM are registered trademarks of International Business Machines Corporation in the United States, other countries, or both.
IT Infrastructure Library is a registered trademark of the Office of Government Commerce and is used here by BMC Software, Inc.,
under license from and with the permission of OGC.
ITIL is a registered trademark, and a registered community trademark of the Office of Government Commerce, and is registered in the
U.S. Patent and Trademark Office, and is used here by BMC Software, Inc., under license from and with the permission of OGC.
J2SE, Java, Javadoc, JSP, Solaris, and Sun are trademarks of Sun Microsystems, Inc., in the U.S. and other countries.
Linux is the registered trademark of Linus Torvalds.
UNIX is the registered trademark of The Open Group in the US and other countries.
The information included in this documentation is the proprietary and confidential information of BMC Software, Inc., its affiliates, or
licensors. Your use of this information is subject to the terms and conditions of the applicable End User License agreement for the product
and to the proprietary and restricted rights notices included in the product documentation.

Restricted rights legend


U.S. Government Restricted Rights to Computer Software. UNPUBLISHED -- RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
THE UNITED STATES. Use, duplication, or disclosure of any data and computer software by the U.S. Government is subject to
restrictions, as applicable, set forth in FAR Section 52.227-14, DFARS 252.227-7013, DFARS 252.227-7014, DFARS 252.227-7015, and
DFARS 252.227-7025, as amended from time to time. Contractor/Manufacturer is BMC Software, Inc., 2101 CityWest Blvd., Houston, TX
77042-2827, USA. Any contract notices should be sent to this address.

Customer Support
You can obtain technical support by using the Support page on the BMC Software website or by contacting Customer
Support by telephone or email. To expedite your inquiry, please see Before Contacting BMC Software.

Support website
You can obtain technical support from BMC Software 24 hours a day, 7 days a week at
http://www.bmc.com/support. From this website, you can:

Read overviews about support services and programs that BMC Software offers.
Find the most current information about BMC Software products.
Search a database for problems similar to yours and possible solutions.
Order or download product documentation.
Report a problem or ask a question.
Subscribe to receive email notices when new product versions are released.
Find worldwide BMC Software support center locations and contact information, including email addresses, fax
numbers, and telephone numbers.

Support by telephone or email


In the United States and Canada, if you need technical support and do not have access to the Web, call 800 537 1813 or
send an email message to customer_support@bmc.com. (In the Subject line, enter
SupID:yourSupportContractID, such as SupID:12345.) Outside the United States and Canada, contact your
local support center for assistance.

Before contacting BMC Software


Have the following information available so that Customer Support can begin working on your issue immediately:

Product information

Product name
Product version (release number)
License number and password (trial or permanent)

Operating system and environment information

Machine type
Operating system type, version, and service pack
System hardware configuration
Serial numbers
Related software (database, application, and communication) including type, version, and service pack or
maintenance level

Sequence of events leading to the problem

Commands and options that you used

Messages received (and the time and date that you received them)
Product error messages
Messages from the operating system, such as file system full
Messages from related software

License key and password information


If you have a question about your license key or password, contact Customer Support through one of the following
methods:

E-mail customer_support@bmc.com. (In the Subject line, enter SupID:yourSupportContractID, such


as SupID:12345.)

In the United States and Canada, call 800 537 1813. Outside the United States and Canada, contact your local support
center for assistance.

Submit a new issue at http://www.bmc.com/support.

Contents
BMC Atrium Core documentation

13

Chapter 1

17

Introduction to the BMC Atrium Core APIs

BMC Atrium CMDB API architecture overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


BMC Atrium CMDB C API features and components . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium CMDB Java API package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium Core web services API overview . . . . . . . . . . . . . . . . . . . . . . . . . . . .
API version requirements for BMC Atrium CMDB client-server connections. . . . . .
Comparison between BMC Atrium CMDB API programming and using the BMC
Atrium Core Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
When to use the BMC Atrium CMDB API and the BMC Atrium Core Console .
BMC Atrium Core Console and BMC Atrium CMDB API terminology . . . . . . .

22
22
23

Chapter 2

25

Getting started

BMC Atrium CMDB API compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


BMC Atrium CMDB C API requirements and package contents. . . . . . . . . . . . . . . . .
BMC Atrium CMDB C API requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium CMDB C API header files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium CMDB C API library files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compiler preparation for the BMC Atrium CMDB C API . . . . . . . . . . . . . . . . . . .
Libraries for linking to BMC Atrium CMDB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium CMDB Java API requirements and package contents . . . . . . . . . . . . . .
BMC Atrium CMDB Java API requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium CMDB Java API library files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium CMDB Java API header files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium CMDB Java API configuration file . . . . . . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium Core Web Services API components . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium Core Web Services Infrastructure overview . . . . . . . . . . . . . . . . . . .
BMC Atrium Core Web Services Registry overview . . . . . . . . . . . . . . . . . . . . . . . .
The cmdbdriver program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cmdbdriver command line options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Commands that record your cmdbdriver commands . . . . . . . . . . . . . . . . . . . . . . .
Running cmdbdriver from the command line . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cmdbdriver and scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sample BMC Atrium Core API code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium CMDB API print.c routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BMC Atrium CMDB API and SQL views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Contents

18
19
20
20
21

26
29
29
29
30
34
34
35
35
35
35
36
36
36
36
37
38
39
39
40
43
43
44

Chapter 3

Finding related CIs

45

Overview of the CMDBQueryByPath function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46


Structure of the CMDBQueryByPath function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Example: Finding all computers in the payroll division using the
CMDBQueryByPath function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Overview of the graph walk query functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
The stating node and query loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Example: Finding all CIs related to an instance of computer system using the
graph walk query functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Overview of the CMDBGraphQuery function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Graph representation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Examples of the CMDBGraphQuery function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Example: Walking a specific type of relationship for a CI instance using the
CMDBGraphQuery function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Example: Walking multiple types of relationships for a CI instance using the
CMDBGraphQuery function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Chapter 4

C API functions

65

Types of BMC Atrium CMDB C API functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67


CMDBActivateFederatedInContext function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
CMDBBeginBulkEntryTransaction function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Input argument. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
CMDBCancelJobRun function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
CMDBCreateAttribute function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
CMDBCreateClass function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
CMDBCreateGuid function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
CMDBCreateInstance function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

Developers Reference Guide

CMDBCreateMultipleAttributes function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBCreateMultipleInstances function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBDeleteAttribute function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBDeleteClass function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBDeleteInstance function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBDeleteMultipleInstances function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBEndBulkEntryTransaction function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBExpandParametersForCI function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBExportData function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBExportDef function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGetAttribute function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGetClass function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Contents

82
82
82
84
85
85
85
85
86
86
86
86
87
87
87
87
88
88
88
88
89
89
89
89
90
90
90
90
91
91
91
91
92
92
92
93
93
93
93
93
94
94
94
95
97
97
97
97

CMDBGetCopyAuditData function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100


Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
CMDBGetInstance function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
CMDBGetInstanceBLOB function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
CMDBGetListClass function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
CMDBGetListInstance function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
CMDBGetMultipleAttributes function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
CMDBGetMultipleInstances function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
CMDBGetCMDBUIComponents function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
CMDBGetJobRun function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
CMDBGetListJobRun function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
CMDBGetRelatedFederatedInContext function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
CMDBGetServerPort function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Input argument. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

Developers Reference Guide

CMDBGetVersions function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphQuery function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkBegin function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkEnd function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkNext function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBImportData function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBImportDef function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBInitialization function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryByPath function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBRunQualificationForCI function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBSetAttribute function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBSetClass function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Contents

115
115
116
116
116
116
117
118
118
118
118
119
119
119
119
119
120
120
120
120
121
121
121
121
122
122
122
122
123
123
123
123
124
124
124
124
125
125
125
125
126
126
126
128
128
128
129
131

CMDBSetInstance function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131


Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
CMDBSetMultipleAttributes function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
CMDBSetMultipleInstances function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
CMDBSetServerPort function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
CMDBStartJobRun function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
CMDBSynchMetaData function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Input arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
CMDBSystemInit function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
CMDBTermination function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Synopsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Input argument. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Chapter 5

C API data structures

141

Types of BMC Atrium CMDB C API structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144


CMDBAttributeGetStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
CMDBAttributeLimit structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
CMDBAttributeLimitList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
CMDBAttributeNameId structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
CMDBAttributeValueList structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
CMDBAttributeValueListList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
CMDBAttributeValueStruct structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
CMDBAuditInfoStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
CMDBAuditValueList structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
CMDBAuditValueListList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
CMDBClassNameId structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
CMDBClassNameIdList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
CMDBClassRelationship structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
CMDBClassTypeInfo structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
CMDBExportItem structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
10

Developers Reference Guide

CMDBExportItemList structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBExportItemStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBFederatedActivateInfo structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBFederatedARInfo structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGetObjectList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGetObjectStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGetRelationList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGetRelationStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphAdjacentList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphAdjacentStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkObjectList structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkObjectStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkQueryStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkRelation structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkRelationList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkResultStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkSelectorAndFilterList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkSelectorAndFilterStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBGraphWalkStateStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBImportItem structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBImportItemList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBImportItemStruct structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBIndexList structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBIndexStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBInstanceList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBInstanceStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBItemTypeAttribute structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBItemTypeClass structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBNestedQueryStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQualifierStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryArithOpStruct structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryAttributeName structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryCardinality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryObject structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryObjectList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryObjectRelationship structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryObjectSelectorList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryObjectSelectorStruct structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryQualifierAndOrStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryQualifierSetOpStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryQualifierSimpleOpStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryQualifierStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryQualifierValueSetStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryQualifierValueStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryResultGraph. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQuerySortStruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQuerySortList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CMDBQueryStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents

159
159
161
162
163
163
163
164
164
165
165
166
166
167
167
169
170
171
172
173
174
175
175
176
177
178
178
179
179
179
180
181
181
182
183
184
186
186
187
188
188
189
190
192
193
194
195
197
197
198
11

CMDBGraphQueryResult . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
CMDBStdEdgeResult . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
CMDBEdgeListList. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
CMDBNodeList. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
CMDBNodeListList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
CMDBRelationshipResult . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
CMDBRelationshipResultList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
CMDBREClassQualList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
CMDBREClassQualStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
CMDBREDatasetList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
CMDBREDatasetPair structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
CMDBREJobRunInfo structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
CMDBREJobRunInfoList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
CMDBSortList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
CMDBSortStruct structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
CMDBUIComponentInfo structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
CMDBUIComponentResult structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
CMDBUIComponentResultList structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
CMDBVersionInfo structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
CMDBVersionInfoList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
CMDBWeakPropagatedAttrs structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
CMDBWeakPropagatedAttrsList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
CMDBXMLExportItemList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
CMDBXMLImportItemList structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Appendix A

cmdbdriver commands

217

cmdbdriver commands for C API functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218


Class commands for cmdbdriver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Attribute commands for cmdbdriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Instance commands for cmdbdriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
RE job run commands for cmdbdriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Federation commands for cmdbdriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Import and export commands for cmdbdriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Query By Path commands for cmdbdriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Graph Walk Query command for cmdbdriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Miscellaneous cmdbdriver commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Commands for controlling cmdbdriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Initialization and termination commands for cmdbdriver . . . . . . . . . . . . . . . . . . 223
Recording and logging commands for cmdbdriver . . . . . . . . . . . . . . . . . . . . . . . . 223
Thread and timer commands for cmdbdriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Session configuration commands for cmdbdriver . . . . . . . . . . . . . . . . . . . . . . . . . 224
Index

12

Developers Reference Guide

225

BMC Atrium Core documentation

This section describes the complete set of BMC Atrium Core documentation,
including manuals, help systems, videos, and so on.
Unless otherwise noted, documentation is available on the BMC Atrium Core
documentation media (DVD or Electronic Product Download bundle) and on the
BMC Customer Support site, free of charge, at http://www.bmc.com/support.
To find this documentation on the BMC Customer Support site, choose Product
Documentation > Supported Product A-Z List > BMC Atrium CMDB Enterprise
Manager > 7.6.03.
Title

Description

Audience

BMC Atrium CMDB 7.6.03 Information about setting permissions, configuring Configuration managers,
Administrator's Guide
federation, modifying the data model, configuring application administrators,
an impact model, and other administrative tasks in and asset analysts.
BMC Atrium CMDB.
BMC Atrium CMDB 7.6.03 Hierarchical diagram of all classes in the Common Configuration managers,
Common Data Model
Data Model (CDM) including unique attributes and application administrators,
Diagram
applicable relationships.
and asset analysts.
BMC Atrium CMDB
7.6.03 Data Model Help

Description and details of superclasses, subclasses,


attributes, and relationship classes for each class.
Contains only information about the CDM at first,
but you can update it to include information about
data model extensions that you install.

Configuration managers,
application administrators,
and asset analysts.

Note: This Help is provided in HTML and is available

on the BMC Atrium Core media. It is not available


on the BMC Customer Support site.
Configuration managers,
BMC Atrium CMDB 7.6.03 Best practices for using the classes that BMC
application administrators,
Data Modeling Guide
provides for BMC Atrium CMDB (both the CDM
and extensions) to model complex business entities, and asset analysts.
focusing on the use of multiple related CIs to model
an entity rather than on general information about a
class or attribute.
BMC Atrium CMDB 7.6.03 Information about normalizing data in BMC Atrium Configuration managers,
Normalization and
CMDB and reconciling CIs from different data
application administrators,
Reconciliation Guide
providers into a single production dataset.
and asset analysts.

BMC Atrium Core documentation

13

BMC Atrium Core 7.6.03

Title

Description

BMC Atrium CMDB


7.6.03 Online Help

Help for using and configuring BMC Atrium CMDB,


including BMC Atrium Product Catalog,
Reconciliation Engine, Normalization Engine, and
so on.

Audience

Configuration managers,
application administrators,
asset analysts, and users
that work with CIs and need
to understand the
Note: This Help is provided in HTML and is available
relationships that exist
through the Help links in the BMC Atrium CMDB
within BMC Atrium CMDB.
user interface. It is not available on the BMC
Customer Support site.

BMC Atrium CMDB 7.6.03 Information about using BMC Atrium CMDB,
User's Guide
including searching for and comparing CIs and
relationships, relating CIs, viewing history, running
impact simulations, and viewing federated data.

Users that work with CIs


and need to understand the
relationships that exist
within BMC Atrium CMDB.

BMC Atrium Core 7.6.03


Compatibility Matrix

Configuration managers,
application administrators,
and asset analysts.

Information about the BMC Atrium Core


configurations that are expected to work properly
based on design, testing, or general understanding
of the interaction between products.
Note: Download the BMC Atrium Core 7.6.03

Compatibility Matrix from the BMC Customer


Support site at http://www.bmc.com/support/
reg/remedy-compatibility-tables.html?c=n.

BMC Atrium Core 7.6.03


Concepts and Planning
Guide

Information about CMDB concepts and high-level


steps for planning and implementing BMC Atrium
Core.

Anyone who wants to learn


about and understand BMC
Atrium Core products,
CMDBs in general, and the
functionality of BMC
Atrium CMDB in particular.
IT leaders, configuration
managers, application
administrators, and asset
analysts are some who will
benefit from this
information.

BMC Atrium Core 7.6.03


Information about creating API programs using C
Developers Reference Guide API functions and data structures.

Application administrators
and programmers.

BMC Atrium Core 7.6.03


Installation Guide

Information about installing, upgrading, and


uninstalling BMC Atrium Core features.

Application administrators.

BMC Atrium CMDB


7.6.03 Javadoc Help

Information about Sun Java classes, methods,


and variables that integrate with BMC Atrium
CMDB.

Application programmers.

Note: This Help is provided in HTML and is available

on the BMC Atrium Core media. It is not available


on the BMC Customer Support site.
BMC Atrium Core 7.6.03
Master Index

14

Combined index of all guides.

Developers Reference Guide

Everyone.

Title

Description

Audience

BMC Atrium Core 7.6.03


Product Catalog and DML
Guide

Information about configuring the Product Catalog System administrators, IT


and DML, adding products, and creating aliases for managers, network
products, manufacturers, and categorizations.
managers, and other
qualified personnel who are
familiar with their
computing and networking
environment.

BMC Atrium Core 7.6.03


Release Notes

Information about new features, known issues, and Everyone.


other late-breaking topics.

BMC Atrium Core 7.6.03:


Taking Your Data Into
Production End to End

End-to-end high-level steps for bringing data into


BMC Atrium CMDB from a third-party source and
making it available in your production dataset.

Configuration managers,
application administrators,
and asset analysts.

Note: This Flash video is available on the BMC

Atrium Core media. It is not available on the BMC


Customer Support site.
BMC Atrium Core 7.6.03
Troubleshooting Guide

Information about resolving issues with BMC


Application administrators,
Atrium Core components, including API, filter, and programmers, and BMC
console error messages and their solutions.
Support personnel.

BMC Atrium Core 7.6.03


Web Services Help

Information about using BMC Atrium Core Web


Application administrators
Services, including how to publish and find
and programmers.
interfaces in the Web Services Registry, set versions,
disambiguate web services, configure security
policies and encryption, and use BMC Atrium Core
Web Services data structures and operations.
Note: This Help is provided in HTML and is available

on the BMC Atrium Core media. It is not available


on the BMC Customer Support site.
BMC Atrium Integration
Engine 7.6.03 ADK
Developer's Guide

Information about how to build adapters that can


transfer information between an external data store
and either BMC Remedy AR System forms or BMC
Atrium CMDB.

Developers who have a


basic understanding of BMC
Atrium Integration Engine
and want to build adapters
that can exchange data
between two data sources.

BMC Atrium Integration Help for using and configuring BMC Atrium
Engine 7.6.03 Online Help Integration Engine.

Users who are responsible


for setting up data transfer
integrations between
Note: This Help is provided in HTML and is available
external data stores and
through the Help links in the BMC Atrium
either BMC Atrium CMDB
Integration Engine user interface. It is not
or BMC Remedy
available on the BMC Customer Support site.
AR System.

BMC Atrium Core documentation

15

BMC Atrium Core 7.6.03

Title

Description

Audience

BMC Atrium Integration


Information about creating data exchanges and data
Engine 7.6.03 User's Guide mappings, defining rules and queries, activating
event-driven data exchanges, defining connection
settings, and other BMC Atrium Integration Engine
concepts.

Users who are responsible


for setting up data transfer
integrations between
external data stores and
either BMC Atrium CMDB
or BMC Remedy
AR System.

Mapping Your Data to


Spreadsheet that maps common IT objects to the
BMC Atrium CMDB 7.6.03 appropriate class, whether part of the CDM or an
Classes
extension. This spreadsheet also includes
information about further categorizing instances
using key attributes, and best practices for creating
normalized relationships.

Configuration managers,
application administrators,
and asset analysts.

16

Developers Reference Guide

Chapter

Introduction to the BMC


Atrium Core APIs
This section provides an overview of the BMC Atrium CMDB application
programming interface (API) suite.
The following topics are provided:

 BMC Atrium CMDB API architecture overview (page 18)


 API version requirements for BMC Atrium CMDB client-server connections
(page 21)
 Comparison between BMC Atrium CMDB API programming and using the
BMC Atrium Core Console (page 22)

Chapter 1

Introduction to the BMC Atrium Core APIs

17

BMC Atrium Core 7.6.03

BMC Atrium CMDB API architecture overview


The BMC Atrium CMDB product provides an API suite that allows you to work
with class definitions, instance data, federation, reconciliation, audit, and other
functions. The BMC Atrium CMDB API suite is composed of the C, Java, and web
services APIs.
The C, Java, and web services APIs provide similar data structures and functions
to encapsulate information and functionality. Additionally, the web services API
provides a set of platform-independent operations that communicate with your
applications to retrieve and send data.
As shown in Figure 1-1, BMC Atrium Core components, such as Atrium Explorer
and BMC Atrium Core Console, use the Java API to control the flow of data,
whereas the external data consumers and data providers can communicate using
either the web services API or Java API.
Figure 1-1: BMC Atrium CMDB API architecture
AR System
Applications

BMC Service
Impact Manager
Atrium Console
BMC
Remedy
User

Web
Client

BMC Atrium
Discovery

.Net
Client

Atrium Explorer
BMC
Remedy
User

Web Service Clients


AXIS
Client

Web
Client

CMDB Web Services


API

BMC Remedy Mid Tier


(CMDB API)

CMDB Java
API

Normalization
Engine

CMDB C
API

Reconciliation
Engine

AR System
API

Action Request System


BMC
Atrium
CMDB

Database

This guide describes the C API. For more information about the BMC Atrium
CMDB Java API, see BMC Atrium CMDB 7.6.03 Javadoc Help. For more
information about web services APIs, see BMC Atrium Core 7.6.03 Web Services
Help.

18

Developers Reference Guide

BMC Atrium CMDB API architecture overview

BMC Atrium CMDB C API features and components


A BMC Atrium CMDB client can use the C API to create, modify, delete, and query
class definitions, instance data, federation, reconciliation, and other functions. The
C API:

 Contains data structures that store both simple and complex information. A
simple data structure serves as the primary building block for a complex data
structure.

 Includes a set of free functions that you can use to deallocate memory.
 Includes a set of copy functions that you can use to make copies of BMC Atrium
CMDB C API structures

 Provides server-access information with every call in the control parameter of


the function.

BMC Atrium CMDB C API features


You can use the C API functions to perform the following operations:

 Create, modify, and delete classes and instances.


 Retrieve CI and relationship information.
 Import and export definitions and data.
 Start and stop Reconciliation Engine jobs.
BMC Atrium Core C API supports the following 32-bit and 64-bit platforms:

 Microsoft Windows
 Linux
 Sun Solaris
 IBM AIX
 Hewlett Packard HP-UX
 Hewlett Packard HP-Itanium

BMC Atrium CMDB C API components


The C API consists of a set of functions and data structures, most of which perform
a specific operation against BMC Atrium CMDB or a federated data store. For
example, you can use a function to retrieve information about a particular BMC
Atrium CMDB class.
Most of the C API functions accept BMC Atrium CMDB C data structures as
parameters that qualify the action to perform, such as the type of class to create, the
qualification for an instance to retrieve or delete, or the class name to modify.

Chapter 1

Introduction to the BMC Atrium Core APIs

19

BMC Atrium Core 7.6.03

The sdk/samples/driver subdirectory in your BMC Atrium CMDB installation


directory contains the source code for the cmdbdriver program. This program
provides a command-line interface for calling C API functions. The cmdbdriver
program also includes print routines for every data structure in the API, making it
a useful debugging tool.

BMC Atrium CMDB Java API package


The BMC Atrium CMDB Java API is a collection of Java classes and methods that
provide the C API functionality in a Java development environment. For example,
use the Java API if you write server-side web applications that you access through
the Java Server page (JSP) or Java servlets web tier layer.
The Java API provides an object model of BMC Atrium CMDB. Because the Java
APIs provide classes and methods that are similar to the C API functions and data
structures, you will find it easier to use the Java API if you are already familiar with
the C API.
This guide describes the C API. For more information about the Java API, see BMC
Atrium CMDB 7.6.03 Javadoc Help, which is located in the cmdb/sdk/javadoc/
cmdbapi/ subdirectory of your BMC Atrium Core installation directory. To access
BMC Atrium CMDB 7.6.03 Javadoc Help, open the index.html file.
For detailed information about the Java API changes in this release, see the
JavaAPI_Overview.html file of BMC Atrium CMDB 7.6.03 Javadoc Help.

For more information about the web services API, see the BMC Atrium Core 7.6.03
Web Services Help.

BMC Atrium Core web services API overview


BMC Atrium Core Web Services, which conforms to Simple Object Access Protocol
(SOAP) and Web Services Description Language (WSDL) standards, provides a
standard interface for interacting with BMC Atrium Core. You can use the web
services API to integrate BMC Atrium CMDB data with other applications, for
example, BMC Atrium Discovery and Dependency Mapping, BMC Remedy
Change Management, or any other third-party application.
BMC Atrium Core Web Services APIs consist of operations and data structures.
For more information about the available operations, see BMC Atrium Core 7.6.03
Web Services Help.

20

Developers Reference Guide

API version requirements for BMC Atrium CMDB client-server connections

BMC Atrium Core Web Services includes the following components:

 The BMC Atrium Web Services Infrastructure component has been divided into
the components shown in Table 1-1.
Table 1-1: BMC Atrium Web Services Infrastructure components
Component

Includes

Web Services
Infrastructure

The modified Apache Axis2 stack

Atrium Core Web


Services

BMC Atrium Core web services

For more information about the modifications, see BMC Atrium


Core 7.6.03 Web Services Help.

 By default, Username and Password authentication is the only enabled Web


Services security policy. Other security policies are available but are not
enabled.

 The TIBCO Runtime UDDI Server is a registry through which web services are
published and clients find and invoke the services. It is implemented as a
collection of web services and is deployed as a WAR file (uddi.war) on the web
application server.

API version requirements for BMC Atrium


CMDB client-server connections
You can prevent earlier versions of BMC Atrium CMDB clients from connecting to
a later version of the server. To specify the minimum API version with which the
server can communicate, configure the Minimum-CMDB-API-Version parameter in
the ar.cfg (Microsoft Windows) or ar.conf (UNIX) file. The default value for
this setting is 3.
For example, if you set Minimum-CMDB-API-Version to 4, clients earlier than
version 2.1.00 cannot communicate with the server. For more information about
the ar.cfg or ar.conf configuration file, see the BMC Remedy Action Request
System 7.6.03 Configuration Guide. Table 1-2 provides the BMC Atrium CMDB
releases and their corresponding API versions.
Table 1-2: BMC Atrium Core releases and corresponding API versions
BMC Atrium CMDB release

API version

BMC Atrium CMDB 7.6.03

BMC Atrium CMDB 7.6.00

BMC Atrium CMDB 7.5.00

BMC Atrium CMDB 2.1.00

BMC Atrium CMDB 2.0.x

Chapter 1

Introduction to the BMC Atrium Core APIs

21

BMC Atrium Core 7.6.03

Comparison between BMC Atrium CMDB API


programming and using the BMC Atrium Core
Console
The BMC Atrium CMDB API allows you to interact with BMC Atrium CMDB
programmatically and to integrate BMC Atrium CMDB functionality into your
applications. API programming gives you the flexibility to customize your
applications, but it is also more complex to design, implement, and maintain. If
you do not need this flexibility or would like to interact with the BMC Atrium
CMDB user interface, consider using the BMC Atrium Core Console.
The BMC Atrium Core Console provides an easy-to-use graphical user interface
for performing BMC Atrium CMDB tasks, such as creating classes, CIs, and
relationships, and viewing instance history. For more information about
performing BMC Atrium Core Console tasks, see:

 BMC Atrium CMDB 7.6.03 Administrator's GuideFor administrator tasks such


as, using creating or modifying classes and attributes, and creating federated
data.

 BMC Atrium CMDB 7.6.03 Normalization and Reconciliation GuideFor setting up


normalization and reconciliation tasks.

 BMC Atrium CMDB 7.6.03 User's GuideFor user tasks such as, viewing CI
history, viewing CI and relationship classes, and comparing instances.

When to use the BMC Atrium CMDB API and the BMC Atrium Core
Console
Table 1-3 outlines the scenarios in which you should use APIs or the BMC Atrium
Core Console.
Table 1-3: API programming and BMC Atrium Core Console scenarios (Sheet 1 of 2)
Scenario

API programming or BMC Atrium Core Console

To modify the CDM manually.

BMC Atrium Core Console

To access multiple BMC Atrium CMDB API programming


components at the same time or
integrate with programs or data outside
the BMC Atrium Core Console.

22

To create, delete, or search for BMC


Atrium CMDB classes manually.

BMC Atrium Core Console

To perform complex operations that


involve multiple objects.

API programming

Developers Reference Guide

Comparison between BMC Atrium CMDB API programming and using the BMC Atrium Core Console

Table 1-3: API programming and BMC Atrium Core Console scenarios (Sheet 2 of 2)
Scenario

API programming or BMC Atrium Core Console

To create, delete, or search BMC Atrium BMC Atrium Core Console


CMDB relationships manually.
To create a two-way interface (or
API programming
gateway) between BMC Atrium CMDB
and another application.

BMC Atrium Core Console and BMC Atrium CMDB API terminology
The BMC Atrium Core Console and the APIs use different terms for specific tasks,
as shown in Table 1-4.
Table 1-4: BMC Atrium Core Console and API terminology
BMC Atrium Core Console term

API term

search/find

getList/find/query

create

create

modify

set/update

view/display

get

Chapter 1

Introduction to the BMC Atrium Core APIs

23

BMC Atrium Core 7.6.03

24

Developers Reference Guide

Chapter

Getting started

This section provides the information that you need to get started with developing
your BMC Atrium CMDB APIs.
The following topics are provided:










BMC Atrium CMDB API compatibility (page 26)


BMC Atrium CMDB C API requirements and package contents (page 29)
BMC Atrium CMDB Java API requirements and package contents (page 35)
BMC Atrium Core Web Services API components (page 36)
The cmdbdriver program (page 37)
Sample BMC Atrium Core API code (page 43)
BMC Atrium CMDB API print.c routines (page 43)
BMC Atrium CMDB API and SQL views (page 44)

Chapter 2 Getting started

25

BMC Atrium Core 7.6.03

BMC Atrium CMDB API compatibility


This section provides the backward and forward API compatibility information for
BMC Atrium CMDB 7.6.03.
Table 2-1 provides a compatibility matrix for versions of BMC Atrium CMDB and
BMC Remedy AR System servers. The supported combinations are listed with the
assumption that the platform version (including operating system and either 32bit or 64-bit architecture) of the BMC Atrium CMDB server must be the same as the
BMC Remedy AR System server. For example, the 32-bit Linux version of BMC
Atrium CMDB cannot be installed with the 64-bit Linux version of BMC Remedy
AR System. Use this table if you are using or planning to use the BMC Remedy
AR System API.
Table 2-1: Compatibility between BMC Atrium CMDB and BMC Remedy AR System servers
(Sheet 1 of 2)
BMC Remedy AR System server

BMC Atrium CMDB server

Supported?

7.6.03

7.6.03

Yes

7.6.03

7.6.00

Yes
(Not supported on 64-bit
Windows platform)

7.6.03

7.5.00

Yes
(Not supported on 64-bit
Windows platform)

7.6.03

2.1.00

Yes
(32-bit Windows only.
Not supported on 64-bit
UNIX platforms.)

7.6.03

2.0.1

Yes
(32-bit Windows only.
Not supported on 64-bit
UNIX platforms.)

7.5.00

7.6.03

No

7.5.00

7.6.00

Yes

7.5.00

7.5.00

Yes

7.5.00

2.1.00

Yes
(32-bit Windows only.
Not supported on 64-bit
UNIX platforms.)

7.5.00

2.0.1

Yes
(32-bit Windows only.
Not supported on 64-bit
UNIX platforms.)

26

7.1.00

7.6.03

No

7.1.00

7.6.00

No

7.1.00

7.5.00

No

Developers Reference Guide

BMC Atrium CMDB API compatibility

Table 2-1: Compatibility between BMC Atrium CMDB and BMC Remedy AR System servers
(Sheet 2 of 2)
BMC Remedy AR System server

BMC Atrium CMDB server

Supported?

7.1.00

2.1.00

Yes

7.1.00

2.0.1

Yes

7.0.1

7.6.03

No

7.0.1

7.6.00

No

7.0.1

7.5.00

No

7.0.1

2.1.00

No

7.0.1

2.0.1

Yes

A BMC Atrium CMDB client is any application that uses the BMC Atrium CMDB
API. If you plan to develop a BMC Atrium CMDB client, reference Table 2-2, which
provides a compatibility matrix for versions of BMC Atrium CMDB servers and
clients. The platform version (including operating system and either 32-bit or 64bit architecture) of the BMC Atrium CMDB client is independent of the BMC
Atrium CMDB server. For example, the 32-bit Windows version of the client can
communicate with the 64-bit Linux version of the server. The supported
combinations listed apply to all platforms.

Chapter 2 Getting started

27

BMC Atrium Core 7.6.03

Table 2-2: Compatibility between BMC Atrium CMDB clients and servers (Sheet 1 of 2)
BMC Atrium CMDB Client BMC Atrium CMDB Server Supported?

28

7.6.03

7.6.03

Yes

7.6.03

7.6.00

Yes (Backwards compatibility


provided by CMDB client)

7.6.03

7.5.00

Yes (Backwards compatibility


provided by CMDB client)

7.6.03

2.1.00

Yes (Backwards compatibility


provided by CMDB client)

7.6.03

2.0.1

Yes (Backwards compatibility


provided by CMDB client)

7.6.00

7.6.03

Yes (Backwards compatibility


provided by CMDB server)

7.6.00

7.6.00

Yes

7.6.00

7.5.00

Yes (Backwards compatibility


provided by CMDB client)

7.6.00

2.1.00

Yes (Backwards compatibility


provided by CMDB client)

7.6.00

2.0.1

Yes (Backwards compatibility


provided by CMDB client)

7.5.00

7.6.03

Yes (Backwards compatibility


provided by CMDB server)

7.5.00

7.6.00

Yes (Backwards compatibility


provided by CMDB server)

7.5.00

7.5.00

Yes

7.5.00

2.1.00

Yes (Backwards compatibility


provided by CMDB client)

7.5.00

2.0.1

Yes (Backwards compatibility


provided by CMDB client)

2.1.00

7.6.03

Yes (Backwards compatibility


provided by CMDB server)

2.1.00

7.6.00

Yes (Backwards compatibility


provided by CMDB server)

2.1.00

7.5.00

Yes (Backwards compatibility


provided by CMDB server)

2.1.00

2.1.00

Yes

2.1.00

2.0.1

Yes (Backwards compatibility


provided by CMDB client)

2.0.1

7.6.03

Yes (Backwards compatibility


provided by CMDB server)

2.0.1

7.6.00

Yes (Backwards compatibility


provided by CMDB server)

2.0.1

7.5.00

Yes (Backwards compatibility


provided by CMDB server)

Developers Reference Guide

BMC Atrium CMDB C API requirements and package contents

Table 2-2: Compatibility between BMC Atrium CMDB clients and servers (Sheet 2 of 2)
BMC Atrium CMDB Client BMC Atrium CMDB Server Supported?
2.0.1

2.1.00

No

2.0.1

2.0.1

Yes

BMC Atrium CMDB C API requirements and


package contents
The C API package includes header files, library files, and source code for the
cmdbdriver sample program. When installing the BMC Atrium Core solution, you
also install the C API.

BMC Atrium CMDB C API requirements


To build and run a C API program on Linux, you must install the GNU Standard
C++ Library version 3 Release 5 or libstdc++5 package.

BMC Atrium CMDB C API header files


Table 2-3 lists the C API header files installed in the include directory of your
BMC Atrium Core installation.
Table 2-3: C API header files
File name

Contents

ar.h

BMC Remedy AR System API data type and structure definitions,


size limits, and constant definitions.

cmdb.h

BMC Atrium Core C API data type and structure definitions, size
limits, and constant definitions.

arerrno.h

Error code definitions.

arextern.h

External declarations for the API functions, specified with and


without prototypes for use with standard C, ANSI C, or C++
compilers.

arfree.h

External declarations for the FreeAR functions. These functions


recursively free all allocated memory associated with a particular
data structure.

cmdbfree.h

External declarations for the FreeCMDB functions. These functions


recursively free all allocated memory associated with a particular
data structure.

arstruct.h

Core and reserved subclasses ID definitions, database separator


characters, and labels for exporting structure definitions.

Chapter 2 Getting started

29

BMC Atrium Core 7.6.03

BMC Atrium CMDB C API library files


To display error messages properly, you must have arcatalog_eng.dll in your
path at runtime, and make sure the lib directory contains the BMC Atrium Core
C API library files listed in Table 2-4.
To load dynamic libraries on Solaris and Linux, include the -ldl link flag in the
link command. For more information about linking and compiling your code, see
the driver sample makefile in the sdk\samples\driver subdirectory of the BMC
Atrium Core installation.

NOTE
The SDK contains files that are not listed in Table 2-4. Those files are required for
the Java API or for working with the cmdbdriver program, but are not required to
create a C API program.
Table 2-4: C API library files (Sheet 1 of 4)

30

Platform

Files

Microsoft Windows

 32-bit
 arapi7603_build001.dll
 arcatalog_eng.dll
 arjni7603_build001.dll
 arrpc7603_build001.dll
 arutiljni7603_build001.dll
 arutl7603_build001.dll
 cmdbapi7603.dll
 icudt32.dll
 icuinbmc32.dll
 icuucbmc32.dll
 mfc71.dll
 msvcp71.dll
 msvcr71.dll
 64-bit
 arapi7603_build001_win64.dll
 arcatalog_eng.dll
 arjni7603_build001_win64.dll
 arrpc7603_build001_win64.dll
 arutiljni7603_build001.dll
 arutl7603_build001_win64.dll
 arxmlutil7603_build001_win64.dll
 cmdbapi7603_win64.dll
 icudt32.dll
 icuinbmc32_win64.dll
 icuucbmc32_win64.dll
 mfc71.dll
 msvcp71.dll
 msvcr71.dll

Developers Reference Guide

BMC Atrium CMDB C API requirements and package contents

Table 2-4: C API library files (Sheet 2 of 4)


Platform

Files

Solaris

 32-bit
 libarjni7603_build001.so
 libarutiljni7603_build001.so
 libcmdbapi7603.so
 libcmdbjni7603.so
 libjlicapi7603_build001.so
 libicudatabmc.so.32
 libicui18nbmc.so.32
 libicuucbmc.so.32
 64-bit
 libarjni7603_build001.so
 libarutiljni7603_build001.so
 libcmdbapi7603_solsp64.so
 libcmdbjni7603.so
 libjlicapi7603_build001.so
 libicudatabmc_solsp64.so.32
 libicui18nbmc_solsp64.so.32
 libicuucbmc_solsp64.so.32

AIX

 32-bit
 libarjni7603_build001.a
 libarutiljni7603_build001.a
 libcmdbjni7603.a
 libcmdbapi7603.a
 libicudatabmc32.a
 libicui18nbmc32.a
 libicuucbmc32.a
 libjlicapi7603_build001.a
 64-bit
 libarjni7603_build001.a
 libarutiljni7603_build001.a
 libcmdbjni7603_build001.a
 libcmdbapi7603_build001_aixp64.a
 libicudatabmc_aixp6432.a
 libicui18nbmc_aixp6432.a
 libicuucbmc_aixp6432.a
 libjlicapi7603_build001.a

Chapter 2 Getting started

31

BMC Atrium Core 7.6.03

Table 2-4: C API library files (Sheet 3 of 4)

32

Platform

Files

HP-UX

 32-bit
 libicudatabmc.sl.32
 libicui18nbmc.sl.32
 libicuucbmc.sl.32
 libarjni7603_build001.sl
 libarutiljni7603_build001.sl
 libcmdbapi7603.sl
 libcmdbjni7603.sl
 libjlicapi7603_build001.sl
 64-bit
 libicudatabmc_hppa64.sl.32
 libicui18nbmc_hppa64.sl.32
 libicuucbmc_hppa64.sl.32
 libarjni7603_build001.sl
 libarutiljni7603_build001.sl
 libcmdbjni7603.sl
 libjlicapi7603_build001.sl

Linux

 32-bit
 libicudatabmc.so.32
 libicui18nbmc.so.32
 libicuucbmc.so.32
 libarjni7603_build001.so
 libarutiljni7603_build001.so
 libcmdbapi7603.so
 libcmdbjni7603.so
 libjlicapi7603_build001.so
 64-bit
 libicudatabmc_lx64.so.32
 libicui18nbmc_lx64.so.32
 libicuucbmc_lx64.so.32
 libarjni7603_build001.so
 libarutiljni7603_build001.so
 libcmdbapi7603_lx64.so
 libcmdbjni7603.so
 libjlicapi7603_build001.so

Developers Reference Guide

BMC Atrium CMDB C API requirements and package contents

Table 2-4: C API library files (Sheet 4 of 4)


Platform

Files

HP-Itanium

 32-bit (for client-side programs)


 libicudatabmc_hpia32.sl.32
 libicui18nbmc_hpia32.sl.32
 libicuucbmc_hpia32.sl.32
 libarjni7603_build001_hpia32.so
 libarutiljni7603_build001_hpia32.so
 libcmdbapi7603_hpia32.sl
 libcmdbjni7603_hpia32.so
 libjlicapi7603_build001_hpia32.sl
 64-bit (for server-side programs)
 libicudatabmc_hpia64.sl.32
 libicui18nbmc_hpia64.sl.32
 libicuucbmc_hpia64.sl.32
 libarjni7603_build001_hpia32.so
 libarutiljni7603_build001_hpia32.so
 libcmdbapi7603_hpia64.sl
 libcmdbjni7603_hpia32.so
 libjlicapi7603_build001_hpia32.sl

Chapter 2 Getting started

33

BMC Atrium Core 7.6.03

Compiler preparation for the BMC Atrium CMDB C API


Before you write C API programs, make sure that the following software programs
are installed or configured on your system:

 For Microsoft Windows 32-bit you need Microsoft Visual C++ version 7.0 or
later. For Microsoft Windows 64-bit, you need Microsoft Visual C++ 9.0. to
compile your C API programs.

 Structure member alignment: 8 bytes (default)


 Set code generation to Multithreaded DLL, not DebugMultithreaded DLL.
Where other included libraries cause conflicts, add /nodefaultlib:"MSVCRTD"
to the project options to avoid using the Debug C runtime library. If your
program references this library at runtime, memory management errors will
occur when memory pointers are referenced by both the Debug and Release C
runtime libraries.

 ANSI standard C or C++ compiler (for UNIX)

NOTE
If you develop C++ clients that run on HP computers using the BMC Atrium
CMDB C API, compile your code with the __HPACC_THREAD_SAFE_RB_TREE flag
enabled. This operation is necessary because the libraries that the tree header file
uses, which includes tree.cc, are not thread safe.

Libraries for linking to BMC Atrium CMDB


Table 2-5 lists the libraries that your programs must use for linking to BMC Atrium
CMDB.
Table 2-5: Link files

34

Platform

Links

Windows

cmdbapi7603.dll

Solaris, Linux

libcmdbapi7603.so

HP-UX

libcmdbapi7603.sl

HP-Itanium

libcmdbapi7603_hpia32.sl
libcmdbapi7603_hpia64.sl

AIX

libcmdbapi7603.a

Developers Reference Guide

BMC Atrium CMDB Java API requirements and package contents

BMC Atrium CMDB Java API requirements and


package contents
The Java API package includes several header files and library files. When you
install the BMC Atrium Core solution, the Java API is also installed.
For detailed information about the Java API, see BMC Atrium CMDB 7.6.03
Javadoc Help, which is located in the cmdb/sdk/javadoc/cmdbapi/ subdirectory
of your BMC Atrium Core installation directory

BMC Atrium CMDB Java API requirements


To build and run a Java API program on either Windows or UNIX, you need the
following environment components:

 J2SE Software Development Kit (SDK), version 1.5.0_11 or later.


 Windows DLL files or UNIX library files listed in Table 2-4 on page 30.
 GNU Standard C++ Library version 3 Release 5 or libstdc++5 package. This
requirement also applies to other BMC applications that use the BMC Atrium
CMDB SDK.

BMC Atrium CMDB Java API library files


When you install BMC Atrium Core, a list of BMC Atrium CMDB Java API library
files is installed with the application. For more information about these library
files, see Installation and deployment of the JavaAPI_Overview.html file of
BMC Atrium CMDB 7.6.03 Javadoc Help.

BMC Atrium CMDB Java API header files


Table 2-6 lists the header files that are installed with the BMC Atrium CMDB Java
API.
Table 2-6: Header files for BMC Atrium CMDB programs
Header file name

Description

com.bmc.arsys.api.*;

BMC Remedy AR System API functions

com.bmc.cmdb.api.*;

CMDB API functions

java.util.*;

Java utilities library

Chapter 2 Getting started

35

BMC Atrium Core 7.6.03

BMC Atrium CMDB Java API configuration file


The cmdbabi.properties file contains configuration settings for properties, such
as API timeout, minimum RPC Version, and Java Proxy connections. You can
modify these configuration settings to increase the server response time when you
execute your BMC Atrium CMDB Java program. For more information about how
to configure these settings, see the BMC Atrium Core 7.6.03 Troubleshooting Guide.

BMC Atrium Core Web Services API


components
The BMC Atrium Core Web Services API includes two components: the BMC
Atrium Web Services Infrastructure and the BMC Atrium Web Services Registry.
To work with the BMC Atrium Core Web Services API, you must register your
services, understand how to locate your services, how to publish and find
interfaces, and how to configure your BMC Atrium Core Web Services.
For more information about using BMC Atrium Core Web Services API, see BMC
Atrium Core 7.6.03 Web Services Help.

BMC Atrium Core Web Services Infrastructure overview


BMC Atrium Core Web Services Infrastructure allows the integration of BMC
Software products across a network in a service-oriented architecture. This is an
Apache Axis2 installation that includes modified and BMC-specific modules. The
modifications also include changes for managing runtime and archive
configurations with the AtriumProperties.xml file and the atriumwsutil
utility.
For more information about the modules and administration procedures, see BMC
Atrium Core 7.6.03 Web Services Help.
BMC Atrium Web Services Infrastructure also includes the BMC Atrium Core web
services that clients can invoke.

BMC Atrium Core Web Services Registry overview


The BMC Atrium Core Web Services Registry allows clients to obtain information
about available services. The services registry is compliant with the Universal
Description, Discovery and Integration (UDDI) standard.
BMC Atrium Core Web Services Registry provides an easy way to register a BMC
Remedy AR System web service and other web services with this registry. When
you register your BMC Atrium Core Web Services, you must specify a URL for the
access point and, optionally, a URL for the WSDL.

36

Developers Reference Guide

The cmdbdriver program

The cmdbdriver program


The cmdbdriver program enables you to execute various BMC Atrium CMDB C
API functions. You can combine several cmdbdriver commands in a script that
you can execute with a single command. This combination is helpful when you
need to reuse a series of commands.
The cmdbdriver program prompts you one at a time for parameters to each
command you type. The parameters that are required for executing C API
functions using cmdbdriver are the same as the parameters that are required for the
equivalent C API functions.
Figure 2-1: Initial screen for cmdbdriver

Chapter 2 Getting started

37

BMC Atrium Core 7.6.03

cmdbdriver command line options


You can specify login parameters, as shown in Table 2-7, when you invoke the
cmdbdriver program from the command line. These parameters are applicable to
both UNIX and Windows environments. When you execute the cmdbdriver
program, the system displays the list of commands. When you run cmdbdriver
from the command line with these parameters, you do not need to use the log
command.
Table 2-7: cmdbdriver command line parameters
Command line parameter

Description

Usage

-u user

Specify the BMC Remedy AR System user


name for the login.

cmdbdriver.exe -u Demo

-a authorString

Specify the BMC Remedy AR System


authorization string for the login.

cmdbdriver.exe -a
ARSystemAuthorizationSt
ring

-p password

Specify the BMC Remedy AR System


password for the login.

cmdbdriver.exe -u Demo
-a -p

-1 locale

Specify the locale in which you want to work. cmdbdriver.exe -l fr

-s server

Specify the BMC Remedy AR System server


name to connect to for the cmdbdriver
session.

cmdbdriver.exe -u Demo
-a -p -s localhost

-x inputFileFullpath

Use cmdbdriver commands from an input


file.

cmdbdriver.exe -x
cmdb.in

-t portNumber

Specify the BMC Remedy AR System port


number.

cmdbdriver.exe -t 8080

-q quietModeNumber

A binary value indicating the quiet mode in


cmdbdriver.exe -q 10
which you want the cmdbdriver to operate.
You can combine any of the following
numbers to suppress different details that
might be printed at a time.
For example, to suppress the cmdbdriver
menu and headers, type 10 for this parameter.











38

0: NO_SUPPRESSION
1: SUPPRESS_RESULTS
2: SUPPRESS_HEADERS
4: SUPPRESS_PROMPTS
8: SUPPRESS_MENU
16: SUPPRESS_ERRORS
32: SUPPRESS_WARNINGS
64: SUPPRESS_TIME
128: SUPPRESS_DATE

Developers Reference Guide

The cmdbdriver program

Commands that record your cmdbdriver commands


You can use the rec and srec commands of the cmdbdriver program to record
cmdbdriver commands. The rec command starts recording the commands that you
use at the prompt and srec stops recording commands.
When you type the rec command, you are prompted for the name of the file in
which to store these commands. After you record the commands in a file, you can
execute it at the cmdbdriver prompt by using the execute command and specifying
the file name.

Running cmdbdriver from the command line


Run cmdbdriver from the command line to be prompted sequentially for each
parameter needed to run your command.

Before you begin


 Compile the source code or locate the prebuilt program supplied with the API.
 Be prepared to provide the necessary login information and perform
initialization operations for connecting to BMC Atrium Core.

 To run the cmdbdriver program from the command line


1 Start the cmdbdriver program with the appropriate steps for your platform:

 Windows
 Navigate to C:\Program

Files\BMC Software\Atrium Core\cmdb\sdk\bin.

 Double-click cmdbdriver.exe.
 UNIX
 Navigate to AtriumCoreInstallationDirectory/cmdb/sdk/bin.
 Type the command ./cmdbdriver.sh.
Shared libraries required by the cmdbdriver program are added to the library
path for the cmdbdriver session. The cmdbdriver program sets the library
path variable according to your UNIX platform:
UNIX platform

Variable name

Solaris and Linux

LD_LIBRARY_PATH

HP-UX

SHLIB_PATH

AIX

LIBPATH

2 Initialize an API session with the init command.


3 Type log at the prompt.

Chapter 2 Getting started

39

BMC Atrium Core 7.6.03

4 Specify the login parameters one at a time:


a Type a valid user name and password.
b Type the name of your server.

You can skip the other parameters.


5 In the command prompt, type the abbreviation of the function and provide the

appropriate input parameter values.


For example, the following cmdbdriver commands import class definitions for the
BMC_ComputerSystem and BMC_SystemComponent classes from the
ImportClasses.txt file. Because the user specifies a value of 1 for the Import
Option prompt, cmdbdriver returns an error if these classes already exist.
Command: impdf
DEFINITION IMPORT
Import Item List:
Number of import items (0): 2
Item Type: (Class, Attribute) (1-2) (1): 1
Class Type
Class Name
Namespace (): BMC.CORE
Class Name (): BMC_ComputerSystem
Item Type: (Class, Attribute) (1-2) (1): 1
Class Type
Class Name
Namespace (): BMC.CORE
Class Name (): BMC_SystemComponent
Import Option : Create/Overwrite (1-2) (1): 1
Filename containing import data: C:\ImportClasses.txt

NOTE
Use the help command (h or ?) to display cmdbdriver commands.
6 When you are finished using the cmdbdriver, type e or q to exit the program.

cmdbdriver and scripts


As an alternative to using the command line, you can use a script file that contains
the cmdbdriver commands and execute it at the cmdbdriver prompt. You can create
this script file using any text editor, such as Notepad.

TIP
To execute the commands stored in a file, either use the inline parameters (see
Running cmdbdriver from the command line on page 39) or copy and paste the
commands at the cmdbdriver prompt.

40

Developers Reference Guide

The cmdbdriver program

Example 1: cmdbdriver script fileImport definitions


This example shows a cmdbdriver script that imports classes and attributes:
impdf
2
1
BMC.CORE
BMC_ComputerSystem
1
BMC.CORE
BMC_SystemComponent
1
C:\ImportClasses.txt

The script imports two classes, the BMC_ComputerSystem and


BMC_SystemComponent classes from the BMC.CORE namespace. These classes are
imported from a file called ImportClasses.txt.
To accept a default value for a parameter in the cmdbdriver script, insert a blank
line, as shown in the following script that retrieves the destination CI for the
BMC_System source class:

Example 2: cmdbdriver script fileGet List Class


This example shows a cmdbdriver script that returns a list of related classes.
glc
BMC.CORE
BMC.CORE
BMC_System
BMC.CORE
BMC_Component
T

BMC_Component is the relationship between these CIs and their classes within the
BMC.CORE namespace. The blank line in this example accepts the default value for

the Number of characteristics parameter. The default for this parameter is set to
0 (none).

Example 3: cmdbdriver script fileQuery by path


This example shows a cmdbdriver script that queries related CIs using the
CMDBQueryByPath function.
init
log
MyUser

MyServer
cqq
PersonQueryQual

Chapter 2 Getting started

41

BMC Atrium Core 7.6.03

4
1
Name
1
4
Daisy
cqobj
BMC.CORE
BMC_Person
PersonQueryObj
1
1
PersonQueryQual

qbp
BMC.ASSET
1
PersonQueryObj
1
PersonQueryObj
1
Name
1
BMC_Person
PersonQueryObj
Name
1
1
2

In the preceding example, the script first creates a query qualifier using the cqq
command. The alias for the query qualifier is specified as PersonQueryQual. The
query qualification in this example is a Simple query that searches for an instance
of BMC_Person class with Name = Daisy in the BMC.CORE namespace.

NOTE
A query qualifier can be reused any number of times within a specific session.
After a cmdbdriver session terminates, the query qualifier that you created within
the session is no longer available.
The value of 1 in the query qualification instructs the query to perform an Equal
to operation and 4 indicates that the right operand for the query is a value. The
query constructed in the query qualification is Name = Daisy.

42

Developers Reference Guide

Sample BMC Atrium Core API code

In the query object, you specify the namespace and class information. The alias for
the query object is PersonQueryObj. The first value of 1 after the PersonQueryObj
line instructs the query to search for a CI class. The next value of 1 instructs the
query to use the existing PersonQueryQual query qualification object.
The blank value after the query qualifier name is for the source node alias. The
query qualification in this example does not involve an input of multiple nodes in
a graph format. Therefore, this parameter is left blank. The subsequent values of 1
and 1 specify that the query is to be performed on a CI class and that the query
must use an existing query object. The alias for the query qualification object is
then specified. The blank values indicate that there is no explicit join to perform in
the query.
The qbp command takes the input of the dataset, which is BMC.ASSET in this
example. The dataset mask is specified as none with a blank line. The
Query_Object_List, Query_Object_Optional_List, and
Query_Object_Selector_List parameters are then specified. The attribute to
fetch in the query is specified as Name. The results are sorted by the Name
attribute in an ascending order.

Sample BMC Atrium Core API code


The sdk/samples/driver/cmdbdriver subdirectory in the BMC Atrium CMDB
installation directory includes the source code for a sample cmdbdriver program.
A compiled version of the cmdbdriver program is located in the sdk/bin
directory. For more information about the cmdbdriver program, see The
cmdbdriver program on page 37.
After compiling the source code or locating the prebuilt program supplied with the
API, you can use cmdbdriver to:

 Identify function input parameters, and load them with appropriate values.
 Examine the content and structure of function output parameters.
 Experiment with different parameter values.

BMC Atrium CMDB API print.c routines


The set of print routines for the cmdbdriver program are located in the print.c file.
These routines enable you to print the contents of any data structure in the API.
The routines provide code examples for accessing the various structures. Printing
the contents of a structure before and after an API call is useful for debugging.
The print.h file contains a complete list of these routines. See the function
definitions in print.c to determine the specific parameters and their types for
these routines.

Chapter 2 Getting started

43

BMC Atrium Core 7.6.03

BMC Atrium CMDB API and SQL views


SQL views are available to facilitate data access to BMC Atrium Core from thirdparty database clients. These views provide direct access to the database tables for
BMC Remedy AR System forms, including forms for BMC Atrium Core classes.
For each database table (except for the attachment tables), a corresponding SQL
view is created automatically. These views, which have the same name as their
underlying forms, are created using the following naming rules:

 Alphabetic and numeric characters remain as defined.


 Colons and other special characters are replaced by underscores. For example,
the SQL view for the BMC.CORE:BMC_BaseElement form is named
BMC.CORE_BMC_BaseElement.

 If the name contains a database reserved word, _x is appended to the name.


 View names are limited to 30 characters. When a form name exceeds the limit,
the corresponding view name is truncated to 27 or 28 characters. A schema ID is
appended to the view name to differentiate between any other view that was
truncated to the same string. Because schema IDs vary from one system to
another, these view names cannot be formulated in advance. For example, the
view of the BMC.CORE.CONFIG:BMC_ConfigBaseRelationship form might be
named BMC_CORE_CONFIG_BMC_ConfigB131 or BMC_CORE_CONFIG_BMC_Config2131e

 Abstract classes do not store data, so they have no corresponding views.


For more information about SQL views and table naming conventions, see the
BMC Remedy Action Request System 7.6.03 Database Reference.

44

Developers Reference Guide

Chapter

Finding related CIs

This section describes how to find CIs related to each other using the BMC Atrium
CMDB C API query functions.
Though this section does not discuss specific elements of the Java API and web
services API, the concepts and strategies discussed here are the same for them. For
more information about the query function equivalents in the Java API, see BMC
Atrium CMDB 7.6.03 Javadoc Help installed in the cmdb/sdk/javadoc/cmdbapi/
subdirectory of your BMC Atrium Core installation directory. For more
information about BMC Atrium Core Web Services query operations, see BMC
Atrium Core 7.6.03 Web Services Help.
The following topics are provided:

 Overview of the CMDBQueryByPath function (page 46)


 Overview of the graph walk query functions (page 50)
 Overview of the CMDBGraphQuery function (page 53)

Chapter 3 Finding related CIs

45

BMC Atrium Core 7.6.03

Overview of the CMDBQueryByPath function


You can use the CMDBQueryByPath function to query BMC Atrium CMDB for CI
and relationship information. Use this function when you know the exact
relationship path to follow. For example, to view all computer systems in the
Payroll division, you could use CMDBQueryByPath to query from
BMC_ComputerSystem through a BMC_MemberOfCollection relationship to
BMC_Organization.

Structure of the CMDBQueryByPath function


Unlike the CMDBGraphQuery function, which requires the graph adjacency list to
traverse relationships, the CMDBQueryByPath function takes each qualification as a
structure and dynamically generates the query. Figure 3-1 illustrates the structure
of the CMDBQueryByPath function and its parameters.
Figure 3-1: CMDBQueryByPath structure diagram
CMDBQueryByPath

CMDBQueryStruct
Input parameter that contains the
qualifications and the subset to select
from the query results.

CMDBQueryObjectList
The qualification, class name, and type of
object to query (CI or relationship class).

[0]CMDBQueryObject
[1]CMDBQueryObject

CMDBQueryResultGraph
The results returned by the query.

CMDBQueryObjectOptional
The optional information to return
in the query.

CMDBQueryObjectSelectorList
The query objects to retrieve
in the query results.

CMDBQuerySortList

CMDBInstanceList

CMDBQueryQualifierStruct
The qualifications and details about the
type of query to perform (Simple, nested,
And/OR).

[0]CMDBQueryObjectSelector

[0]CMDBQuerySortStruct

[0]CMDBInstanceStruct

[1]CMDBQueryObjectSelector

[1]CMDBQuerySortStruct

[1]CMDBInstanceStruct

[2]CMDBQueryObjectSelector

[2]CMDBQuerySortStruct

[2]CMDBInstanceStruct

CMDBQueryGraphResult

CMDBNodeListList

CMDBEdgeListList

CMDBNodeList

CMDBRelationshipResultsList

CMDBInstanceList

CMDBRelationshipResult

[2]CMDBQueryObject

If queryObjectType = relationship
Direction (In/Out)

If operation = And/Or
CMDBQueryAndOrStruct
If operation = set (nested query)
CMDBQueryQualifierSetOpStruct
If operation = simple
CMDBQueryQualifierSimpleOpStruct

CMDBQueryQualifierValueSetStruct
The qualifications for a nested query (list
of literal values or a query structure).

If type = valueSet (for example, Model IN


2003, 2000, XP).
ARValueList

If type = query
CMDBNestedQueryStruct

46

Developers Reference Guide

CMDBQueryQualifierValueStruct
The right operand in the query (literal
value, attribute name, or arithmetic
expression).

[0]CMDBInstanceStruct

[0]CMDBInstanceStruct

[1]CMDBInstanceStruct

[1]CMDBInstanceStruct

[2]CMDBInstanceStruct

[2]CMDBInstanceStruct

If type = value (for example,


BMC_ComputerSystem).
ARValueStructIf
If type = attribute name (for example,
C1.classname).
CMDBQueryAttributeName
If type = arithmetic operation (for
example, 90+100).
CMDBQueryArithOpStruct

Legend
Query result structures
Query object structures

Query qualification structures

Overview of the CMDBQueryByPath function

Example: Finding all computers in the payroll division using the


CMDBQueryByPath function
This CMDBQueryByPath example uses a common query scenario, where you want
to search for all computers in a specific division in your organization.
At the fictional Calbro Services company, Allen Albrook wants to view all the
computers in the payroll division to compare their configurations. Because Allen
knows the exact data model path to follow in the query, he uses the
CMDBQueryByPath function in his program.
For information about the CIs and relationships in the common data model, see the
BMC Atrium CMDB 7.6.03 Common Data Model Diagram. The following pseudocode
shows the construct for building the query.
BMC_ComputerSystem --> BMC_MemberOfCollection -->
BMC_Organization['BusinessCategory'==Payroll]

To search for all computers within the payroll division, Allen needs to query the
BMC_ComputerSystem and the BMC_Organization classes that share a
BMC_MemberOfCollection relationship and where the BusinessCategory
attribute of the BMC_Organization class is equal to Payroll.
In the following sample program, Allen creates the queryObjects,
queryObjectsOptional, qObj, and query variables. He then initializes these
variables with specific values and passes them to the CMDBQueryByPath function
as parameters.
/*declare variables*/
CMDBQueryObjectList queryObjects;
CMDBQueryObjectList queryObjectsOptional;
CMDBQueryObject *qObj;
CMDBQueryStruct query;
/*Reset the memory space allocated for the query variable*/
memset(&query, 0, sizeof(CMDBQueryStruct));
/*Set values to the members of the query structure*/
strcpy(query.datasetId, "BMC.ASSET");
query.datasetMask = 0;
/*Reset the memory space allocated for the queryObjects variable*/
memset(&queryObjects, 0, sizeof(CMDBQueryObjectList));

/*Set values to the members of the queryObjects structure*/


queryObjects.numItems = 3;
queryObjects.queryObjectList = (CMDBQueryObject *) calloc(3,
sizeof(CMDBQueryObject));
/* Initialize the qObj CMDBQueryObject structure for the
BMC_ComputerSystem class*/
qObj = &queryObjects.queryObjectList[0];
strcpy(qObj->classNameId.namespaceName,"BMC.CORE");
strcpy(qObj->classNameId.className, "BMC_ComputerSystem ");
Chapter 3 Finding related CIs

47

BMC Atrium Core 7.6.03

strcpy(qObj->alias, "class1");
qObj->qualification = NULL;
/* Initialize the second query object for the
BMC_MemberOfCollection class*/
qObj = &queryObjects.queryObjectList[1];
strcpy(qObj->classNameId.namespaceName,"BMC.CORE");
strcpy(qObj->classNameId.className, "BMC_MemberOfCollection);
strcpy(qObj->alias, "relationship1");
qObj->qualification = NULL;
/* Initialize the third query Object for the BMC_Organization
class*/
qObj = &queryObjects.queryObjectList[2];
strcpy(qObj->classNameId.namespaceName,"BMC.CORE");
strcpy(qObj->classNameId.className, "BMC_Organization ");
strcpy(qObj->alias, "class2");
/*Memory space allocated to contain qualification for the
BMC_Organization class*/
qObj->qualification = ( *) calloc (sizeof(), 1);
/*Specify SIMPLE type operation for the qualification*/
qObj->qualification->operation = CMDB_QUERY_QUAL_OP_SIMPLE;
qObj->qualification->u.simpleOp =
(CMDBQueryQualifierSimpleOpStruct *) calloc
(sizeof(CMDBQueryQualifierSimpleOpStruct), 1);
/*Specify the attribute and arithmetic condition for the
qualification*/
qObj->qualification->u.simpleOp->operation =
CMDB_QUERY_QUAL_SIMPLEOP_EQUAL;
strcpy(qObj->qualification->u.simpleOp->attribute,
"BusinessCategory");
/*Specify the expression to the right of the condition (right
operand)*/
qObj->qualification->u.simpleOp->operandRight =
(CMDBQueryQualifierValueStruct *) calloc
(sizeof(CMDBQueryQualifierValueStruct), 1);
/*Specify the operand type for the right operand*/
qObj->qualification->u.simpleOp->operandRight->type =
CMDB_QUERY_QUAL_VALUE_TYPE_VALUE;
qObj->qualification->u.simpleOp->operandRight->u.value.dataType =
AR_DATA_TYPE_CHAR;
/* Specify the literal value for the comparison in the
qualification*/
qObj->qualification->u.simpleOp->operandRight->u.value.u.charVal =
strdup("Payroll");
/*Specifies the object type for the top level object in the
query*/
48

Developers Reference Guide

Overview of the CMDBQueryByPath function

qObj->queryObjectType = CMDB_QUERY_OBJECT_TYPE_REGULAR;
/*Set the queryObjectsOptional object with 0s to indicate that all
attributes in the CMDBQueryObjectSelectorList object are
required*/
memset(&queryObjectsOptional, 0, sizeof(CMDBQueryObjectList));
/*Initialize the querySelector object*/
memset(&querySelector, 0, sizeof(CMDBQueryObjectSelectorList));
querySelector.numItems = 1;
querySelector.queryObjectSelectorList =
(CMDBQueryObjectSelectorStruct *) calloc(2,
sizeof(CMDBQueryObjectSelectorStruct));
/*Initialize the selector object*/
selector = &querySelector.queryObjectSelectorList[0];
strcpy(selector->alias, "class1");
selector->attributes = (ARNameList *) calloc(sizeof
(ARNameList), 1);
selector->attributes->numItems = 1;
selector->attributes->nameList = (ARNameType *)
calloc(sizeof(ARNameType), 1);
/*Specify the name of the attribute to retrieve*/
strcpy(selector->attributes->nameList[0], "InstanceId");
querySelector.flags = CMDB_QUERY_OBJECTSELECTOR_FLAG_DEFAULT_NONE;
query.queryObjects = &queryObjects;
query.queryObjects = &queryObjectsOptional;
query.queryObjectsToSelect = &querySelector;
query.firstRetrieve = 0;
query.maxRetrieve = 500;
result = CMDBQueryByPath(GetControlStructPtr(),
&query,
&resultStruct,
&status);

Allen wants to query the production dataset for all computer systems in the
Payroll division. Therefore, he sets the datasetId member of the query variable
to BMC.ASSET and the datasetMask member to 0. He then initializes the members
of the queryObjects object and sets the numItems member to 3 to include the
classes identified in the query: BMC_ComputerSystem, BMC_MemberOfCollection,
and BMC_Organization.
Allen sets the qObj variable to the first queryObject object in the
queryObjectList. He then initializes the Namespace, ClassName, alias, and
qualification members to contain information about the BMC_ComputerSystem
class. He initializes the second queryObject object to contain information about
the BMC_MemberOfCollection class. For both BMC_ComputerSystem and
BMC_MemberOfCollection classes, he does not specify any qualification.

Chapter 3 Finding related CIs

49

BMC Atrium Core 7.6.03

Allen initializes the third queryObject object in the list to contain information
about the BMC_Organization class. Because the qualification for this class is to be
specified as BMC_Organization = Payroll, Allen allocates the memory space
for the qualification member. He sets the operation type for the qualification to
CMDB_QUERY_QUAL_OP_SIMPLE.
Allen then specifies the qualification for the BMC_Organization class. He sets the
operation for the u.simpleOp member to CMDB_QUERY_QUAL_SIMPLEOP_EQUAL
and the attribute to BusinessCategory.
Because Allen wants to query all computers in the Payroll division, the expression
to the right of the condition in the query in this case is a literal value. Therefore, he
sets the operand type for the right operand to
CMDB_QUERY_QUAL_VALUE_TYPE_VALUE. He specifies the data type of the value as
AR_DATA_TYPE_CHAR and sets the value for the right operand in the qualification
to Payroll.
Allen sets the queryObjectType member of the qObj object to
CMDB_QUERY_OBJECT_TYPE_REGULAR to indicate that the class information that
qObj structure holds is a regular class. Because this query returns all the attributes
specified in the selector list, he sets the &queryObjectsOptional object to 0s.
Allen then initializes the querySelector object with the numItems member set to
1. He initializes the selector object, which points to the first object in the
querySelector array, with values for the nameList member. Because Allen
requires only the instance IDs of the computer systems, the InstanceId is the only
attribute that is selected from the query result.
Allen sets the flags member of the querySelector object to
CMDB_QUERY_OBJECTSELECTOR_FLAG_DEFAULT_NONE, which means that no
attributes are selected from the query result by default. He sets the queryObjects,
queryObjectsOptional, querySelector, firstRetrieve, and maxRetrieve
members of the query object with the filled-in structures of each of the objects. He
then finally passes these objects to the CMDBQueryByPath function. The query
result is stored in the result variable, which is of type CMDBQueryResultStruct.

Overview of the graph walk query functions


Use the graph walk functions to retrieve CI and relationship instances when you
do not know the exact relationship path to follow, for example, to view all the
dependencies of a computer system regardless of the class to which the
dependencies belong. You must know the instance from which to begin the graph
walk.

The stating node and query loop


To successfully retrieve instances using the graph walk functions, first specify the
start node (CMDBGraphWalkBegin) for the graph walk. Then use the hasNextChunk
member of the CMDBGraphWalkStateStruct structure to loop until you retrieve
all the rows that match the query.
50

Developers Reference Guide

Overview of the graph walk query functions

In the loop, you call the CMDBGraphWalkNext function until the query has no more
records to return. Chunking occurs when the maxRetrieve parameter has a value
greater than 0. Otherwise, the query returns all the nodes in the first call. For
example, if the query retrieves 500 rows of data and the maxRetrieve parameter
is set to 100, the CMDBGraphWalkNext function returns 100 nodes in the first call,
100 nodes in the next, and so on.

Example: Finding all CIs related to an instance of computer system


using the graph walk query functions
This example shows how to use the graph walk query functions in a common
scenario: searching for all CIs related to a specific computer system in your
organization.
At the fictional Calbro Services company, Allen Albrook wants to view all the CIs
related to the CS000000 instance of the BMC_ComputerSystem class. Allen needs to
determine the impact of an outage of the CS000000 CI. Allen does not know the
exact data model path to follow in the query. Therefore, he uses the graph walk
functions in his program.
In the following sample program, Allen first creates the
CMDBGraphWalkQueryStruct, CMDBGraphWalkStateStruct, and
CMDBGraphWalkResultStruct variables, and the
CMDBGraphWalkSelectorAndFilterList data structure in his program. He then
initializes these variables with specific values and passes them to the
CMDBQueryByPath function as parameters.
/*declare variables*/
int
returnCode;
CMDBClassNameId
startClassNameId;
ARNameType
startInstanceId;
CMDBGraphWalkQueryStruct
graphWalkQueryStruct;
CMDBGraphWalkStateStruct
graphWalkStateStruct;
CMDBGraphWalkResultStruct
graphWalkResult;
CMDBGraphWalkSelectorAndFilterList objSelAndFilterList;
CMDBGraphWalkRelation
walkLink;
CMDBGraphWalkRelationList
walkList;
/*Reset the memory space allocated for the query variables*/
memset(&graphWalkStateStruct,0, sizeof(CMDBGraphWalkStateStruct));
memset(&graphWalkResult,0, sizeof(CMDBGraphWalkResultStruct));
memset(&objSelAndFilterList, 0,
sizeof(CMDBGraphWalkSelectorAndFilterList));
memset(&walkLink, 0, sizeof(CMDBGraphWalkRelation));
/*Set values to graph walk flags*/
objSelAndFilterList.attrFlag =
CMDB_GRAPH_WALK_ATTRIBUTE_FLAG_DEFAULT_ALL;
objSelAndFilterList.objFlag =
CMDB_GRAPH_WALK_OBJECT_FLAG_DEFAULT_ALL;

Chapter 3 Finding related CIs

51

BMC Atrium Core 7.6.03

/*Set values to the CMDBGraphWalkRelation and


CMDBGraphWalkRelationList structure members*/
strcpy(walkLink.classNameId.namespaceName, "BMC.CORE");
strcpy(walkLink.classNameId.className, "BMC_BaseRelationship");
walkLink.qualification = NULL;
walkLink.direction = CMDB_RELATIONSHIP_DIRECTION_OUT;
walkList.attrFlag = CMDB_GRAPH_WALK_ATTRIBUTE_FLAG_DEFAULT_ALL;
walkList.numItems = 1;
walkList.walkRelationList = &walkLink;
strcpy(startClassNameId.namespaceName, "BMC.CORE");
strcpy(startClassNameId.className, "BMC_ComputerSystem");
strcpy(startInstanceId, "CS000000");
/*Set values to the CMDBGraphWalkQueryStruct structure members*/
memset(&graphWalkQueryStruct, 0,
sizeof(CMDBGraphWalkQueryStruct));
strcpy(graphWalkQueryStruct.datasetId, "BMC.ASSET");
graphWalkQueryStruct.datasetMask = 0;
graphWalkQueryStruct.maxRetrieve = 10000;
graphWalkQueryStruct.numLevels = 1;
graphWalkQueryStruct.queryMode =
CMDB_GRAPH_WALK_WALK_COMPLETE_GRAPH;
graphWalkQueryStruct.objSelectorAndFilterList =
objSelAndFilterList;
graphWalkQueryStruct.walkRelationList = walkList;
/*Call the CMDBGraphWalkBegin function
int returnCode = CMDBGraphWalkBegin(
control, &startClassNameId, startInstanceId,
&graphWalkQueryStruct, &graphWalkStateStruct, &status );
if( returnCode >= AR_RETURN_ERROR)
{return returnCode;}
/* Loop until the next chunk of rows are available for
retrieving*/
while(graphWalkStateStruct.hasNextChunk == TRUE)
{
/*call the CMDBGraphWalkNext to retrieve the next chunk of rows*/
returnCode = CMDBGraphWalkNext(
control,
&graphWalkStateStruct, &graphWalkResult, &status );
if( returnCode >= AR_RETURN_ERROR)
{
return returnCode;
}
/* Process the results here */
FreeCMDBGraphWalkResultStruct(&graphWalkResult, FALSE);
}
/*End the graph walk*/
returnCode = CMDBGraphWalkEnd(control, &graphWalkStateStruct,
&status);
FreeCMDBGraphWalkStateStruct(&graphWalkStateStruct, FALSE);
Return returnCode;

52

Developers Reference Guide

Overview of the CMDBGraphQuery function

In the program, Allen sets the namespaceName member of the


CMDBGraphWalkRelation structure to BMC.CORE and the className of the type of
relationships to walk to BMC_BaseRelationship. Allen wants to retrieve only the
destination relationships for the CS000000 instance. Therefore, he sets the
qualification for the relationship walk to NULL and the walk direction to
CMDB_RELATIONSHIP_DIRECTION_OUT (destination).
Allen sets the namespaceName and className members of the startClassNameId
variable to BMC.CORE and BMC_ComputerSystem, respectively. He sets the
startInstanceId to CS000000.
Because Allen wants to retrieve instances from the production dataset, he sets the
datasetId member of the graphWalkQueryStruct variable to BMC.ASSET and the
datasetMask member to 0. He sets the maxRetrieve member to 10000 and the
numLevels to 1 to indicate that he wants to enable chunking.
Allen passes the startClassNameId, startInstanceId,
graphWalkQueryStruct, and graphWalkStateStruct parameters as inputs to
the CMDBGraphWalkBegin function. The hasNextChunk member of the
graphWalkStateStruct parameter now contains a value of TRUE to indicate that
the next chunk of rows is available to be retrieved.
Allen calls the CMDBGraphWalkNext function in a While loop with the
hasNextChunk member as the condition. The next chunk of rows will be retrieved
until hasNextChunk is equal to TRUE. He then calls the CMDBGraphWalkEnd
function to end the graph walk query.
The query that Allen constructed in this example returns all the relationships of the
CS000000 instance in the BMC.ASSET dataset where the CS000000 instance is the
source.

Overview of the CMDBGraphQuery function


With the graph query function, you can explore (walk) the graph of CIs and
relationships in the BMC Atrium CMDB, starting with a specified CI and following
its relationships to other CIs, continuing along the graph for as many levels as you
want. This section provides a context for these graphs, and then explains how the
graph query works. For a description of the CMDBGraphQuery function, see
CMDBGraphQuery function on page 116.

NOTE
The CMDBGraphQuery function is a legacy method of building queries, and has
been replaced with the newer graph walk functions. If you know the starting
instance of your query, use the graph walk functions.
For the CMDBGraphQuery function, you must know the adjacent nodes to traverse
in the graph. To avoid this issue, use the CMDBQueryByPath or graph walk
functions.

Chapter 3 Finding related CIs

53

BMC Atrium Core 7.6.03

Graph representation
You can represent a graph G = (V, E), in two standard ways: as a collection of
adjacency lists or as an adjacency matrix. The adjacency-list representation is more
common, because it provides a compact way to represent sparse graphsthose for
which |E| is much less than |V|2. However, an adjacency-matrix representation
might be better when the graph is dense, |E| is close to |V|2. The representation
used by the CMDBGraphQuery input query graph is an adjacency list.
The adjacency-list representation of a graph G = (V, E) consists of an array Adj
of |V| lists, one for each vertex in V. For each u in the set of V, the adjacency list
Adj[u] contains pointers to all the vertices v such that there is an edge (u, v) in
the set of E. That is, Adj[u] consists of all the vertices adjacent to u in G. The vertices
in each adjacency list are typically stored in an arbitrary order. Figure 3-2 (b) is an
adjacency-list representation in an arbitrary order of the undirected graph in
Figure 3-2 (a).
Figure 3-2: Undirected graph and its equivalent adjacency list

NOTE
In an undirected graph G = (V, E), the edge set E consists of unordered pairs of
vertices, rather than ordered pairs. That is, an edge is a set {u, v}, where (u, v)
in the set of E, and u is not equal to v. In an undirected graph, self-loops are
forbidden, so every edge consists of exactly two distinct vertices.

54

Developers Reference Guide

Overview of the CMDBGraphQuery function

Similarly, Figure 3-3 (b) is an adjacency-list representation of the directed graph in


Figure 3-3 (a). In the BMC Atrium Core, all relationships are directional, so the
query graph is a directed graph. In this graph, each relationship instance is like an
edge and each CI instance is like a vertex.
Figure 3-3: Directed graph and its equivalent adjacency list

Examples of the CMDBGraphQuery function


This section explains two example graph queries that operate against the CI and
relationship data illustrated as a graph in Figure 3-4 on page 56. In the graph, CI
instances are circular nodes and relationship instances are the lines connecting
them.

Chapter 3 Finding related CIs

55

BMC Atrium Core 7.6.03

Figure 3-4: Graph of data used with example queries

56

Developers Reference Guide

Overview of the CMDBGraphQuery function

Example: Walking a specific type of relationship for a CI instance using


the CMDBGraphQuery function
Suppose that you start on a CI instance of class A:A with instance ID 1 and walk
relationships of class A:rAA, which represents a relationship with A:A instances on
both ends. You want to walk outward to the last level, so the value of the
numLevels argument is -1. The instances of A:rAA and A:A have no qualifications.
For return data, you are retrieving all of the attributes of the relationship instances
and the CI instances.
Graphically, the query that you want to walk is illustrated in Figure 3-5. For the
same query, the graph can be represented either as (a) or (b). In representation (a),
the class A:A appears twice. To distinguish one instance of A:A from the other, you
need an extensionId. In this example, one of the instances is assigned the
arbitrary extensionId of two.
Figure 3-5: Graph of query example 1

Figure 3-6 shows the data structures of the queryGraph argument for Figure 3-5
(a). Figure 3-7 on page 58 shows the data structures of the queryGraph argument
for Figure 3-5 (b).

Chapter 3 Finding related CIs

57

BMC Atrium Core 7.6.03

Figure 3-6: queryGraph data structures for Figure 3-5 (a)

Figure 3-7: queryGraph data structures for Figure 3-5 (b)

The path taken to walk this graph is shown by the bolded relationships in
Figure 3-8 on page 59. The bolded nodes are those returned in the objects list.

58

Developers Reference Guide

Overview of the CMDBGraphQuery function

Figure 3-8: Path walked and nodes returned by query example 1

The expected data to be returned is:

 Seven CI instances of A:A with instance IDs 2, 3, 8, 4, 5, 6, and 7.


 Eight relationship instances of A:rAA with instance IDs 1, 2, 3, 4, 5, 9, 6, and 7.

Chapter 3 Finding related CIs

59

BMC Atrium Core 7.6.03

Example: Walking multiple types of relationships for a CI instance


using the CMDBGraphQuery function
Suppose that you start on a CI instance of class A:A with instance ID 1 and walk
relationships of class A:rAB, which represents a relationship with an A:A instance
as the source and an A:B instance as the destination. From A:B you want to walk
relationship A:rBA, which has class A:B as the source and class A:A as the
destination. You want to walk outward to the last level, so the value of the
numLevels argument is -1. The instances of the CI and relationship classes have
no qualifications. You are retrieving all of the attributes of the relationship
instances and the CI instances.
Graphically, the query you want to walk is illustrated in Figure 3-9. As with
example 1, the graph for this query can be represented either as (a) or (b). In
representation (a), the class A:A appears twice. To distinguish one instance of A:A
from the other, an extensionId is needed. In this example, one of the instances is
assigned the arbitrary extensionId of two.
Figure 3-9: Graph of Query Example 2

Figure 3-10 on page 61 shows the data structures of the queryGraph argument for
Figure 3-9 (a). Figure 3-11 on page 62 shows the data structures of the queryGraph
argument for Figure 3-9 (b).

60

Developers Reference Guide

Overview of the CMDBGraphQuery function

Figure 3-10: queryGraph data structures for Figure 3-9 (a)

Chapter 3 Finding related CIs

61

BMC Atrium Core 7.6.03

Figure 3-11: queryGraph data structures for Figure 3-9 (b)

The path taken to walk this graph is shown by the bolded relationships in
Figure 3-12 on page 63. The bolded nodes are those returned in the objects list.

62

Developers Reference Guide

Overview of the CMDBGraphQuery function

Figure 3-12: Path walked and nodes returned by Query Example 2

The expected data to be returned is:

 Six CIs. Three are instances of A:A with instance IDs 8, 5, and 9. Three are
instances of A:B with instance IDs 1, 3, and 2.

 Six relationships. Three are instances of A:rAB with instance IDs 1, 3, and 2.
Three are instances of A:rBA with instance IDs 1, 2, and 3.

Chapter 3 Finding related CIs

63

BMC Atrium Core 7.6.03

64

Developers Reference Guide

Chapter

C API functions

This section provides reference information for the C API functions, which are
defined in the cmdb.h and cmdbfree.h header files. For a complete list of header
files required for BMC Atrium Core, see BMC Atrium CMDB C API header files
on page 29.
The following topics are provided:


























Types of BMC Atrium CMDB C API functions (page 67)


CMDBActivateFederatedInContext function (page 71)
CMDBBeginBulkEntryTransaction function (page 72)
CMDBCancelJobRun function (page 73)
CMDBCreateAttribute function (page 74)
CMDBCreateClass function (page 77)
CMDBCreateGuid function (page 80)
CMDBCreateInstance function (page 81)
CMDBCreateMultipleAttributes function (page 82)
CMDBCreateMultipleInstances function (page 85)
CMDBDeleteAttribute function (page 86)
CMDBDeleteClass function (page 87)
CMDBDeleteInstance function (page 88)
CMDBDeleteMultipleInstances function (page 89)
CMDBEndBulkEntryTransaction function (page 90)
CMDBExpandParametersForCI function (page 91)
CMDBExportData function (page 92)
CMDBExportDef function (page 93)
CMDBGetAttribute function (page 94)
CMDBGetClass function (page 97)
CMDBGetCopyAuditData function (page 100)
CMDBGetInstance function (page 102)
CMDBGetInstanceBLOB function (page 103)
CMDBGetListClass function (page 104)

Chapter 4 C API functions

65

BMC Atrium Core 7.6.03






























66

CMDBGetListInstance function (page 105)


CMDBGetMultipleAttributes function (page 107)
CMDBGetMultipleInstances function (page 110)
CMDBGetCMDBUIComponents function (page 111)
CMDBGetJobRun function (page 112)
CMDBGetListJobRun function (page 113)
CMDBGetRelatedFederatedInContext function (page 114)
CMDBGetServerPort function (page 115)
CMDBGetVersions function (page 115)
CMDBGraphQuery function (page 116)
CMDBGraphWalkBegin function (page 118)
CMDBGraphWalkEnd function (page 119)
CMDBGraphWalkNext function (page 120)
CMDBImportData function (page 121)
CMDBImportDef function (page 122)
CMDBInitialization function (page 123)
CMDBQueryByPath function (page 124)
CMDBRunQualificationForCI function (page 125)
CMDBSetAttribute function (page 126)
CMDBSetClass function (page 128)
CMDBSetInstance function (page 131)
CMDBSetMultipleAttributes function (page 133)
CMDBSetMultipleInstances function (page 135)
CMDBSetServerPort function (page 136)
CMDBStartJobRun function (page 137)
CMDBSynchMetaData function (page 138)
CMDBSystemInit function (page 139)
CMDBTermination function (page 139)

Developers Reference Guide

Types of BMC Atrium CMDB C API functions

Types of BMC Atrium CMDB C API functions


The BMC Atrium CMDB C API functions are categorized by the type of action that
they perform, as listed in Table 4-1. To use the C API functions in your program,
you must have the following BMC Atrium CMDB permissions depending on the
specific function type:

 CMDB Definitions AdminFor working with data model definitions, such as


CMDBCreateClass, CMDBDeleteClass, CMDBCreateAttribute, and
CMDBCreateMultipleAttributes. For more information about these functions,

see the data model functions in Table 4-1.

 CMDB RE UserFor working with the Reconciliation Engine functions, such as


CMDBGetJobRun and CMDBCancelJobRun. For more information about these

functions, see the Reconciliation Engine functions in Table 4-1.

 CMDB Data Change AllFor all other functions with which you manipulate the
data in BMC Atrium CMDB.
Table 4-1: List of functions categorized by type (Sheet 1 of 4)
Function type

Function list

Bulk-entry transaction functions: Invoke the


bulk-entry API functions.

 CMDBBeginBulkEntryTransaction
 CMDBEndBulkEntryTransaction

Copy functions: Copy the values of one C API  CopyCMDBGraphWalkQueryStruct


structure to another.
 CopyCMDBGraphWalkSelectorAndFilterList
The copy structures return an integer value
 CopyCMDBGraphWalkSelectorAndFilterStruct
that indicate whether the copy operation was  CopyCMDBGraphWalkRelation
a success or a failure. A value of 1 indicates
 CopyCMDBGraphWalkRelationList
success.
 CopyCMDBGraphWalkResultStruct
Each of the copy functions accepts the
 CopyCMDBInstanceList
following parameters:
 CopyCMDBInstanceStruct
 dstA pointer to the destination structure
 CopyCMDBNestedQueryStruct
to which you want to copy the values.
 srcA pointer to the source structure from  CopyCMDBQueryQualifierStruct
 CopyCMDBQueryQualifierValueStruct
which you want to copy values.
 CopyCMDBQueryObject
 CopyCMDBQueryObjectList
 CopyCMDBQueryObjectSelectorList
 CopyCMDBQueryStruct
 CopyCMDBQuerySortStruct
 CopyCMDBQuerySortList

Chapter 4 C API functions

67

BMC Atrium Core 7.6.03

Table 4-1: List of functions categorized by type (Sheet 2 of 4)


Function type

Function list

Data model functions: Manipulate the BMC  CMDBCreateAttribute


Atrium CMDB class and attribute definitions.  CMDBCreateClass
 CMDBCreateMultipleAttributes
 CMDBDeleteAttribute
 CMDBDeleteClass
 CMDBGetAttribute
 CMDBGetClass
 CMDBGetListClass
 CMDBGetMultipleAttributes
 CMDBSetAttribute
 CMDBSetClass
 CMDBSetMultipleAttributes
 CMDBSynchMetaData
Environment functions: Initialize, set, or
query information about the API
environment.







CMDBGetServerPort
CMDBInitialization
CMDBSetServerPort
CMDBSystemInit
CMDBTermination

Export and import functions: Export and


import BMC Atrium CMDB definitions and
data.






CMDBExportData
CMDBExportDef
CMDBImportData
CMDBImportDef

Federation functions: Work with federated


data for an instance.






CMDBActivateFederatedInContext
CMDBExpandParametersForCI
CMDBGetRelatedFederatedInContext
CMDBRunQualificationForCI

68

Developers Reference Guide

Types of BMC Atrium CMDB C API functions

Table 4-1: List of functions categorized by type (Sheet 3 of 4)


Function type

Function list







Each of these free functions accept two

parameters:

 valueA pointer to the structure you
want to free. The function recursively frees 
all allocated memory within that structure. 
If you specify NULL for this parameter (or the 
structure is a list with zero items), the

function performs no operations.

 freeStructA Boolean value that

indicates whether to free the top level
structure. If you allocated memory for the 

top level structure, specify TRUE to free
both the structure and its contents. If you

used a stack variable for the top level

structure, specify FALSE to free only the

contents of the structure.

























Free functions: Release the memory space
allocated to the specified C API structure.
When you allocate memory space for
parameters that various functions require,
you must release the memory when it is no
longer required.

FreeCMDBAttributeGetStruct
FreeCMDBAttributeLimit
FreeCMDBAttributeLimitList
FreeCMDBAttributeLimitStruct
FreeCMDBAttributeValueList
FreeCMDBAttributeValueListList
FreeCMDBAuditInfoStruct
FreeCMDBAuditValueList
FreeCMDBAuditValueListList
FreeCMDBClassNameIdList
FreeCMDBClassTypeInfo
FreeCMDBExportItemList
FreeCMDBExportItemStruct
FreeCMDBFederatedActivateInfo
FreeCMDBGetObjectList
FreeCMDBGetRelationList
FreeCMDBGraphAdjacentList
FreeCMDBGraphAdjacentStruct
FreeCMDBGraphList
FreeCMDBGraphStruct
FreeCMDBGraphWalkObjectStruct
FreeCMDBGraphWalkObjectList
FreeCMDBGraphWalkQueryStruct
FreeCMDBGraphWalkRelation
FreeCMDBGraphWalkRelationList
FreeCMDBGraphWalkResultStruct
FreeCMDBGraphWalkSelectorAndFilterList
FreeCMDBGraphWalkSelectorAndFilterStruct
FreeCMDBGraphWalkStateStruct
FreeCMDBIndexList
FreeCMDBNestedQueryStruct
FreeCMDBQualifierStruct
FreeCMDBImportItemList
FreeCMDBIndexList
FreeCMDBInstanceList
FreeCMDBQueryObject
FreeCMDBQueryObjectList
FreeCMDBQueryObjectSelectorList
FreeCMDBQueryQualifierStruct
FreeCMDBQueryQualifierValueStruct
FreeCMDBQueryResultGraph
FreeCMDBQueryStruct
FreeCMDBQuerySortStruct
FreeCMDBQuerySortList
Chapter 4 C API functions

69

BMC Atrium Core 7.6.03

Table 4-1: List of functions categorized by type (Sheet 4 of 4)


Function type

Function list





Note: When you use the bulk functions, such as 
CMDBCreateMultipleInstances and

CMDBDeleteMultipleInstances, to

manipulate one or more instances, the

success of the operation depends on the

complete call. For example, if an error is
encountered when creating a particular

instance in the bulk function, the entire

operation is rolled back and none of the
instances are created.

Instance functions: Manipulate the BMC


Atrium CMDB data, such as creating and
deleting instances, getting and setting
instances, and querying instances.

CMDBCreateInstance
CMDBCreateMultipleInstances
CMDBDeleteInstance
CMDBDeleteMultipleInstances
CMDBGetCopyAuditData
CMDBGetInstance
CMDBGetInstanceBLOB
CMDBGetListInstance
CMDBGetMultipleInstances
CMDBSetInstance
CMDBSetMultipleInstances

Query functions: Find related CIs depending  CMDBGraphQuery


on the information that you need to retrieve  CMDBGraphWalkBegin
about CI and relationship instances.
 CMDBGraphWalkEnd
 CMDBGraphWalkNext
 CMDBQueryByPath
Reconciliation Engine functions: Manipulate
Reconciliation Engine jobs.






CMDBCancelJobRun
CMDBGetJobRun
CMDBGetListJobRun
CMDBStartJobRun

User interface component functions:


 CMDBGetCMDBUIComponents
Manipulate BMC Atrium CMDB components,
such as tooltips, icons, and labeled strings.

 CMDBCreateGuid
Utility functions: Use BMC Atrium CMDB
utilities to generate globally unique identifiers  CMDBGetVersions
(GUIDs) and get version information.

70

Developers Reference Guide

CMDBActivateFederatedInContext function

CMDBActivateFederatedInContext function
The CMDBActivateFederatedInContext function expands the
BMC_FederatedInterface instance for a specific CI. Depending on a flag that you
specify when you call this function, your federated instance might be either only
expanded or expanded and launched.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBActivateFederatedInContext(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

datasetId,

ARNameType

instanceId,

ARNameType

federatedInstanceId,

unsigned int

activateOption,

CMDBFederatedActivateInfo

*federatedInfo,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe class name for which to expand or launch the federated


instance. The classNameID argument contains the namespace name and the
unique class name.

 datasetIdThe unique identifier for the dataset. The data in the return values
are based on the dataset ID specified.

 instanceIdThe instance ID of the specified instance for which the federated


instance is to be expanded or launched.

 federatedInstanceIdThe instance ID of the federated instance that is to be


expanded or launched.

 activateOptionThe mask number that indicates whether the federated


instance is to be launched and expanded. Specify a value of 1 for this parameter
to return information in federatedInfo.
0: Activate NoneNo BMC_FederatedInterface instance to be activated
(CMDB_FEDERATION_ACTIVATION_NONE).
1 << 0: Activation ExpandOnly activate the specified
BMC_FederatedInterface instance
(CMDB_FEDERATION_ACTIVATION_EXPAND). No launch required.
Chapter 4 C API functions

71

BMC Atrium Core 7.6.03

1 << 1: Activation LaunchActivate and launch the specified


BMC_FederatedInterface instance
(CMDB_FEDERATION_ACTIVATION_LAUNCH).

Return values
 federatedInfoThe expanded federated instance information.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBBeginBulkEntryTransaction function
The CMDBBeginBulkEntryTransaction function enables you to invoke API
functions within a bulk transaction construct. Any API calls that arrive after this
function call are placed in a queue. Data model functions are not part of the bulk
transaction.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBBeginBulkEntryTransaction(
ARControlStruct

*control,

ARStatusList

*status)

Input argument
ControlThe control record for the operation, which contains information about

the user requesting the operation and the server on which the operation is to be
performed.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

72

Developers Reference Guide

CMDBCancelJobRun function

CMDBCancelJobRun function
The CMDBCancelJobRun function cancels a currently running Reconciliation
Engine job. Depending on the system resources, the Reconciliation Engine might
cancel a job with a certain delay.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBCancelJobRun(
ARControlStruct

*control,

ARNameType

jobRunId,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 jobRunIdA unique job identifier.

Return value
statusA list of zero or more notes, warnings, or errors.

Chapter 4 C API functions

73

BMC Atrium Core 7.6.03

CMDBCreateAttribute function
The CMDBCreateAttribute function creates a new attribute with the specified
name for the specified class.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBCreateAttribute(
ARControlStruct

*control,

CMDBClassNameId

classNameID,

ARNameType

attributeName,

ARNameType

attributeId,

unsigned int

dataType,

ARInternalId

*arsubclassesId,

unsigned int

entryMode,

CMDBAttributeLimit

*attributeLimit,

ARValueStruct

*defaultValue,

ARPropList

*characList,

ARPropList

*customCharacList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class for which you want to create an attribute.
The classNameID argument contains the namespace name and the unique class
name.

 attributeNameThe name of the attribute to create. The name of the attribute


must be unique within the specified class and within its superclasses and
subclasses.

 attributeIdThe ID of the attribute to create.


 dataTypeThe data type of the new attribute. Data types not listed are either
unsupported or display fields.
1: Keyword (CMDB_ATTR_DATA_TYPE_KEYWORD)
2: Integer (CMDB_ATTR_DATA_TYPE_INTEGER)
3: Real (CMDB_ATTR_DATA_TYPE_REAL)
4: Character (CMDB_ATTR_DATA_TYPE_CHAR)

74

Developers Reference Guide

CMDBCreateAttribute function

5: Diary (CMDB_ATTR_DATA_TYPE_DIARY)
6: Selection (CMDB_ATTR_DATA_TYPE_ENUM)
7: Time (CMDB_ATTR_DATA_TYPE_TIME)
10: Fixed-point decimal (CMDB_ATTR_DATA_TYPE_DECIMAL)
11: Attachment (CMDB_ATTR_DATA_TYPE_ATTACH)
12: Currency (CMDB_ATTR_DATA_TYPE_CURRENCY)
13: Date (CMDB_ATTR_DATA_TYPE_DATE)
14: Time of day (CMDB_ATTR_DATA_TYPE_TIME_OF_DAY)
37: Attachment pool (CMDB_ATTR_DATA_TYPE_ATTACH_POOL)

 arsubclassesIdThe BMC Remedy AR System subclass ID of the new


attribute. The IDs of all attributes must be unique within the class. If you want
the system to generate the ID, specify 0 for this parameter.

 entryModeThe entry mode for the attribute. Entry modes not listed are for
BMC Software internal use.
1: RequiredUsers must enter data (CMDB_ATTR_ENTRYMODE_REQUIRED).
2: OptionalUsers do not have to enter data, but they can if needed
(CMDB_ATTR_ENTRYMODE_OPTIONAL).
4: Display onlyUsers cannot enter data
(CMDB_ATTR_ENTRYMODE_DISPLAY_ONLY).

 attributeLimitThe value limits for the attribute and other properties


specific to the attributes type. See the CMDBsubclassesLimitStruct definition
in cmdb.h to find the contained structure that applies to the type of attribute
that you are creating. The limits and properties that you assign must be of the
same data type as the attribute. If you do not want to change the attribute limits
and properties, specify NULL for this parameter.

 defaultValueThe value to apply if a user submits an entry with no value for


the new attribute. The default value can be up to 255 bytes and must be of the
same data type as the attribute. If you do not want to specify a default value,
specify NULL.

 characListA list of characteristics for the attribute. Characteristics not listed


are not applicable for creating attributes.
1: View PermissionsSpecify a list of groups or roles that have permissions to
view this attribute (CMDB_ATTR_CHARAC_VIEW_PERMS). When querying for

attributes, you see all attributes, including the hidden attributes. You can specify
one or more group IDs or role IDs for the permissions, separated by a semicolon,
for example, 20;-5.
2: Change PermissionsSpecify a list of groups or roles that have permissions

to view and modify the characteristics of the attribute


(CMDB_ATTR_CHARAC_CHANGE_PERMS).

Chapter 4 C API functions

75

BMC Atrium Core 7.6.03

3: HiddenSet the flag to false so that this attribute is hidden


(CMDB_ATTR_CHARAC_HIDDEN). This setting marks the attribute as hidden for a

group or a role. When querying for classes, you can retrieve hidden attributes.
You can specify one or more group IDs or role IDs for the permissions, separated
by a semicolon, for example, 20;3.
5: Propagated OwnerThe class ID and the attribute ID of the lead class

attribute from which the attribute is propagated


(CMDB_ATTR_CHARAC_PROPAGATED_OWNER). The format for this value is
sourceAttributeId;destinationAttributeId|sourceAttributeId;desti
nationAttributeId|[additionalPairs].
6: Create ModeSet permissions for specifying data for the attribute
(CMDB_ATTR_CHARAC_CREATE_MODE).
0CMDB_ATTR_CREATE_MODE_NONENo permissions specified for the

attribute.
1CMDB_ATTR_CREATE_MODE_OPENAnyone can specify a value for the

attribute.
2CMDB_ATTR_CREATE_MODE_PROTECTEDOnly users with permissions can

specify a value for the attribute.


7: Audit OptionSet the audit option on to store the audit history for the
attribute (CMDB_ATTR_CHARAC_AUDIT_OPTION).
8: NamespaceSet the namespace of the attribute
(CMDB_ATTR_CHARAC_NAMESPACE).
9: DescriptionSet the description for the attribute
(CMDB_ATTR_CHARAC_DESCRIPTION).
10: Federation External NameSpecify external name for attributes of a
federated class that are mapped by way of Vendor AR System database
connectivity (ARDBC) plug-in
(CMDB_ATTR_CHARAC_FEDERATION_EXTERNAL_NAME).

 customCharacListA list of user-defined custom characteristics for the


attribute. The attributes must be between 300000
(CMDB_ATTR_CUSTOM_CHARAC_MIN) and 399999
(CMDB_ATTR_CUSTOM_CHARAC_MAX). After the properties list structure that you
specify is serialized, it is converted into the following format:
listSize propId dataType propValue
listSize: The number of items in the properties list.
propId: The ID for the property, which is within the 300000399999 range.
dataType: The native data type for the property.
propValue: The value for the property. An example for the serialized property
list is 1\300050\2\1.

76

Developers Reference Guide

CMDBCreateClass function

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

CMDBCreateClass function
The CMDBCreateClass function creates a class with the core attributes in the
OBJSTR:Class. The data model is stored in the OBJSTR:Class form, and the
attribute information is stored in the OBJSTR:AttributeDefinition form.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBCreateClass(
ARControlStruct

*control,

CMDBClassNameId

*classNameID,

ARNameType

classID,

CMDBClassTypeInfo

*classTypeInfo,

CMDBClassNameId

*superclassNameId,

CMDBIndexList

*indexList,

CMDBAuditInfoStruct

*auditInfo,

ARPropList

*characList,

ARPropList

*customCharacList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIDThe name of the class to create. The classNameID argument


contains the namespace name and the unique class name.

 classIDThe unique identifier for the class. It can be provided by the user. If
left blank, the class ID is automatically generated by the system.

 classTypeInfoThe type of class to create:


1: Regular class (CMDB_CLASS_TYPE_REGULAR).
2: Relationship (CMDB_CLASS_TYPE_RELATIONSHIP).
3: Federated (CMDB_CLASS_TYPE_FEDERATED).
4: Relationship class for a federated class
(CMDB_CLASS_TYPE_FEDERATED_RELATIONSHIP).
Chapter 4 C API functions

77

BMC Atrium Core 7.6.03

 superclassNameIDThe superclass of this class. If the class has no superclass,


specify NULL for this parameter.

 indexListA list of indexes defined for the class.


 auditInfoThe audit information for the class: audit type, qualification, and
Audit Only Changed Fields (auditMask). Use the following auditMask values:

 CMDB_CLASS_AUDITCHANGE_DEFAULT = 0Use the value of the Disable


Audit Only Change Fields system setting on the BMC Remedy AR System
server. The system setting default is that only changing the attribute to a
different value triggers auditing.

 CMDB_CLASS_AUDITCHANGE_YES = 1Audit when an updated field value is


different than the existing value.

 CMDB_CLASS_AUDITCHANGE_NO = 2Audit when a field value is modified,


even if the updated value is the same as the existing value.

 characListA list of characteristics for the class. Specify NULL for this
parameter if you do not want to associate characteristics with this class.
Characteristics not listed are for BMC Software internal use.
1: SingletonUsed to specify if this is a singleton class. This characteristic is an
integer value where type CMDB_CLASS_CHARAC_SINGLETON_FALSE indicates
that this is not a singleton class. Type CMDB_CLASS_CHARAC_SINGLETON_TRUE
indicates that this is a singleton class (CMDB_CLASS_CHARAC_SINGLETON).
2: AbstractThis property does not allow you to create instances for this
abstract class (CMDB_CLASS_CHARAC_ABSTRACT). After the property has been

set for the attribute, you cannot create instances for it. All the attributes are
propagated to the subclasses.
3: FinalYou cannot create subclasses from this class
(CMDB_CLASS_CHARAC_FINAL).
4: AuthorThe author of the class (CMDB_CLASS_CHARAC_AUTHOR).
5: DescriptionThe class description (CMDB_CLASS_CHARAC_DESCRIPTION).
6: Hidden PermissionGives you the permissions to modify the class
(CMDB_CLASS_CHARAC_CLASS_HIDDEN_PERMS). Marks the class as hidden for a

group or a role. When querying for classes, you can choose to retrieve hidden
classes. You can specify one or more group IDs or role IDs for the permissions
separated by a semicolon, for example, 20;3.
7: Visible PermissionGives you the permissions to modify the class
(CMDB_CLASS_CHARAC_CLASS_VISIBLE_PERMS). Marks the class as visible for a

group or a role. When querying for classes, you will see all classes, including the
hidden classes. You can specify one or more group IDs or role IDs for the
permissions separated by a semicolon, for example, 20;-5.
8: SubclassCMDB_CLASS_CHARAC_CATEGORIZATION_SUBCLASS
9: Form nameCMDB_CLASS_CHARAC_FORM_NAME

78

Developers Reference Guide

CMDBCreateClass function

10: ExposureThe visibility of the class, which can be


CMDB_CLASS_EXPOSURE_NONE, CMDB_CLASS_EXPOSURE_USED_VISIBLE, or
CMDB_CLASS_EXPOSURE_USED_HIDDEN.
12: Federation schema typeAllows you to specify the schema type for
federation (CMDB_CLASS_CHARAC_FEDERATION_SCHEMA_TYPE). This

characteristic is an integer data type, where:


0CMDB_FEDERATION_SCHEMA_REGULARIndicates that the schema is not of

type federation. 0 is the default value for this characteristic.


1CMDB_FEDERATION_SCHEMA_VENDORIndicates that the schema type is an
BMC Remedy AR System Vendor form.
13: Federation vendor nameAllows you to specify the name of the vendor

form or ARDBC plug-in name


(CMDB_CLASS_CHARAC_FEDERATION_VENDOR_NAME). Specify this characteristic
only if you set the CHARAC_FEDERATION_SCHEMA_TYPE characteristic to 1.
14: Federation vendor table nameAllows you to specify the name of the data

store from which the federated data class will retrieve the data
(CMDB_CLASS_CHARAC_FEDERATION_VENDOR_TABLE_NAME). Specify this
characteristic only if you set the CHARAC_FEDERATION_SCHEMA_TYPE
characteristic to 1.
15: Relation typeAllows you to specify the type of relationship for the
federated class (CMDB_CLASS_CHARAC_RELATION_TYPE). This characteristic,

which only applies to relationship classes, is an integer data type, where:


0CMDB_RELATION_REGULARIndicates a regular relationship that relates

two CI endpoints.
1CMDB_RELATION_QUERYIndicates that the relation type is a query used for

join conditions. 0 is the default value for this characteristic.


16: BMC Remedy AR System qualificationAllows you to specify the BMC

Remedy AR System qualification, which defines how the source class links to
the destination class in federated relationship classes
(CMDB_CLASS_CHARAC_RELATION_LINK_QUALIFIER).
17: Number of temp tablesAllows you to define the maximum number of

temporary tables to create for vendor forms


(CMDB_CLASS_CHARAC_NUM_TEMP_TABLES). Do not specify a value for the

characteristic if you are working with regular (non-vendor) forms.


18: Requires qualifier for the queryAllows you to specify whether a
qualification is required for the federated class in the CMDBQueryByPath
function (CMDB_CLASS_CHARAC_REQUIRES_QUALIFIER_FOR_QUERY). This

characteristic is an integer data type, where:


0CMDB_QUAL_RESTRICITVEIndicates that no qualification is required for

the query.

Chapter 4 C API functions

79

BMC Atrium Core 7.6.03

1CMDB_QUAL_NON_RESTRICITVEIndicates that a qualification is required


for the federated class. 1 is the default value for this characteristic. For

performance reasons, BMC recommends that you do not set this value if you
have a lot of data in the external data store and you have not specified any
qualifications against the federated data class that maps to it.

 customCharacListA list of user-defined custom characteristics for the class.


The ID for each list item can be set to any user-defined characteristic but must
be between 100000 (CMDB_CLASS_CUSTOM_CHARAC_MIN) and 199999
(CMDB_CLASS_CUSTOM_CHARAC_MAX). If you do not want to associate custom
characteristics with this class, specify NULL for this parameter. After the
properties list structure you specify is serialized, it is converted into the
following format: listSize propId dataType propValue
listSize: The number of items in the properties list.
propId: The ID for the property, which is within the 100000199999 range.
dataType: The data type for the property, which can be of any native data type.
propValue: The value for the property.

An example for the serialized property list is 1\100050\2\1.

Return values
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

CMDBCreateGuid function
The CMDBCreateGuid function creates a globally unique identifier (GUID).

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBCreateGuid(
ARGuid

guid,

ARStatusList

*status)

Return values
 guidThe unique identifier (system-generated).
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

80

Developers Reference Guide

CMDBCreateInstance function

CMDBCreateInstance function
The CMDBCreateInstance function creates a CI or relationship instance of the
specified class.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBCreateInstance(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

datasetId,

CMDBAttributeValueList

*attributeValueList,

ARNameType

instanceId,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class from which the instance is created. The
classNameID argument contains the namespace name and the unique class

name.

 datasetIdThe unique identifier for the dataset. Instances are created in a


dataset based on the value specified in this parameter.

 attributeValueListA list of one or more attribute and value pairs


(specified in any order) that identifies the data for the new attributes. You must
specify values for all required attributes that do not have defined defaults.
Values must be of the data type defined for the attributes or have a data type of
0. NULL values can be specified for optional attributes only. An error is
generated if an attribute does not exist or the user specified by the control
parameter does not have write permission for an attribute.

NOTE
If you set values to a diary attribute when you create an instance, the name, text,
and timestamp details of that diary entry are concatenated into a single string. To
avoid this issue, first create the instance, get the instance, and then set the diary
attribute value.

Chapter 4 C API functions

81

BMC Atrium Core 7.6.03

Return values
 instanceIdThe system-generated unique identifier for the new instance that
is created if you did not specify it in the attributeValueList parameter.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBCreateMultipleAttributes function
The CMDBCreateMultipleAttributes function creates multiple new attributes with
the specified names for the specified class.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBCreateMultipleAttribute(
ARControlStruct

*control,

CMDBClassNameId

*classNameID,

ARNameList

*attributeNameList,

ARNameList

*attributeIdList,

ARUnsignedIntList

*dataTypeList,

ARInternalIdList

*arsubclassesIdList,

ARUnsignedIntList

*entryModeList,

CMDBAttributeLimitList

*attributeLimitList,

ARValueList

*defaultValueList,

ARPropListList

*characListList,

ARPropListList

*customCharacListList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIDThe name of the class for which you want to create the
attributes. The classNameID argument contains the namespace name and the
unique class name.

 attributeNameListThe names of attributes to create. The names of all


attributes must be unique within the specified class and within its superclasses
and subclasses.

 attributeIdListThe list of attribute IDs for the attributes being created.

82

Developers Reference Guide

CMDBCreateMultipleAttributes function

 dataTypeListThe list of data types for the attributes being created.


 arsubclassesIdListThe BMC Remedy AR System subclass IDs of the
attributes being created.

 entryModeListThe entry mode for the attributes. Entry modes not listed are
for BMC Software internal use.
1: RequiredUsers must enter data (CMDB_ATTR_ENTRYMODE_REQUIRED).
2: OptionalUsers do not have to enter data, but they can if needed
(CMDB_ATTR_ENTRYMODE_OPTIONAL).
4: Display onlyUsers cannot enter data
(CMDB_ATTR_ENTRYMODE_DISPLAY_ONLY).

 attributeLimitListThe list of value limits for the attributes being created


and other properties specific to the attributes types. See the
CMDBsubclassesLimitStruct definition in cmdb.h to find the contained

structure that applies to the type of attribute list that you are modifying. The
limits and properties that you assign must be of the same data type as the
attribute. If you do not want to change the attribute limits and properties,
specify NULL for this parameter.

 defaultValueListThe list of values to apply if a user submits an entry with


no value for the attributes being created. The default value can be up to 255 bytes
and must be of the same data type as the attribute. If you do not want to specify
a default value, specify NULL for this parameter.

 characListListA list of characteristics for each attribute. Characteristics not


listed are not applicable for creating attributes.
1: View PermissionsSpecify a list of groups or roles that have permissions to
view this attribute (CMDB_ATTR_CHARAC_VIEW_PERMS). When querying for

attributes, you will see all attributes, including the hidden attributes. You can
specify one or more group IDs or role IDs for the permissions separated by a
semicolon, for example, 20;-5.
2: Change PermissionsSpecify a list of groups or roles that have permissions

to view and modify the characteristics of the attribute


(CMDB_ATTR_CHARAC_CHANGE_PERMS).
3: HiddenSet the flag to false so that this attribute is hidden
(CMDB_ATTR_CHARAC_HIDDEN). This setting marks the attribute as hidden for a

group or a role. When querying for classes, you can retrieve hidden attributes.
You can specify one or more group IDs or role IDs for the permissions, separated
by a semicolon, for example, 20;3.
5: Propagated OwnerThe class ID and the attribute ID of the lead class

attribute from which the attribute is propagated


(CMDB_ATTR_CHARAC_PROPAGATED_OWNER). The format for this value is
sourceAttributeId;destinationAttributeId|sourceAttributeId;desti
nAtionattributeId|[additionalPairs].
6: Create ModeSet permissions for specifying data for the attribute
(CMDB_ATTR_CHARAC_CREATE_MODE).

Chapter 4 C API functions

83

BMC Atrium Core 7.6.03

0CMDB_ATTR_CREATE_MODE_NONENo permissions specified for the

attribute.
1CMDB_ATTR_CREATE_MODE_OPENAnyone can specify a value for the

attribute.
2CMDB_ATTR_CREATE_MODE_PROTECTEDOnly users with permissions can

specify a value for the attribute.


7: Audit OptionSet the audit option on to store the audit history for the
attribute (CMDB_ATTR_CHARAC_AUDIT_OPTION).
8: NamespaceSet the namespace of the attribute
(CMDB_ATTR_CHARAC_NAMESPACE).
9: Users can set descriptions for the attributes
(CMDB_ATTR_CHARAC_DESCRIPTION).
10: Federation External NameSpecify external name for attributes of a

federated class that are mapped by way of Vendor AR System database


connectivity (ARDBC) plug-in
(CMDB_ATTR_CHARAC_FEDERATION_EXTERNAL_NAME).

 customCharacListListA list of user-defined custom characteristics list for


each attribute. The value can be set to any user-defined characteristic but must
be between 300000 (CMDB_CLASS_CUSTOM_CHARAC_MIN) and 399999
(CMDB_CLASS_CUSTOM_CHARAC_MAX).
If you do not want to associate custom characteristics with this attribute, specify
NULL for this parameter. After the properties list structure that you specify is
serialized, it is converted into the following format:
listSize propId dataType propValue
listSizeThe number of items in the properties list.
propIdThe ID for the property, which is within the 300000399999 range.
dataTypeThe data type for the property, which can be of any native data type.
propValueThe value for the property.

An example for the serialized property list is 1\300050\2\1.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

84

Developers Reference Guide

CMDBCreateMultipleInstances function

CMDBCreateMultipleInstances function
The CMDBCreateMultipleInstances function creates multiple specified CI or
relationship instances in the specified dataset.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBCreateMultipleInstances(
ARControlStruct

*control,

const ARNameType

datasetId,

const CMDBInstanceList

*instances,

ARNameList

*instanceIdList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 datasetIdThe unique identifier for the dataset. Instances are created in a


dataset based on the value specified in this parameter.

 instancesThe instance IDs and the attribute values to create.

Return values
 instanceIdListThe system-generated unique identifier for the new
instances if you did not specify instance IDs in the attributeValueList
parameter.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

Chapter 4 C API functions

85

BMC Atrium Core 7.6.03

CMDBDeleteAttribute function
The CMDBDeleteAttribute function deletes the attribute with the specified ID.
Depending on the value that you specify for the deleteOption parameter, the
attribute is deleted immediately and is not returned to users who request
information about attributes.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBDeleteAttribute(
ARControlStruct

*control,

CMDBClassNameId

classNameID,

ARNameType

attributeName,

unsigned int

deleteOption,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIDThe name of the class from which you want to delete the
attribute. The classNameID argument contains the namespace name and the
unique class name.

 attributeName The name of the attribute to delete.


 deleteOptionSpecifies the action to take if the specified attribute contains
data:
0: Do not delete the attribute (AR_ATTRIBUTE_CLEAN_DELETE).
1: Delete if the attribute contains data but not if it is inherited by subclasses
(AR_ATTRIBUTE_DATA_DELETE).
2: Delete the attribute even if it has subclasses that are associated with it
(AR_ATTRIBUTE_FORCE_DELETE).

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

86

Developers Reference Guide

CMDBDeleteClass function

CMDBDeleteClass function
The CMDBDeleteClass function deletes a specified class and its associated
attributes.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBDeleteClass(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

unsigned int

deleteOption,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIDThe name of the class to delete. The classNameID argument


contains the namespace name and the unique class name.

 deleteOptionA value indicating the action to take if the specified class


contains attributes or subclasses.
0: NoneDelete the class only if the class contains no instances and has no
subclasses or dependent relationships (CMDB_DELETE_CLASS_OPTION_NONE).
1: With dataDelete the class only if the class has no subclasses or dependent

relationships. This applies only to regular classes


(CMDB_DELETE_CLASS_OPTION_WITH_DATA).
2: All dependenciesDelete the class, including all the subclasses, dependent

relationship classes, and audit history (if any) that are associated with the class.
All the dependencies for the specified class are deleted
(CMDB_DELETE_CLASS_OPTION_ALL_DEPENDENCIES). This option overrides the
CMDB_CLASS_DATA_DELETE option.

NOTE
To retain the audit history after you delete the class, back up the class audit form
before you delete the class.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

Chapter 4 C API functions

87

BMC Atrium Core 7.6.03

CMDBDeleteInstance function
The CMDBDeleteInstance function deletes the instance of the class.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBDeleteInstance(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

datasetId,

ARNameType

instanceId,

unsigned int

deleteOption,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class to which the instance to delete belongs.


The classNameID argument contains the namespace name and the unique class
name.

 datasetIdThe unique identifier for the dataset. Instances are deleted from a
dataset based on the value specified in this parameter.

 instanceIdThe unique identifier for the instance (system-generated).


 deleteOptionA value indicating the action to take when the specified
instance cannot be retrieved.
0: Invalid inputThis option is currently reserved for future use
(CMDB_DELETEOPTION_FIRSTBIT_SET).
1<<0: Follow weak relationshipsSpecifies cascade delete for weak
relationships. (CMDB_DELETEOPTION_CASCADE_FOLLOW_WEAKREL).
1<<1: Follow one-to-one and one-to-many relationshipsSpecifies cascade
delete for relationships with one-to-many and one-to-one cardinality.
(CMDB_DELETEOPTION_CASCADE_FOLLOW_1TOM_1TO1_REL ).

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

88

Developers Reference Guide

CMDBDeleteMultipleInstances function

CMDBDeleteMultipleInstances function
The CMDBDeleteMultipleInstances function deletes a list of CI or relationship
instances in the specified dataset.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBDeleteMultipleInstance(
ARControlStruct

*control,

const ARNameType

datasetId,

const CMDBInstanceList

*instances,

const unsigned int

deleteOption,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 datasetIdThe unique identifier for the dataset. Instances are deleted from a
dataset based on the value specified in this parameter.

 instancesThe list of instances to delete.


 deleteOptionA value indicating the action to take if the specified instance to
delete is found.
0: Invalid inputThis option is currently reserved for future use
(CMDB_DELETEOPTION_FIRSTBIT_SET).
1<<0: Follow weak relationshipsSpecifies cascade delete for weak
relationships. (CMDB_DELETEOPTION_CASCADE_FOLLOW_WEAKREL).
1<<1: Follow one-to-one and one-to-many relationshipsSpecifies cascade

delete for relationships with one-to-many and one-to-one cardinality.


(CMDB_DELETEOPTION_CASCADE_FOLLOW_1TOM_1TO1_REL ).

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

Chapter 4 C API functions

89

BMC Atrium Core 7.6.03

CMDBEndBulkEntryTransaction function
Depending on the success of the calls invoked within the
CMDBBeginBulkEntryTransaction function, the transactions are committed or
rolled back.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBEndBulkEntryTransaction(
ARControlStruct

*control,

unsigned int

actionType,

ARBulkEntryReturnList

*bulkEntryReturnList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 actionTypeThe type of action. Action type can be SEND or CANCEL. For an


action type of SEND, the API call is executed as part of the transaction. For an
action type of CANCEL, the transaction is canceled.

Return values
 bulkEntryReturnListReturns the status of the entry calls.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

90

Developers Reference Guide

CMDBExpandParametersForCI function

CMDBExpandParametersForCI function
The CMDBExpandParametersForCI function accepts an unexpanded string that
contains parameters and substitutes values from the attribute value list provided
in the CMDBAttributeValueList structure. For example, the function takes
$Name$ and $InstanceId$ as the unexpanded parameters and substitutes the
values HRServer and CS000019.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBQualificationForCI(
ARControlStruct

*control,

char

*paramString,

CMDBAttributeValueList

*attValueList,

char

**expandedStr,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 paramStringThe string to expand.


 attValueListThe list of attribute and values pairs that is used to expand the
parameters. You must specify values for all required attributes that do not have
defined defaults.
Values must be of the data type defined for the attributes or have a data type of
0. NULL values can be specified for optional attributes only. An error is
generated if an attribute does not exist or the user specified by the control

parameter does not have write permission for an attribute.

Return Values
 expandedStrThe string that contains the expanded parameters.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

Chapter 4 C API functions

91

BMC Atrium Core 7.6.03

CMDBExportData function
The CMDBExportData function exports the specified class data for a specific
qualification.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBExportData(
ARControlStruct

*control,

ARQualifierStruct

*qualifier,

ARNameList

*attributeGetList,

CMDBSortList

*sortList,

unsigned int

firstRetrieve,

unsigned int

maxRetrieve,

char

*exportBuf,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 qualifierA query that determines the set of classes or attributes to retrieve.


The qualification can include one or more subclasses and any combination of
conditional, relational, and arithmetic operations. For more information about
how to construct a qualifier, see Chapter 3, Building qualifications and
expressions, in the BMC Remedy Action Request System 7.6.03 Workflow Objects
Guide.

 attributeGetListThe list of attribute names to retrieve.


 sortListA list of zero or more fields that identifies the sort order for the
exported data. Specify a NULL value for this parameter to use no specific sort
order.

 firstRetrieveThe first instance to retrieve. A value of 0


(CMDB_START_WITH_FIRST_INSTANCE)represents the first entry and is the

default value if no value is set.

 maxRetrieveThe maximum number of instances to retrieve. Use this


parameter to limit the instances returned in the query if the qualification does
not sufficiently narrow the list. Specify 0 (CMDB_NO_MAX_LIST_RETRIEVE) to
assign no maximum instances.

92

Developers Reference Guide

CMDBExportDef function

Return values
 exportBufThe exported buffer that contains the class data in an XML format.
 statusA list of zero or more notes, warnings, or errors.

CMDBExportDef function
The CMDBExportDef function exports a list of specified class definitions.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBExportDef(
ARControlStruct

*control,

CMDBExportItemList

*exportItemList,

char

*exportBuf,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 exportItemListA list of zero or more classes or attributes to export.

Return values
 exportBufThe exported buffer that contains the class definitions in XML
format.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

Chapter 4 C API functions

93

BMC Atrium Core 7.6.03

CMDBGetAttribute function
The CMDBGetAttribute function retrieves a single attribute.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetAttribute(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

attributeName,

ARNameType

attributeId,

unsigned int

*dataType,

unsigned int

*attributeType,

CMDBClassNameId

*baseClassNameId,

ARInternalId

*arsubclassesId,

unsigned int

*entryMode,

CMDBAttributeLimit

*attributeLimit,

ARValueStruct

*defaultValue,

ARPropList

*characList,

ARPropList

*customCharacList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class to which the attributes belong. The


classNameID argument contains the namespace name and the unique class

name.

 attributeNameThe name of the attribute to retrieve.

94

Developers Reference Guide

CMDBGetAttribute function

Return values
 attributeIdThe ID of the attribute.
 dataTypeThe data type of the attribute. Data types represented by numbers
not in the list are either unsupported or display fields.
1: Keyword (CMDB_ATTR_DATA_TYPE_KEYWORD)
2: Integer (CMDB_ATTR_DATA_TYPE_INTEGER)
3: Real (CMDB_ATTR_DATA_TYPE_REAL)
4: Character (CMDB_ATTR_DATA_TYPE_CHAR)
5: Diary (CMDB_ATTR_DATA_TYPE_DIARY)
6: Selection (CMDB_ATTR_DATA_TYPE_ENUM)
7: Time (CMDB_ATTR_DATA_TYPE_TIME)
10: Fixed-point decimal (CMDB_ATTR_DATA_TYPE_DECIMAL)
12: Currency (CMDB_ATTR_DATA_TYPE_CURRENCY)
13: Date (CMDB_ATTR_DATA_TYPE_DATE)
14: Time of day (CMDB_ATTR_DATA_TYPE_TIME_OF_DAY)
37: Attachment pool (CMDB_ATTR_DATA_TYPE_ATTACH_POOL)

 attributeTypeThe type of attribute to retrieve:


1: Core InternalHidden attributes that are available to BMC Atrium CMDB
for internal use (CMDB_ATTR_TYPE_CORE_INTERNAL).
2: CoreAttributes that are available for internal use only
(CMDB_ATTR_TYPE_CORE). Apart from modifying the labels, you cannot make

any other changes to the internal attributes.


3: RegularAttributes that you can create (CMDB_ATTR_TYPE_REGULAR).

 baseClassNameIdThe name of the class that owns this attribute.


 arsubclassesIdThe internal ID of the attribute to retrieve.
 entryModeThe entry mode for the attribute. Entry modes not listed are for
BMC Software internal use.
1: RequiredUsers must enter data (CMDB_ATTR_ENTRYMODE_REQUIRED).
2: OptionalUsers do not have to enter data, but they can if needed
(CMDB_ATTR_ENTRYMODE_OPTIONAL).
4: Display onlyUsers cannot enter data
(CMDB_ATTR_ENTRYMODE_DISPLAY_ONLY).

 attributeLimitThe value limits for the attribute and other properties


specific to the attributes type. See the CMDBsubclassesLimitStruct definition
in cmdb.h to find the contained structure that applies to the type of attribute
that you are creating. The limits and properties that you assign must be of the
same data type as the attribute. If you do not want to change the attribute limits
and properties, specify NULL for this parameter.
Chapter 4 C API functions

95

BMC Atrium Core 7.6.03

 defaultValueThe value to apply if the user specifies no value for the


attribute. The default value can be up to 255 bytes and must be of the same data
type as the attribute.

 characListA list of characteristics for each attribute:


1: View PermissionsSpecify a list of groups or roles that have permissions to
view this attribute (CMDB_ATTR_CHARAC_VIEW_PERMS). When querying for

attributes, you see all attributes, including the hidden attributes. You can specify
one or more group IDs or role IDs for the permissions, separated by a semicolon,
for example, 20;-5.
2: Change PermissionsSpecify a list of groups or roles that have permissions

to view and modify the characteristics of the attribute


(CMDB_ATTR_CHARAC_CHANGE_PERMS).
3: HiddenSet the flag to false so that this attribute is hidden
(CMDB_ATTR_CHARAC_HIDDEN). This setting marks the attribute as hidden for a

group or a role. When querying for classes, you can retrieve hidden attributes.
You can specify one or more group IDs or role IDs for the permissions, separated
by a semicolon, for example, 20;3.
4: Primary KeySpecify whether the attribute is a part of the primary key of
the class (CMDB_ATTR_CHARAC_PRIMARY_KEY).
5: Propagated OwnerThe class ID and the attribute ID of the lead class

attribute from which the attribute is propagated


(CMDB_ATTR_CHARAC_PROPAGATED_OWNER). The format for this value is
sourceAttributeId;destinationAttributeId|sourceAttributeId;desti
nationAttributeId|[additionalPairs].
6: Create ModeSet permissions for specifying data for the attribute
(CMDB_ATTR_CHARAC_CREATE_MODE).
0CMDB_ATTR_CREATE_MODE_NONENo permissions specified for the

attribute.
1CMDB_ATTR_CREATE_MODE_OPENAnyone can specify a value for the

attribute.
2CMDB_ATTR_CREATE_MODE_PROTECTEDOnly users with permissions can

specify a value for the attribute.


7: Audit OptionSet the audit option on to store the audit history for the
attribute (CMDB_ATTR_CHARAC_AUDIT_OPTION).
8: NamespaceSet the namespace of the attribute
(CMDB_ATTR_CHARAC_NAMESPACE).
9: DescriptionSet the description for the attribute
(CMDB_ATTR_CHARAC_DESCRIPTION).
10: Federation External NameSpecify external name for attributes of a
federated class that are mapped by way of Vendor AR System database
connectivity (ARDBC) plug-in
(CMDB_ATTR_CHARAC_FEDERATION_EXTERNAL_NAME).

96

Developers Reference Guide

CMDBGetClass function

 customCharacListA list of user-defined custom characteristics for the


attribute. The attributes must be between 300000
(CMDB_ATTR_CUSTOM_CHARAC_MIN) and 399999
(CMDB_ATTR_CUSTOM_CHARAC_MAX).

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBGetClass function
The CMDBGetClass function retrieves class information from the OBJSTR:Class
form for the specified class.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetClass(
ARControlStruct

*control,

CMDBClassNameID

*classNameId,

ARNameType

*classId,

CMDBClassTypeInfo

*classTypeInfo,

CMDBClassNameId

*superclassNameId,

CMDBIndexList

*indexList,

CMDBAuditInfoStruct

auditInfo,

ARPropList

*characList,

ARPropList

*customCharacList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIDThe class to retrieve. The classNameID argument contains the


namespace name and the unique class name.

Return values
 classIdThe ID used to identify the class.
 classTypeInfoInformation about the type of class.
 superclassNameIdThe name of the superclass. The superclassNameID
argument contains the namespace name and the unique class name.

Chapter 4 C API functions

97

BMC Atrium Core 7.6.03

 indexListThe list of indexes defined for the class.


 auditInfoThe audit information for the class: audit type, log form,
qualification, and Audit Only Changed Fields (auditMask). Use the following
auditMask values:

 CMDB_CLASS_AUDITCHANGE_DEFAULT = 0Use the value of the Disable


Audit Only Change Fields system setting on the BMC Remedy AR System
server. The system setting default is that only changing the attribute to a
different value triggers auditing.

 CMDB_CLASS_AUDITCHANGE_YES = 1Audit when an updated field value is


different than the existing value.

 CMDB_CLASS_AUDITCHANGE_NO = 2Audit when a field value is modified,


even if the updated value is the same as the existing value.

 characListA list of characteristics for this class. Specify NULL for this
parameter if you do not want to associate characteristics with this class.
Characteristics not listed are for BMC Software internal use.
1: SingletonUsed to specify if this is a singleton class. This characteristic is an
integer value where type CMDB_CLASS_CHARAC_SINGLETON_FALSE indicates
that this is not a singleton class. Type CMDB_CLASS_CHARAC_SINGLETON_TRUE
indicates that this is a singleton class (CMDB_CLASS_CHARAC_SINGLETON).
2: AbstractThis property does not allow you to create instances for this
abstract class (CMDB_CLASS_CHARAC_ABSTRACT). After the property has been

set for the attribute, you cannot create instances for it. All the attributes are
propagated to the subclasses.
3: FinalYou cannot create subclasses from this class
(CMDB_CLASS_CHARAC_FINAL).
4: AuthorThe author of the class (CMDB_CLASS_CHARAC_AUTHOR).
5: DescriptionThe class description (CMDB_CLASS_CHARAC_DESCRIPTION).
6: Hidden permissionsGives you the permissions to modify the class
(CMDB_CLASS_CHARAC_CLASS_HIDDEN_PERMS). Marks the class as hidden for

the users in the group. When querying for classes, you can choose to retrieve
hidden classes.
7: Visible permissionsGives you the permissions to modify the class
(CMDB_CLASS_CHARAC_CLASS_VISIBLE_PERMS). Marks the class as visible for

the users in the group. When querying for classes, you will see all classes
including the hidden classes.
8: Categorization(CMDB_CLASS_CHARAC_CATEGORIZATION_SUBCLASS).
9: Form name(CMDB_CLASS_CHARAC_FORM_NAME).
10: ExposureThe visibility of the class, which can be
CMDB_CLASS_EXPOSURE_NONE, CMDB_CLASS_EXPOSURE_USED_VISIBLE, or
CMDB_CLASS_EXPOSURE_USED_HIDDEN.

98

Developers Reference Guide

CMDBGetClass function

12: Federation schema typeAllows you to specify the schema type for
federation (CMDB_CLASS_CHARAC_FEDERATION_SCHEMA_TYPE). This

characteristic is an integer data type, where:


0CMDB_FEDERATION_SCHEMA_REGULARIndicates that the schema is not of

type federation. 0 is the default value for this characteristic.


1CMDB_FEDERATION_SCHEMA_VENDORIndicates that the schema type is an
BMC Remedy AR System Vendor form.
13: Federation vendor nameAllows you to specify the name of the vendor

form or ARDBC plug-in name


(CMDB_CLASS_CHARAC_FEDERATION_VENDOR_NAME). Specify this characteristic
only if you set the CHARAC_FEDERATION_SCHEMA_TYPE characteristic to 1.
14: Federation vendor table nameAllows you to specify the name of the data

store from which the federated data class will retrieve the data
(CMDB_CLASS_CHARAC_FEDERATION_VENDOR_TABLE_NAME). Specify this
characteristic only if you set the CHARAC_FEDERATION_SCHEMA_TYPE
characteristic to 1.
15: Relation typeAllows you to specify the type of relationship for the
federated class (CMDB_CLASS_CHARAC_RELATION_TYPE). This characteristic,

which only applies to relationship classes, is an integer data type, where:


0CMDB_RELATION_REGULARIndicates a regular relationship that relates

two CI endpoints.
1CMDB_RELATION_QUERYIndicates that the relation type is a query used for
join conditions. 0 is the default value for this characteristic.
16: BMC Remedy AR System qualificationAllows you to specify the BMC

Remedy AR System qualification, which defines how the source class links to
the destination class in federated relationship classes
(CMDB_CLASS_CHARAC_RELATION_LINK_QUALIFIER).
17: Number of temp tablesAllows you to define the maximum number of

temporary tables to create for vendor forms


(CMDB_CLASS_CHARAC_NUM_TEMP_TABLES). Do not specify a value for the

characteristic if you are working with regular (non-vendor) forms.


18: Requires qualifier for the queryAllows you to specify whether a
qualification is required for the federated class in the CMDBQueryByPath
function (CMDB_CLASS_CHARAC_REQUIRES_QUALIFIER_FOR_QUERY). This

characteristic is an integer data type, where:


0CMDB_QUAL_RESTRICITVEIndicates that no qualification is required for

the query.
1CMDB_QUAL_NON_RESTRICITVEIndicates that a qualification is required
for the federated class. 1 is the default value for this characteristic. For

performance reasons, BMC recommends that you do not set this value if you
have a lot of data in the external data store and you have not specified any
qualifications against the federated data class that maps to it.

Chapter 4 C API functions

99

BMC Atrium Core 7.6.03

 customCharacListA list of user-defined custom characteristics for the class.


The value retrieved must be between 100000
(CMDB_CLASS_CUSTOM_CHARAC_MIN) and 199999
(CMDB_CLASS_CUSTOM_CHARAC_MAX). If you do not want to retrieve custom
characteristics with this class, specify NULL for this parameter.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBGetCopyAuditData function
If the attribute data for the instance is modified, the CMDBGetCopyAuditData
function retrieves a copy of the specified CI instance. The Audit Option must be set
for the attributes characteristic to get the audit data.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetCopyAuditData(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

instanceId,

ARTimestamp

auditTimestamp,

CMDBQualifierStruct

*qualifier,

ARNameList

*attributeGetList,

CMDBSortList

*sortList,

unsigned int

firstRetrieve,

unsigned int

maxRetrieve,

CMDBAuditValueListList

*auditValueListList,

unsigned int

*numMatches,

ARStatusList

*status)

 controlThe control record for the operation, which contains information


about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe class name of the CI instance for which to retrieve the audit
data. The classNameID argument contains the namespace name and the unique
class name.

 instanceIdThe instance ID of the specified CI instance for which a copy of


the audit data is to be retrieved.

 auditTimestampThe date and time information for the instance. The CI


instances with the date and time greater than or equal to the auditTimestamp
value are retrieved. If auditTimestamp is 0, all the audit data is retrieved.

100

Developers Reference Guide

CMDBGetCopyAuditData function

 qualifierA query that determines the set of CI instances to retrieve. The


qualification can include one or more attributes and any combination of
conditional, relational, and arithmetic (numeric data types only) operations. For
more information about how to construct a qualifier, see Chapter 3, Building
qualifications and expressions, in the BMC Remedy Action Request System 7.6.03
Workflow Objects Guide.

 attributeGetListA list of attribute names for which the audit data is to be


retrieved.

 sortListA list of zero or more fields that identifies the sort order for the
attributes. Specify a NULL value for this parameter to use no specific sort order.

 firstRetrieveThe first instance to retrieve for the qualification. If you do


not specify a value for this parameter, the default value of
CMDB_START_WITH_FIRST_ENTRY is used and the function retrieves the first
entry.

 maxRetrieveThe maximum number of entries to retrieve for the


qualification. Use this parameter to limit the amount of data returned if
qualifier does not narrow the list. Specify CMDB_NO_MAX_LIST_RETRIEVE to
assign no maximum.

Return values
 auditValueListListThe list of values for the specified attributes. If the audit
option at the CI class-level is disabled, an error is returned.

 numMatchesThe number of CI instance entries that matched the specified


qualification.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

Chapter 4

C API functions

101

BMC Atrium Core 7.6.03

CMDBGetInstance function
The CMDBGetInstance function retrieves information about the instance.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetInstance(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

datasetId,

usigned int

getMask,

ARNameType

instanceId,

ARNameList

*attributeGetList,

CMDBAttributeValueList

*attributeValueList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class for which to retrieve the instance. The
classNameID argument contains the namespace name and the unique class

name.

 datasetIdThe unique identifier for the dataset. The data in the return values
are based on the dataset ID specified in this parameter.

 getMaskThe ID that specifies the type of dataset on which to perform the


operation.
0:NoneBased on the datasetId being passed, instances are retrieved from
either the overlay or the original dataset (CMDB_GET_MASK_NONE).
1<<0: Current ModeAllows you to retrieve instances from the current dataset
only (CMDB_GET_DATASET_MODE_CURRENT).

 instanceIdThe unique identifier for the instance to retrieve.


 attributeGetListThe list of attributes to retrieve.

102

Developers Reference Guide

CMDBGetInstanceBLOB function

Return values
 attributeValueListA list of one or more attribute and value pairs retrieved
for the specified instance.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBGetInstanceBLOB function
The CMDBGetInstanceBLOB function retrieves the attachment, or binary large
object (BLOB), stored for the attachment subclasses. The BLOB can be returned in a
file or in an in-memory buffer.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetInstanceBLOB(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

datasetId,

unsigned int

getMask,

ARNameType

instanceId,

ARNameType

attributeName,

ARLocStruct

*loc,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class for which to retrieve the instance blob. The
classNameID argument contains the namespace name and the unique class

name.

 datasetIdThe unique identifier for the dataset. The data in the return values
are based on the dataset ID specified in this parameter.

 getMaskThe ID that specifies the type of dataset on which to perform the


operation.
0:NoneBased on the datasetId being passed, instances are retrieved from
either the overlay or the original dataset (CMDB_GET_MASK_NONE).
1<<0: Current ModeAllows you to retrieve instances from the current dataset
only (CMDB_GET_DATASET_MODE_CURRENT).
Chapter 4

C API functions

103

BMC Atrium Core 7.6.03

 instanceIdThe unique identifier of the instance to retrieve.


 attributeNameThe name of the attribute that contains the attachment.

Return values
 locThe location where the BLOB is stored.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBGetListClass function
The CMDBGetListClass function retrieves a list of classes. You can specify one or
more of the classNameIdRelation, superclassName, and characQueryList
qualification parameters.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetListClass(
ARControlStruct

*control,

ARNameType

namespaceName,

CMDBClassNameId

*classNameIdRelation,

CMDBClassNameId

*superclassName,

ARPropList

*characQueryList,

ARBoolean

getHiddenClasses,

CMDBClassNameIdList

*classNameIdList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 namespaceNameThe name of the namespace. Namespaces are a way of


partitioning your data model to create logical groups of classes. The Class
Manager namespaces are implemented using a prefix-based naming convention
on classes.

 classNameIdRelationRetrieves the relationship classes that have a class


specified in this parameter as part of the relationship.

 superclassNameThe superclass name of the classes to retrieve.

104

Developers Reference Guide

CMDBGetListInstance function

 characQueryListThe search criteria.


 getHiddenClassesA Boolean flag that indicates whether to retrieve the
hidden classes.

Return values
 classNameIdListA list of class names that match the specified criteria.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBGetListInstance function
The CMDBGetListInstance function retrieves a list of instances. You can limit the
instance list to entries that match particular conditions by specifying the
qualifier parameter.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetListInstance(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

datasetId,

usigned int

getMask,

CMDBQualifierStruct

*qualifier,

ARNameList

*attributeGetList,

CMDBSortList

*sortList,

unsigned int

firstRetrieve,

unsigned int

maxRetrieve,

ARNameList

*instanceIdList,

CMDBAttributeValueListList

*attributeValueListList,

unsigned int

*numMatches,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class for which to retrieve the instances. The
classNameID argument contains the namespace name and the unique class

name.
Chapter 4

C API functions

105

BMC Atrium Core 7.6.03

 datasetIdThe unique identifier for the dataset. The data in the return values
are based on the dataset ID specified in this parameter.

 getMaskThe ID that specifies the type of dataset on which to perform the


operation.
0:NoneBased on the datasetId being passed, instances are retrieved from
either the overlay or the original dataset (CMDB_GET_MASK_NONE).
1<<0: Current ModeAllows you to retrieve instances from the current dataset
only (CMDB_GET_DATASET_MODE_CURRENT).

 qualifierA query that determines the set of entries to retrieve. The


qualification can include one or more subclasses and any combination of
conditional, relational, and arithmetic operations. For more information about
how to construct a qualifier, see Chapter 3, Building qualifications and expressions
in the BMC Remedy Action Request System 7.6.03 Workflow Objects Guide.

 attributeGetListA list of attribute names to retrieve.


 sortListA list of zero or more attributes that identifies the sort order for the
retrieved data. Specify a NULL value for this parameter to use no specific sort
order.

 firstRetrieveThe first instance to retrieve for the qualification. If you do


not specify a value for this parameter, the default value of
CMDB_START_WITH_FIRST_ENTRY is used and the function retrieves the first
entry.

 maxRetrieveThe maximum number of entries to retrieve. Use this parameter


to limit the amount of data returned if the qualification does not narrow the list.
Specify CMDB_NO_MAX_LIST_RETRIEVE to assign no maximum.

Return values
 instanceIdListThe list of instance IDs that match the criteria.
 attributeValueListListA list of one or more attribute and value pairs
retrieved for the specified instances.

 numMatchesThe total number of entries that match the qualification criteria.


This value does not represent the number of entries returned unless the number
of matching entries is less than or equal to the maxRetrieve value.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

106

Developers Reference Guide

CMDBGetMultipleAttributes function

CMDBGetMultipleAttributes function
The CMDBGetMultipleAttributes function retrieves multiple attributes.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetMultipleAttribute(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARBoolean

getHiddenAttrs,

ARBoolean

getDerivedAttrs,

ARNameList

*nameList,

ARPropList

*attrCharacQueryList,

ARBooleanList

*existList,

ARNameList

*attributeNameList,

ARNameList

*attributeIdList,

ARUnsignedIntList

*dataTypeList,

ARUnsignedIntList

*attributeTypeList,

CMDBClassNameIdList

*baseClassNameIdList,

ARInternalIdList

*arsubclassesIdList,

ARUnsignedIntList

*entryModeList,

CMDBAttributeLimitList

*attributeLimitList,

ARValueList

*defaultValueList,

ARPropListList

*characList,

ARPropListList

*customCharacList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class to which the attributes belong. The


classNameID argument contains the namespace name and unique class name.

 getHiddenAttrsA flag indicating whether to retrieve hidden attributes. If set


to FALSE, hidden attributes are not retrieved.

 getDerivedAttrsA flag indicating whether to retrieve attributes derived


from a superclass. If set to FALSE, derived attributes are not retrieved.

 nameListA list of attributes to retrieve.


 attrCharacQueryListA list of attribute characteristic queries to retrieve.
Chapter 4

C API functions

107

BMC Atrium Core 7.6.03

Return values
 existListA list of flags and corresponding Boolean values indicating
whether the attribute list exists. The value TRUE indicates that the attribute list
exists; FALSE indicates that the attribute list does not exist.

 attributeNameListThe list of attribute names retrieved.


 attributeIdListThe list of IDs of the attributes retrieved.
 dataTypeListThe list of data types for the attributes.
 attributeTypeListThe types of attributes to retrieve:
1: Core InternalHidden attributes that are available to BMC Atrium CMDB
for internal use (CMDB_ATTR_TYPE_CORE_INTERNAL).
2: CoreAttributes that are available for internal use only
(CMDB_ATTR_TYPE_CORE). Apart from modifying the labels, you cannot make

any other changes to the internal attributes.


3: RegularAttributes that you can create (CMDB_ATTR_TYPE_REGULAR).

 baseClassNameIdListThe list of base class name IDs for which you want to
retrieve the attribute.

 arsubclassesIdListThe BMC Remedy AR System subclass IDs for which


you want to retrieve the attribute.

 entryModeListThe entry mode for the attribute. Entry modes not listed are
for BMC Software internal use.
1: RequiredUsers must enter data (CMDB_ATTR_ENTRYMODE_REQUIRED).
2: OptionalUsers do not have to enter data, but they can if needed
(CMDB_ATTR_ENTRYMODE_OPTIONAL).
4: Display onlyUsers cannot enter data
(CMDB_ATTR_ENTRYMODE_DISPLAY_ONLY).

 attributeLimitListThe list of value limits for the attribute and other


properties specific to the attributes types. See the
CMDBsubclassesLimitStruct definition in cmdb.h to find the contained

structure that applies to the type of attributes that you are retrieving. The limits
and properties that you assign must be of the same data type as the attribute. If
you do not want to change the attribute limits and properties, specify NULL for
this parameter.

 defaultValueListThe list of default values to apply if a user does not


specify any values for the attributes. The default value can be up to 255 bytes
and must be of the same data type as the attribute.

 characListA list of characteristics for the attribute:


1: View PermissionsSpecify a list of groups or roles that have permissions to
view this attribute (CMDB_ATTR_CHARAC_VIEW_PERMS). When querying for

attributes, you see all attributes, including the hidden attributes. You can specify
one or more group IDs or role IDs for the permissions, separated by a semicolon,
for example, 20;-5.
108

Developers Reference Guide

CMDBGetMultipleAttributes function

2: Change PermissionsSpecify a list of groups or roles that have permissions

to view and modify the characteristics of the attribute


(CMDB_ATTR_CHARAC_CHANGE_PERMS).
3: HiddenSet the flag to false so that this attribute is hidden
(CMDB_ATTR_CHARAC_HIDDEN). This setting marks the attribute as hidden for a

group or a role. When querying for classes, you can retrieve hidden attributes.
You can specify one or more group IDs or role IDs for the permissions, separated
by a semicolon, for example, 20;3.
4: Primary KeySpecify whether the attribute is a part of the primary key of the
class (CMDB_ATTR_CHARAC_PRIMARY_KEY).
5: Propagated OwnerThe class ID and the attribute ID of the lead class

attribute from which the attribute is propagated


(CMDB_ATTR_CHARAC_PROPAGATED_OWNER). The format for this value is
sourceAttributeId;destinationAttributeId|sourceAttributeId;desti
nationAttributeId|[additionalPairs].
6: Create ModeSet permissions for specifying data for the attribute
(CMDB_ATTR_CHARAC_CREATE_MODE).
0CMDB_ATTR_CREATE_MODE_NONENo permissions specified for the

attribute.
1CMDB_ATTR_CREATE_MODE_OPENAnyone can specify a value for the

attribute.
2CMDB_ATTR_CREATE_MODE_PROTECTEDOnly users with permissions can

specify a value for the attribute.


7: Audit OptionSet the audit option on to store the audit history for the
attribute (CMDB_ATTR_CHARAC_AUDIT_OPTION).
8: NamespaceSet the namespace of the attribute
(CMDB_ATTR_CHARAC_NAMESPACE).
9: DescriptionSet the description for the attribute
(CMDB_ATTR_CHARAC_DESCRIPTION).
10: Federation External NameSpecify external name for attributes of a

federated class that are mapped by way of Vendor AR System database


connectivity (ARDBC) plug-in
(CMDB_ATTR_CHARAC_FEDERATION_EXTERNAL_NAME).

 customCharacListA list of user-defined custom characteristics for the


attribute. The attributes must be between 300000
(CMDB_ATTR_CUSTOM_CHARAC_MIN) and 399999
(CMDB_ATTR_CUSTOM_CHARAC_MAX).

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

Chapter 4

C API functions

109

BMC Atrium Core 7.6.03

CMDBGetMultipleInstances function
The CMDBGetMultipleInstances function retrieves multiple instances of the
specified class in a dataset.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetMultipleInstances(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

datasetId,

unsigned int

getMask,

ARNameList

*instanceIds,

ARNameList

*attributeGetList,

ARBooleanList

*existList,

CMDBAttributeValueListList

*attributeValueListList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class for which to retrieve the instances. The
classNameID argument contains the namespace name and the unique class

name.

 datasetIdThe unique identifier for the dataset. The data in the return values
are based on the dataset ID specified in this parameter.

 getMaskThe ID that specifies the type of dataset on which to perform the


operation.
0:NoneBased on the datasetId being passed, instances are retrieved from
either the overlay or the original dataset (CMDB_GET_MASK_NONE).
1<<0: Current ModeAllows you to retrieve instances from the current dataset
only (CMDB_GET_DATASET_MODE_CURRENT).

 instanceIdsA list of instance IDs to retrieve.


 attributeGetListA list of attributes to retrieve.

110

Developers Reference Guide

CMDBGetCMDBUIComponents function

Return values
 existListA list of flags and corresponding Boolean values indicating
whether the attribute list exists. The value TRUE indicates that the attribute list
exists; FALSE indicates that the attribute list does not exist.

 attributeValueListListA list of one or more attribute and value pairs


retrieved for the specified list of instances.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBGetCMDBUIComponents function
The CMDBGetCMDBUIComponents function retrieves a list of UI components for
a specified class.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetCMDBUIComponents(
ARControlStruct

*control,

CMDBUIComponentInfo

*inputInfo,

ARNameType

datasetId,

ARNameType

instanceId,

CMDBUIComponentResultList

*outputInfo,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 inputInfoThe qualification for the user interface component. You can specify
information such as locale, classId, and tags to retrieve the required UI
component data. If no qualifications are specified, all existing UI components
are returned.

 datasetIdThe dataset ID of the specific CI for which you want to retrieve the
UI components. For example, to retrieve component data for an instance of
BMC_ComputerSystem, specify the dataset ID for that instance. If you do not
specify the instanceId parameter for this function, the datasetId parameter
is ignored.

 instanceIdThe unique identifier of the instance for which you want to


retrieve the UI component information.

Chapter 4

C API functions

111

BMC Atrium Core 7.6.03

Return Values
 outputInfoThe CMDBUIComponents result set for the specified
qualifications.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBGetJobRun function
The CMDBGetJobRun function retrieves job information and the log for the
currently running Reconciliation Engine job. For information about interpreting
job run logs and job run information, see the BMC Atrium Core 7.6.03 Installation
Guide.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetJobRun(
ARControlStruct

*control,

ARNameType

jobRunId,

ARREJobRunInfoStruct

*jobRunInfo,

char

**jobRunLog

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 jobRunIdA unique job identifier.

Return values
 jobRunInfoThe job run information to retrieve.
 jobRunLogThe job run log to retrieve.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

112

Developers Reference Guide

CMDBGetListJobRun function

CMDBGetListJobRun function
The CMDBGetListJobRun function returns a list of running Reconciliation Engine
jobs. The job list is retrieved based on the qualification passed to the function.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetListJobRun(
ARControlStruct

*control,

CMDBQualifierStruct

*jobQualifier,

ARREJobRunInfoList

*jobRunInfoList,

unsigned int

*numMatches,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 jobQualifierA query that determines the set of entries to retrieve. The


qualification can include one or more subclasses and any combination of
conditional, relational, and arithmetic operations. For more information about
how to construct a qualifier, see Chapter 3, Building qualifications and
expressions, in the BMC Remedy Action Request System 7.6.03 Workflow Objects
Guide.
The following qualifiers are supported:
Run Status*, Run Start Time, Run End Time, Job Instance ID*, Job Run
ID, and Submitter.

Return values
 jobRunInfoListThe list of running jobs that match the qualification criteria.
 numMatchesThe total number of jobs that match the qualification criteria.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

Chapter 4

C API functions

113

BMC Atrium Core 7.6.03

CMDBGetRelatedFederatedInContext function
The CMDBGetRelatedFederatedInContext function returns related
BMC_FederatedInterface instances for a specific CI.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetRelatedFederatedInContext(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

datasetId,

ARNameType

instanceId,

ARNameList

*attributeGetList,

ARNameList

*instanceIdList,

CMDBAttributeValueListList

*attrValueListList,

ARStatusList

*status

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe class name for which to retrieve the federated instances. The
classNameID argument contains the namespace name and the unique class

name.

 datasetIdThe dataset ID of the instance to retrieve.


 instanceIdThe instance ID of the specific instance for which federated
instances are to be retrieved.

 attributeGetListThe list of attribute names to retrieve.

Return values
 instanceIdListThe list of instance GUIDs.
 attrValueListListA list of one or more attribute and value pairs (specified in
any order). You must specify values for all required attributes that do not have
defined defaults. Values must be of the data type defined for the attributes or
have a data type of 0. NULL values can be specified for optional attributes only.
An error is generated if an attribute does not exist or the user specified by the
control parameter does not have write permission for an attribute.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.
114

Developers Reference Guide

CMDBGetServerPort function

CMDBGetServerPort function
The CMDBGetServerPort function retrieves information about the BMC Atrium
CMDB server port.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGetServerPort(
ARControlStruct

*control,

int

*tcpPort,

int

*rpcPort,

ARStatusList

*status)

Input argument
controlThe control record for the operation, which contains information about
the user requesting the operation and the server on which the operation is to be
performed.

Return values
 tcpPortRetrieves the TCP port number for the BMC Atrium Core server.
 rpcPortRetrieves the RPC port number for the BMC Atrium Core server.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBGetVersions function
The CMDBGetVersions function retrieves the version information for any BMC
Atrium Core component that is installed.

Synopsis
#include "ar.h"
#include "arextern.h"
int CMDBGetVersions(
ARControlStruct

*control,

ARNameList

*appIdList

ARBooleanList

*existList

CMDBVersionInfoList

*versionInfoList

ARStatusList

*status)
Chapter 4

C API functions

115

BMC Atrium Core 7.6.03

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 appIdListA list of application IDs for which the version information is


required. Specify a NULL value in this argument to get version information of all
the existing applications.

Return values
 existListA list of TRUE or FALSE values. Each value in this list denotes
whether the corresponding application IDs in the supplied appIdList exists.

 versionInfoListA list of BMC Atrium Core version structures.


 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBGraphQuery function
The CMDBGraphQuery function searches for relationships and endpoints related
to a specific CI.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGraphQuery(

116

ARControlStruct

*control,

CMDBClassNameId

*startClassNameId,

ARNameType

datasetId,

unsigned int

getMask,

ARNameType

startExtensionId,

ARNameType

startInstanceId,

int

numLevels,

int

direction,

ARBoolean

noMatchProceed,

ARBoolean

onMatchProceed,

CMDBGraphList

*queryGraph,

CMDBGetObjectList

*objects,

CMDBGetRelationList

*relations,

ARStatusList

*status)

Developers Reference Guide

CMDBGraphQuery function

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 startClassNameIdThe name of the class for which you want to retrieve


relationships and instances. The classNameID argument contains the
namespace name and the unique class name.

 datasetIdThe unique identifier for the dataset. The data in the return values
are based on the dataset ID specified in this parameter.

 getMaskThe ID that specifies the type of dataset on which to perform the


operation.
0: NoneBased on the datasetId being passed, instances are retrieved from
either the overlay or the original dataset (CMDB_GET_MASK_NONE).
1<<0: Current ModeAllows you to retrieve instances from the current dataset
only (CMDB_GET_DATASET_MODE_CURRENT).

 startExtensionIdThe extension ID of the class for which you want to


retrieve relationships and instances. This is required if the query graph contains
the same CI class more than once and needs to distinguish one from another.

 startInstanceIdThe instance ID of the class for which you want to retrieve


relationships and instances.

 numLevelsThe number of levels to traverse in the specified queryGraph. The


value A-1 specifies the query to traverse to the end of the graph.

 directionThe direction in which the graph is to traverse.


0: OutReturn all relationships for the starting node where an endpoint is the
destination node (CMDB_RELATIONSHIP_DIRECTION_OUT).
1: InReturn all relationships for the starting node where an endpoint is the
source node (CMDB_RELATIONSHIP_DIRECTION_IN).
2: BothReturn all relationships for the starting node where an endpoint is
source or destination(CMDB_RELATIONSHIP_DIRECTION_BOTH).

 noMatchProceedSpecifies whether to proceed with the query when the node


returned for a given relationship instance does not match the criteria.
T (1): When the node returned for a given relationship instance does not match
the criteria specified, proceed to the next relationship. No relationship
information is returned because the returned components might not be
connected (because the nonmatching nodes are skipped).
F (0): When the node returned for a given relationship instance does not match
the criteria specified, do not proceed any further.

Chapter 4

C API functions

117

BMC Atrium Core 7.6.03

 onMatchProceedSpecifies whether to proceed with the query when the node


returned for a given relationship instance matches the criteria.
T (1): When the node returned for a given relationship instance matches the

criteria specified, proceed to the next relationship.


F (0): When the node returned for a given relationship instance matches the

criteria specified, do not proceed further.

 queryGraphIndicates the path that needs to be queried to return the desired


CIs and relationships.

Return values
 objectsList of one or more CI instances matching the specified criteria. The
starting node is not included.

 relationsList of relationship instances that connects the returned CIs and


that match the specified criteria.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBGraphWalkBegin function
The CMDBGraphWalkBegin function specifies the start node for retrieving CI and
relationship instances in a chunk. This function sets up the starting node and query
parameters for the graph walk.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGraphWalkBegin(
ARControlStruct

*control,

CMDBClassNameId

*startClassNameId,

ARNameType

*startInstanceId,

CMDBGraphWalkQueryStruct

*graphWalkQueryStruct,

CMDBGraphWalkStateStruct

*graphWalkStateStruct,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 startClassNameIdThe name of the starting node class. The classNameID


argument contains the namespace name and the unique class name.
118

Developers Reference Guide

CMDBGraphWalkEnd function

 startInstanceIdThe instance ID of the starting node for the query.


 graphWalkQueryStructSpecifies information such as the dataset ID of the
instances to retrieve, number of levels to walk in the relationship map, the
maximum number of rows to retrieve, and the query mode for the query.

Return values
 graphWalkStateStructThe status of the list of classes walked in the query,
next chunks availability, and the next object index. This structure, which is for
internal use only, is used as an input argument for the CMDBGraphWalkNext
function.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBGraphWalkEnd function
The CMDBGraphWalkEnd function ends the graph walk. Use this function after
you retrieve the CI and relationship information using the CMDBGraphWalkNext
function.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGraphWalkNext(
ARControlStruct

*control,

CMDBGraphWalkStateStruct

*graphWalkStateStruct,

ARStatusList

*status)

Input argument
controlThe control record for the operation, which contains information about

the user requesting the operation and the server on which the operation is to be
performed.

Return values
 graphWalkStateStructThe status of the last node walked in the CI and
relationship graph.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

Chapter 4

C API functions

119

BMC Atrium Core 7.6.03

CMDBGraphWalkNext function
The CMDBGraphWalkNext function moves to the next chunk of nodes to retrieve
in the graph walk. This function is used after setting up the start node in the CI and
relationship graph using the CMDBGraphWalkBegin function.
You do not need to specify values for any of the parameters of the function. To
retrieve rows in chunks, use only the hasNextChunk member of the
CMDBGraphWalkStateStruct structure.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBGraphWalkNext(
ARControlStruct

*control,

CMDBGraphWalkStateStruct

*graphWalkStateStruct,

CMDBGraphWalkResultStruct

*graphWalkResultStruct,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 graphWalkStateStructThe status of the start node setup for the graph walk
query before performing the next query chunk. This structure is for internal use
only.

Return values
 graphWalkStateStructThe status of the graph walk after the next chunk is
queried.

 graphWalkResultStructThe list of CI and relationship instances returned by


the query.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

120

Developers Reference Guide

CMDBImportData function

CMDBImportData function
The CMDBImportData function imports the specified instance data.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBImportData(
ARControlStruct

*control,

unsigned int

importOption,

char

*importBuf,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 importOptionA value that indicates how to manage duplicates found during


the importing of instance data. These options are mutually exclusive.
1: ErrorGenerate an error (CMDB_DATA_IMPORT_OPT_ERROR_FOR_DUP).
2: New ID for duplicatesCreate an instance with a new instance ID if the
instance ID already exists (CMDB_DATA_IMPORT_OPT_NEWID_FOR_DUP).
3: MergeUpdate the existing instance if the instance ID specified already
exists (CMDB_DATA_IMPORT_OPT_MERGE_FOR_DUP).
4: New ID for allCreate a new instance ID for all the imported instances,

including those instances that are not duplicates.


(CMDB_DATA_IMPORT_OPT_NEWID_FOR_ALL).

 importBufThe import buffer, which contains the class data in XML format to
import.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

Chapter 4

C API functions

121

BMC Atrium Core 7.6.03

CMDBImportDef function
The CMDBImportDef function imports a list of specified class definitions.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBImportDef(
ARControlStruct

*control,

CMDBXMLImportItemList

*importItemList,

unsigned int

importOption,

char

*importBuf,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 importItemListA list of zero or more items to import. Specify NULL for this
parameter to import all definitions in the import buffer.

 importOptionA value indicating whether to replace class definitions being


imported if they already exist. If an import item already exists, the function
generates an error.
1: CreateGenerate an error if an item to import already exists
(CMDB_DEF_IMPORT_OPT_CREATE).
2: OverwriteOverwrite if an item to import already exists
(CMDB_DEF_IMPORT_OPT_OVERWRITE).

 importBufThe import buffer that contains the class definitions in XML format
to import.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

122

Developers Reference Guide

CMDBInitialization function

CMDBInitialization function
The CMDBInitialization function initializes the C API session. You must invoke
this function before any other C API calls.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBInitialization(
ARControlStruct

*control,

ARStatusList

*status)

Input argument
controlThe control record for the operation, which contains information about
the user requesting the operation and the server on which the operation is to be
performed.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

Chapter 4

C API functions

123

BMC Atrium Core 7.6.03

CMDBQueryByPath function
The CMDBQueryByPath function retrieves a list of instances for the specified
qualifications. To improve the performance of the queries, add indexes on
attributes that are frequently used in the qualification.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBQueryByPath(
ARControlStruct

*control,

CMDBQueryStruct

*query,

CMDBQueryResult

*result,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 queryA query that determines the list of instances to return. The qualification
can include one or more subqueries and any combination of conditional,
relational, and arithmetic operations.

Return values
 resultThe list of instances returned for the specified qualifications.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

124

Developers Reference Guide

CMDBRunQualificationForCI function

CMDBRunQualificationForCI function
The CMDBRunQualificationForCI function validates a list of attributes for a
specified CI. The CMDBRunQualificationForCI function takes qualification
parameters in structured and encoded modes.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBRunQualificationForCI(
ARControlStruct

*control,

CMDBQualifierStruct

*qualifier,

CMDBAttributeValueList

*attValueList,

ARBoolean*

passed,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 qualifierA query that determines the set of CIs to retrieve. The qualification
can include one or more subclasses and any combination of conditional,
relational, and arithmetic operations. For more information about how to
construct a qualifier, see Chapter 3, Building qualifications and expressions, in the
BMC Remedy Action Request System 7.6.03 Workflow Objects Guide.

 attValueListThe list of one or more attribute and value pairs (specified in


any order) to validate. Values must be of the data type defined for the attributes
or have a data type of 0.

Return values
 passedA Boolean value that specifies whether the qualification passed.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

Chapter 4

C API functions

125

BMC Atrium Core 7.6.03

CMDBSetAttribute function
The CMDBSetAttribute function sets an attribute with the specified name for the
specified class.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBSetAttribute(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

attributeName,

ARNameType

newAttributeName,

unsigned int

*entryMode,

CMDBAttributeLimit

*attributeLimit,

ARValueStruct

*defaultValue,

ARPropList

*characList,

ARPropList

*customCharacList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class for which the attribute needs to set. The
classNameID argument contains the namespace name and the unique class

name.

 attributeNameThe name of the attribute to set.


 newAttributeNameThe new name of the attribute, which must be unique
within the specified class and within its superclasses and subclasses.

 entryModeThe list of entry modes for the attribute being set. Entry modes not
listed are for BMC Software internal use.
1: RequiredUsers must enter data (CMDB_ATTR_ENTRYMODE_REQUIRED).
2: OptionalUsers do not have to enter data, but they can if needed
(CMDB_ATTR_ENTRYMODE_OPTIONAL).
4: Display onlyUsers cannot enter data
(CMDB_ATTR_ENTRYMODE_DISPLAY_ONLY).

126

Developers Reference Guide

CMDBSetAttribute function

 attributeLimitThe list of value limits for the attribute and other properties
specific to the attributes type. See the CMDBsubclassesLimitStruct definition
in cmdb.h to find the contained structure that applies to the type of attribute
that you are modifying. The limits and properties that you assign must be of the
same data type as the attribute. If you do not want to change the attribute limits
and properties, specify NULL for this parameter.

 defaultValueThe value to apply if a user does not specify a value for the
attribute. The default value can be up to 255 bytes in length and must be of the
same data type as the attribute.

 characListA list of characteristics for the attribute:


1: View PermissionsSpecify a list of groups or roles that have permissions to
view this attribute (CMDB_ATTR_CHARAC_VIEW_PERMS). When querying for

attributes, you see all attributes, including the hidden attributes. You can specify
one or more group IDs or role IDs for the permissions, separated by a semicolon,
for example, 20;-5.
2: Change PermissionsSpecify a list of groups or roles that have permissions

to view and modify the characteristics of the attribute


(CMDB_ATTR_CHARAC_CHANGE_PERMS).
3: HiddenSet the flag to false so that this attribute is hidden
(CMDB_ATTR_CHARAC_HIDDEN). This setting marks the attribute as hidden for a

group or a role. When querying for classes, you can retrieve hidden attributes.
You can specify one or more group IDs or role IDs for the permissions, separated
by a semicolon, for example, 20;3.
4: Primary KeySpecify whether the attribute is a part of the primary key of the
class (CMDB_ATTR_CHARAC_PRIMARY_KEY).
5: Propagated OwnerThe class ID and the attribute ID of the lead class

attribute from which the attribute is propagated


(CMDB_ATTR_CHARAC_PROPAGATED_OWNER). The format for this value is
sourceAttributeId;destinationAttributeId|sourceAttributeId;desti
nAtionattributeId|[additionalPairs].
6: Create ModeSet permissions for specifying data for the attribute
(CMDB_ATTR_CHARAC_CREATE_MODE).
0CMDB_ATTR_CREATE_MODE_NONENo permissions specified for the

attribute.
1CMDB_ATTR_CREATE_MODE_OPENAnyone can specify a value for the

attribute.
2CMDB_ATTR_CREATE_MODE_PROTECTEDOnly users with permissions can

specify a value for the attribute.


7: Audit OptionSet the audit option on to store the audit history for the
attribute (CMDB_ATTR_CHARAC_AUDIT_OPTION).
8: NamespaceSet the namespace of the attribute
(CMDB_ATTR_CHARAC_NAMESPACE).

Chapter 4

C API functions

127

BMC Atrium Core 7.6.03

9: DescriptionSet the description for the attribute


(CMDB_ATTR_CHARAC_DESCRIPTION).
10: Federation External NameSpecify external name for attributes of a

federated class that are mapped by way of Vendor AR System database


connectivity (ARDBC) plug-in
(CMDB_ATTR_CHARAC_FEDERATION_EXTERNAL_NAME).

 customCharacListA list of user-defined custom characteristics for the


attribute. The attribute must be between 300000
(CMDB_ATTR_CUSTOM_CHARAC_MIN) and 399999
(CMDB_ATTR_CUSTOM_CHARAC_MAX). To delete a custom characteristic, set its
data type to NULL.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

CMDBSetClass function
The CMDBSetClass function sets the class properties in the OBJSTR:Class form.
After you create a class, you cannot change the following properties: namespace,
classId, classType (CI or relationship), and persistence provider.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBSetClass(

128

ARControlStruct

*control,

CMDBClassNameId

*classNameId,

CMDBClassNameId

*newclassNameId,

CMDBClassTypeInfo

*classTypeInfo,

CMDBIndexList

*indexList,

CMDBAuditInfoStruct

*auditInfo,

ARPropList

*characList,

ARPropList

*customCharacList,

ARStatusList

*status)

Developers Reference Guide

CMDBSetClass function

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe class to set. The classNameID argument contains the


namespace name and the unique class name.

 newclassNameIdThe new name of the class. The newclassNameID argument


contains the namespace name and the unique class name.

 classTypeInfoInformation about the type of class.


 indexListThe list of indexes defined for the class. When this parameter is
specified, all previously existing indexes are replaced by its contents. To add
indexes without losing existing indexes, include the existing indexes in this list.

 auditInfoThe audit information for the class: audit type, qualification, and
Audit Only Changed Fields (auditMask). Use the following auditMask values:

 CMDB_CLASS_AUDITCHANGE_DEFAULT = 0Use the value of the Disable


Audit Only Change Fields system setting on the BMC Remedy AR System
server. The system setting default is that only changing the attribute to a
different value triggers auditing.

 CMDB_CLASS_AUDITCHANGE_YES = 1Audit when an updated field value is


different than the existing value.

 CMDB_CLASS_AUDITCHANGE_NO = 2Audit when a field value is modified,


even if the updated value is the same as the existing value.

 characListA list of characteristics for this class. Specify NULL for this
parameter if you do not want to associate characteristics with this class.
Characteristics not listed are for BMC Software internal use.
1: SingletonUsed to specify if this is a singleton class. This characteristic is an
integer value where type CMDB_CLASS_CHARAC_SINGLETON_FALSE indicates
that this is not a singleton class. Type CMDB_CLASS_CHARAC_SINGLETON_TRUE
indicates that this is a singleton class (CMDB_CLASS_CHARAC_SINGLETON).
2: AbstractThis property does not allow you to create instances for this
abstract class (CMDB_CLASS_CHARAC_ABSTRACT). After the property has been

set for the attribute, you cannot create instances for it. All the attributes are
propagated to the subclasses.
3: FinalYou cannot create subclasses from this class
(CMDB_CLASS_CHARAC_FINAL).
4: AuthorThe author of the class (CMDB_CLASS_CHARAC_AUTHOR).
5: DescriptionThe class description (CMDB_CLASS_CHARAC_DESCRIPTION).
6: Hidden permissionsGives you the permissions to modify the class
(CMDB_CLASS_CHARAC_CLASS_HIDDEN_PERMS). Marks the class as hidden for

the users in the group. When querying for classes, you can choose to retrieve
hidden classes.

Chapter 4

C API functions

129

BMC Atrium Core 7.6.03

7: Visible permissionsGives you the permissions to modify the class


(CMDB_CLASS_CHARAC_CLASS_VISIBLE_PERMS). Marks the class as visible for

the users in the group. When querying for classes, you will see all classes
including the hidden classes.
8: Categorizationq(CMDB_CLASS_CHARAC_CATEGORIZATION_SUBCLASS).
9: Form name(CMDB_CLASS_CHARAC_FORM_NAME).
10: ExposureThe visibility of the class, which can be
CMDB_CLASS_EXPOSURE_NONE, CMDB_CLASS_EXPOSURE_USED_VISIBLE, or
CMDB_CLASS_EXPOSURE_USED_HIDDEN.
12: Federation schema typeAllows you to specify the schema type for
federation (CMDB_CLASS_CHARAC_FEDERATION_SCHEMA_TYPE). This
characteristic is an integer data type, where:
0CMDB_FEDERATION_SCHEMA_REGULARIndicates that the schema is not of

type federation. 0 is the default value for this characteristic.


1CMDB_FEDERATION_SCHEMA_VENDORIndicates that the schema type is an
BMC Remedy AR System Vendor form.
13: Federation vendor nameAllows you to specify the name of the vendor
form or ARDBC plug-in name
(CMDB_CLASS_CHARAC_FEDERATION_VENDOR_NAME). Specify this characteristic
only if you set the CHARAC_FEDERATION_SCHEMA_TYPE characteristic to 1.
14: Federation vendor table nameAllows you to specify the name of the data

store from which the federated data class will retrieve the data
(CMDB_CLASS_CHARAC_FEDERATION_VENDOR_TABLE_NAME). Specify this
characteristic only if you set the CHARAC_FEDERATION_SCHEMA_TYPE
characteristic to 1.
15: Relation typeAllows you to specify the type of relationship for the
federated class (CMDB_CLASS_CHARAC_RELATION_TYPE). This characteristic,
which only applies to relationship classes, is an integer data type, where:
0CMDB_RELATION_REGULARIndicates a regular relationship that relates

two CI endpoints.
1CMDB_RELATION_QUERYIndicates that the relation type is a query used for

join conditions. 0 is the default value for this characteristic.


16: BMC Remedy AR System qualificationAllows you to specify the BMC

Remedy AR System qualification, which defines how the source class links to
the destination class in federated relationship classes
(CMDB_CLASS_CHARAC_RELATION_LINK_QUALIFIER).
17: Number of temp tables; allows you to define the maximum number of
temporary tables to create for vendor forms
(CMDB_CLASS_CHARAC_NUM_TEMP_TABLES). Do not specify a value for the
characteristic if you are working with regular (non-vendor) forms.

130

Developers Reference Guide

CMDBSetInstance function

18: Requires qualifier for the queryAllows you to specify whether a


qualification is required for the federated class in the CMDBQueryByPath
function (CMDB_CLASS_CHARAC_REQUIRES_QUALIFIER_FOR_QUERY). This

characteristic is an integer data type, where:


0CMDB_QUAL_RESTRICITVEIndicates that no qualification is required for

the query.
1CMDB_QUAL_NON_RESTRICITVEIndicates that a qualification is required
for the federated class. 1 is the default value for this characteristic. For

performance reasons, BMC recommends that you do not set this value if you
have a lot of data in the external data store and you have not specified any
qualifications against the federated data class that maps to it.

 customCharacListA list of user-defined custom characteristics for the class.


The value can be set to any user-defined characteristic but must be between
100000 (CMDB_CLASS_CUSTOM_CHARAC_MIN) and 199999
(CMDB_CLASS_CUSTOM_CHARAC_MAX). If you do not want to associate custom
characteristics with this class, specify NULL for this parameter. To delete a
custom characteristic, set its data type to NULL.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

CMDBSetInstance function
The CMDBSetInstance function sets attribute values for a CI or relationship
instance of the specified class.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBSetInstance(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameType

datasetId,

ARNameType

instanceId,

CMDBAttributeValueList

*attributeValueList,

ARStatusList

*status)

Chapter 4

C API functions

131

BMC Atrium Core 7.6.03

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class to which the instance to set belongs. The
classNameID argument contains the namespace name and the unique class

name.

 datasetIdThe unique identifier for the dataset. Instances in a dataset are


modified based on the dataset ID specified in this parameter.

 instanceIdThe unique identifier for the instance (system-generated).


 attributeValueListA list of one or more attribute and value pairs (specified in
any order) that identifies the data for the new attribute. You must specify values
for all required attributes that do not have defaults defined.
Values must be of the data type defined for the attributes or have a data type of
0. NULL values can be specified for optional attributes only. An error is
generated if an attribute does not exist or the user specified by the control
parameter does not have write permission for an attribute.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

132

Developers Reference Guide

CMDBSetMultipleAttributes function

CMDBSetMultipleAttributes function
The CMDBSetMultipleAttributes function sets multiple attributes with the
specified names for the specified class.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBSetMultipleAttribute(
ARControlStruct

*control,

CMDBClassNameId

*classNameId,

ARNameList

*attributeNameList,

ARNameList

*newAttributeNameList,

ARUnsignedIntList

*entryModeList,

CMDBAttributeLimitList

*attributeLimitList,

ARValueList

*defaultValueList,

ARPropListList

*characListList,

ARPropListList

*customCharacListList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 classNameIdThe name of the class for which the attributes need to be set. The
classNameID argument contains the namespace name and the unique class

name.

 attributeNameListThe list of attributes to set.


 newAttributeNameListThe list of new names of the attributes. The names of
each attribute must be unique within the specified class and within its
superclasses and subclasses.

 entryModeListThe list of entry modes for the attributes being set. Entry
modes not listed are for BMC Software internal use.
1: RequiredUsers must enter data (CMDB_ATTR_ENTRYMODE_REQUIRED).
2: OptionalUsers do not have to enter data, but they can if needed
(CMDB_ATTR_ENTRYMODE_OPTIONAL).
4: Display onlyUsers cannot enter data
(CMDB_ATTR_ENTRYMODE_DISPLAY_ONLY).

Chapter 4

C API functions

133

BMC Atrium Core 7.6.03

 attributeLimitListThe list of value limits for the attributes being set and
other properties specific to the attributes types. See the
CMDBsubclassesLimitStruct definition in cmdb.h to find the contained

structure that applies to the type of attributes that you are modifying. The limits
and properties that you assign must be of the same data type as the attributes. If
you do not want to change the attributes limits and properties, specify NULL for
this parameter.

 defaultValueListThe list of default values to apply if a user does not


specify a value for each of the attributes. The default value can be up to 255 bytes
in length and must be of the same data type as the attribute. Specify NULL if you
do not want to specify a default value.

 characListA list of characteristics for the attribute:


1: View PermissionsSpecify a list of groups or roles that have permissions to
view this attribute (CMDB_ATTR_CHARAC_VIEW_PERMS). When querying for

attributes, you see all attributes, including the hidden attributes. You can specify
one or more group IDs or role IDs for the permissions, separated by a semicolon,
for example, 20;-5.
2: Change PermissionsSpecify a list of groups or roles that have permissions

to view and modify the characteristics of the attribute


(CMDB_ATTR_CHARAC_CHANGE_PERMS).
3: HiddenSet the flag to false so that this attribute is hidden
(CMDB_ATTR_CHARAC_HIDDEN). This setting marks the attribute as hidden for a

group or a role. When querying for classes, you can retrieve hidden attributes.
You can specify one or more group IDs or role IDs for the permissions, separated
by a semicolon, for example, 20;3.
4: Primary KeySpecify whether the attribute is a part of the primary key of the
class (CMDB_ATTR_CHARAC_PRIMARY_KEY).
5: Propagated OwnerThe class ID and the attribute ID of the lead class

attribute from which the attribute is propagated


(CMDB_ATTR_CHARAC_PROPAGATED_OWNER). The format for this value is
sourceAttributeId;destinationAttributeId|sourceAttributeId;desti
nationAttributeId|[additionalPairs].
6: Create ModeSet permissions for specifying data for the attribute
(CMDB_ATTR_CHARAC_CREATE_MODE).
0CMDB_ATTR_CREATE_MODE_NONENo permissions specified for the

attribute.
1CMDB_ATTR_CREATE_MODE_OPENAnyone can specify a value for the

attribute.
2CMDB_ATTR_CREATE_MODE_PROTECTEDOnly users with permissions can

specify a value for the attribute.


7: Audit OptionSet the audit option on to store the audit history for the
attribute (CMDB_ATTR_CHARAC_AUDIT_OPTION).
8: NamespaceSet the namespace of the attribute
(CMDB_ATTR_CHARAC_NAMESPACE).
134

Developers Reference Guide

CMDBSetMultipleInstances function

9: DescriptionSet the description for the attribute


(CMDB_ATTR_CHARAC_DESCRIPTION).
10: Federation External NameSpecify external name for attributes of a

federated class that are mapped by way of Vendor AR System database


connectivity (ARDBC) plug-in
(CMDB_ATTR_CHARAC_FEDERATION_EXTERNAL_NAME).

 customCharacListListA list of user-defined custom characteristics list for


the attribute. The value can be set to any user-defined characteristic but must be
between 100000 (CMDB_CLASS_CUSTOM_CHARAC_MIN) and 199999
(CMDB_CLASS_CUSTOM_CHARAC_MAX). If you do not want to associate custom
characteristics with this attribute, specify NULL for this parameter. To delete a
custom characteristic, set its data type to NULL.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

CMDBSetMultipleInstances function
The CMDBSetMultipleInstances function sets attribute values for CI or
relationship instances in the specified dataset.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBSetMultipleInstances(
ARControlStruct

*control,

const ARNameType

datasetId,

const CMDBInstanceList

*instances,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 datasetIdThe unique identifier for the dataset. Instances in a dataset are


modified based on the dataset ID specified in this parameter.

 instancesThe list of instance IDs and attribute values to set.

Chapter 4

C API functions

135

BMC Atrium Core 7.6.03

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

CMDBSetServerPort function
CMDBSetServerPort function sets the TCP and RPC port number information for
the BMC Atrium CMDB server.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBSetServerPort(
ARControlStruct

*control,

int

*tcpPort,

int

*rpcPort,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 tcpPortThe TCP port number that your program will use to communicate
with the BMC Remedy AR System server. If you do not specify this parameter
or provide 0 for the port number, your program will use the port number
supplied by the portmapper. This parameter is overridden by the ARTCPPORT
environment variable.

 rpcPortThe RPC port number for the BMC Atrium Core server. Specify
390697 to use the admin thread. The default RPC port number is 390696.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.

136

Developers Reference Guide

CMDBStartJobRun function

CMDBStartJobRun function
The CMDBStartJobRun function starts an existing Reconciliation Engine job.
Before starting a job, make sure the job is defined and exists in the Active state. If
no job for the specified job name exists or the job is not Active, the
CMDBStartJobRun function returns an error. Only one instance of a specific job can
be executed at a given time.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBStartJobRun(
ARControlStruct

*control,

ARNameType

jobName,

CMDBClassQualList

*classQualList,

CMDBREDatasetList

*datasetList

ARNameType

jobRunId,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 jobNameThe name of the reconciliation job.


 classQualListThe list of class qualifications with which to substitute the
Qualification group defined for the job. In the qualification list, specify the class
ID and the qualification that applies to it, for example,
BMC_ComputerSystem, {1, ('ReconciliationId' = NULL
AND'CreateDate' > ($TIMESTAMP$ - 86400))}.

 datasetListThe list of dataset pairs, where the first one represents the
substitution dataset (working dataset) and the second represents the dataset
defined in the Reconciliation Engine job (defined dataset), for example, 2,
{BMC.IMPORT.CONFIG, BMC.SAMPLE}.

Return values
 jobRunIdA unique job identifier.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

Chapter 4

C API functions

137

BMC Atrium Core 7.6.03

CMDBSynchMetaData function
The CMDBSynchMetaData function creates BMC Remedy AR System forms from
the metadata instance in the OBJSTR:Class and OBJSTR:AttributeDefinition
forms.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBSynchMetaData(
ARControlStruct

*control,

ARNameType

pendingId,

CMDBClassNameIdList

*classNameIdList,

ARStatusList

*status)

Input arguments
 controlThe control record for the operation, which contains information
about the user requesting the operation and the server on which the operation
is to be performed.

 pendingIdThe ID of the object to be synchronized with the system.

Return values
 classNameIDListThe list of classes that are successfully synchronized with
the system. The classNameID argument contains the namespace name and the
unique class name.

 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

138

Developers Reference Guide

CMDBSystemInit function

CMDBSystemInit function
The CMDBSystemInit function performs server- and network-specific
initialization operations for internal use by BMC.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBSystemInit(
ARPropList

*propList,

ARStatusList

*status)

Return values
 propListA list of properties that need to be initialized.
 statusA list of zero or more notes, warnings, or errors generated from a call
of this function.

CMDBTermination function
The CMDBTermination function performs environment-specific cleanup routines
and disconnects from the session. All API programs that interact with the Class
Manager session should call this function upon completing work in the session.

Synopsis
#include "ar.h"
#include "arextern.h"
#include "cmdb.h"
int CMDBTermination(
ARControlStruct

*control,

ARStatusList

*status)

Input argument
controlThe control record for the operation, which contains information about
the user requesting the operation and the server on which the operation is to be
performed.

Return value
statusA list of zero or more notes, warnings, or errors generated from a call of

this function.
Chapter 4

C API functions

139

BMC Atrium Core 7.6.03

140

Developers Reference Guide

Chapter

C API data structures

This section provides reference information for the C API data structures.
The following topics are provided:





























Types of BMC Atrium CMDB C API structures (page 144)


CMDBAttributeGetStruct structure (page 146)
CMDBAttributeLimit structure (page 147)
CMDBAttributeLimitList structure (page 151)
CMDBAttributeNameId structure (page 151)
CMDBAttributeValueList structure (page 152)
CMDBAttributeValueListList structure (page 152)
CMDBAttributeValueStruct structure (page 152)
CMDBAuditInfoStruct structure (page 153)
CMDBAuditValueList structure (page 154)
CMDBAuditValueListList structure (page 155)
CMDBClassNameId structure (page 155)
CMDBClassNameIdList structure (page 155)
CMDBClassRelationship structure (page 156)
CMDBClassTypeInfo structure (page 157)
CMDBExportItem structure (page 158)
CMDBExportItemList structure (page 159)
CMDBExportItemStruct structure (page 159)
CMDBFederatedActivateInfo structure (page 161)
CMDBFederatedARInfo structure (page 162)
CMDBGetObjectList structure (page 163)
CMDBGetObjectStruct structure (page 163)
CMDBGetRelationList structure (page 163)
CMDBGetRelationStruct structure (page 164)
CMDBGraphAdjacentList structure (page 164)
CMDBGraphAdjacentStruct structure (page 165)
CMDBGraphList structure (page 165)
Chapter 5 C API data structures

141

BMC Atrium Core 7.6.03










































142

CMDBGraphStruct structure (page 166)


CMDBGraphWalkObjectList structure (page 166)
CMDBGraphWalkObjectStruct structure (page 167)
CMDBGraphWalkQueryStruct structure (page 167)
CMDBGraphWalkRelation structure (page 169)
CMDBGraphWalkRelationList structure (page 170)
CMDBGraphWalkResultStruct structure (page 171)
CMDBGraphWalkSelectorAndFilterList structure (page 172)
CMDBGraphWalkSelectorAndFilterStruct structure (page 173)
CMDBGraphWalkStateStruct structure (page 174)
CMDBImportItem structure (page 175)
CMDBImportItemList structure (page 175)
CMDBImportItemStruct structure (page 176)
CMDBIndexList structure (page 177)
CMDBIndexStruct structure (page 178)
CMDBInstanceList structure (page 178)
CMDBInstanceStruct structure (page 179)
CMDBItemTypeAttribute structure (page 179)
CMDBItemTypeClass structure (page 179)
CMDBNestedQueryStruct structure (page 180)
CMDBQualifierStruct structure (page 181)
CMDBQueryArithOpStruct structure (page 181)
CMDBQueryAttributeName structure (page 182)
CMDBQueryCardinality (page 183)
CMDBQueryObject structure (page 184)
CMDBQueryObjectList structure (page 186)
CMDBQueryObjectRelationship structure (page 186)
CMDBQueryObjectSelectorList structure (page 187)
CMDBQueryObjectSelectorStruct structure (page 188)
CMDBQueryQualifierAndOrStruct structure (page 188)
CMDBQueryQualifierSetOpStruct structure (page 189)
CMDBQueryQualifierSimpleOpStruct structure (page 190)
CMDBQueryQualifierStruct structure (page 192)
CMDBQueryQualifierValueSetStruct structure (page 193)
CMDBQueryQualifierValueStruct structure (page 194)
CMDBQueryResultGraph (page 195)
CMDBQuerySortStruct (page 197)
CMDBQuerySortList (page 197)
CMDBQueryStruct structure (page 198)
CMDBGraphQueryResult (page 200)

Developers Reference Guide

























CMDBStdEdgeResult (page 200)


CMDBEdgeListList (page 201)
CMDBNodeList (page 201)
CMDBNodeListList (page 202)
CMDBRelationshipResult (page 202)
CMDBRelationshipResultList (page 203)
CMDBREClassQualList structure (page 203)
CMDBREClassQualStruct structure (page 204)
CMDBREDatasetList structure (page 204)
CMDBREDatasetPair structure (page 205)
CMDBREJobRunInfo structure (page 205)
CMDBREJobRunInfoList structure (page 206)
CMDBSortList structure (page 206)
CMDBSortStruct structure (page 207)
CMDBUIComponentInfo structure (page 207)
CMDBUIComponentResult structure (page 211)
CMDBUIComponentResultList structure (page 212)
CMDBVersionInfo structure (page 212)
CMDBVersionInfoList structure (page 213)
CMDBWeakPropagatedAttrs structure (page 213)
CMDBWeakPropagatedAttrsList structure (page 214)
CMDBXMLExportItemList structure (page 214)
CMDBXMLImportItemList structure (page 215)

Chapter 5 C API data structures

143

BMC Atrium Core 7.6.03

Types of BMC Atrium CMDB C API structures


C API data structures are categorized by types, as listed in Table 5-1.
Table 5-1: List of data structures categorized by function type (Sheet 1 of 3)
Data structure type

List of data structures

Attribute structures: used in data model


functions.
















CMDBAttributeGetStruct
CMDBAttributeLimit
CMDBAttributeLimitList
CMDBAttributeNameId
CMDBAttributeValueList
CMDBAttributeValueListList
CMDBAttributeValueStruct
CMDBAuditInfoStruct
CMDBAuditValueList
CMDBAuditValueListList
CMDBSortList
CMDBSortStruct
CMDBWeakPropagatedAttrs
CMDBWeakPropagatedAttrsList

Export and import structures: used in export


and import functions.









CMDBItemTypeAttribute
CMDBItemTypeClass
CMDBExportItem
CMDBExportItemList
CMDBExportItemStruct
CMDBImportItem
CMDBXMLExportItemList

Export and import structures (continued)

 CMDBImportItemList
 CMDBImportItemStruct
 CMDBXMLImportItemList

Federation structures: used in federation


functions.

 CMDBFederatedActivateInfo
 CMDBFederatedARInfo

Class structures: holds CI and relationship


definitions.






General-purpose structures: used in generalpurpose functions.

 CMDBVersionInfo
 CMDBVersionInfoList

Instance structures: used for manipulating


instance data.







144

Developers Reference Guide

CMDBClassRelationship
CMDBClassTypeInfo
CMDBIndexList
CMDBIndexStruct

CMDBClassNameId
CMDBClassNameIdList
CMDBInstanceList
CMDBInstanceStruct
CMDBQualifierStruct

Types of BMC Atrium CMDB C API structures

Table 5-1: List of data structures categorized by function type (Sheet 2 of 3)


Data structure type

List of data structures

Query structures: used in queries.












































CMDBGetObjectList
CMDBGetObjectStruct
CMDBGetRelationList
CMDBGetRelationStruct
CMDBGraphAdjacentList
CMDBGraphAdjacentStruct
CMDBGraphList
CMDBGraphStruct
CMDBGraphWalkObjectList
CMDBGraphWalkObjectStruct
CMDBGraphWalkQueryStruct
CMDBGraphWalkSelectorAndFilterList
CMDBGraphWalkSelectorAndFilterStruct
CMDBGraphWalkRelation
CMDBGraphWalkRelationList
CMDBGraphWalkResultStruct
CMDBGraphWalkStateStruct
CMDBQueryArithOpStruct
CMDBQueryAttributeName
CMDBQueryCardinality
CMDBQueryObject
CMDBQueryObjectList
CMDBQueryObjectSelectorList
CMDBQueryObjectSelectorStruct
CMDBQueryQualifierAndOrStruct
CMDBQueryQualifierSetOpStruct
CMDBQueryQualifierSimpleOpStruct
CMDBQueryQualifierStruct
CMDBQueryQualifierValueSetStruct
CMDBQueryQualifierValueStruct
CMDBQueryResultGraph
CMDBQuerySortList
CMDBQuerySortStruct
CMDBQueryStruct
CMDBStdRelationship
CMDBStdRelationshipList
CMDBRelationshipResultList
CMDBEdgeListList
CMDBNodeList
CMDBNodeListList
CMDBGraphQueryResult
CMDBNestedQueryStruct

Chapter 5 C API data structures

145

BMC Atrium Core 7.6.03

Table 5-1: List of data structures categorized by function type (Sheet 3 of 3)


Data structure type

List of data structures

Reconciliation Engine structures: used in


Reconciliation Engine queries.








CMDBREClassQualList
CMDBREClassQualStruct
CMDBREDatasetList
CMDBREDatasetPair
CMDBREJobRunInfo
CMDBREJobRunInfoList

User interface components structures: used in  CMDBUIComponentInfo


UI component functions.
 CMDBUIComponentResult
 CMDBUIComponentResultList

CMDBAttributeGetStruct structure
The CMDBAttributeGetStruct structure holds the attributes to retrieve.
typedef struct CMDBAttributeGetStruct
{
unsigned int
type;
union
{
ARNameList attributeNameList;
} u;
} CMDBAttributeGetStruct;

The CMDBAttributeGetStruct structure consists of the following elements:


type

An integer value indicating the type of attributes to


retrieve.
1Retrieve all attributes in attributeNameList
(CMDB_GET_ATTR_CUSTOM_LIST).
2Retrieve all attributes except hidden attributes
(CMDB_GET_ATTR_NONHIDDEN).
3Retrieve all attributes (CMDB_GET_ATTR_ALL).

attributeNameList

146

Developers Reference Guide

The name of the attribute list.

CMDBAttributeLimit structure

CMDBAttributeLimit structure
The CMDBAttributeLimit structure holds the data limit definitions for an
attribute of any data type.
typedef struct CMDBAttributeLimit
{
unsigned int dataType;
union
{
struct
{
int
rangeLow;
int
rangeHigh;
} integerLimits;
struct
{
int
maxLength;
char
*format;
unsigned int
menuStyle;
ARNameType
charMenu;
char
*pattern;
unsigned int
qbeMatchOperation;
} charLimits;
struct
{
double
rangeLow;
double
rangeHigh;
int
precision;
} realLimits;
struct
{
char
*rangeLow;
char
*rangeHigh;
int
precision;
} decimalLimits;
struct
{
int
minDate;
int
maxDate;
} dateLimits;
struct
{
unsigned int listStyle;
union
{
ARNameList
regularList;
AREnumItemList
customList;
} u;
} enumLimits;
struct
{
char
*rangeLow;
Chapter 5 C API data structures

147

BMC Atrium Core 7.6.03

char
*rangeHigh;
int
precision;
ARCurrencyDetailList
functionalCurrencies;
ARCurrencyDetailList
allowableCurrencies;
} currencyLimits;
struct
{
unsigned long
maxSize;
ARNameType
attachmentPoolName;
} attachLimits;
} u;
}CMDBAttributeLimit;

The CMDBAttributeLimit structure consists of the following element:


dataType

An integer value indicating the data type of the


value being passed. The following table describes
the possible values.

Table 5-2: Data types list (Sheet 1 of 2)

148

Value Data type

Description

CMDB_ATTR_DATA_TYPE_NULL

Specifies a NULL value.

CMDB_ATTR_DATA_TYPE_
KEYWORD

An integer identifying the particular


keyword (defined in cmdb.h).

CMDB_ATTR_DATA_TYPE_
INTEGER

A 32-bit signed integer value.

CMDB_ATTR_DATA_TYPE_REAL

A 64-bit floating-point value.

CMDB_ATTR_DATA_TYPE_CHAR

A null-terminated string that requires


freeing allocated space. A NULL pointer
of this type is equivalent to
CMDB_ATTR_DATA_TYPE_NULL.

CMDB_ATTR_DATA_TYPE_DIARY

A null-terminated string that requires


freeing allocated space. A NULL pointer
of this type is equivalent to
CMDB_ATTR_DATA_TYPE_NULL.

CMDB_ATTR_DATA_TYPE_ENUM

A set of integer values (beginning with


zero) that represent possible selection
values as an indexed list. You must
specify an attribute limit by using
ARNameList to define string values for
each selection.

CMDB_ATTR_DATA_TYPE_
TIME

A UNIX-style date and time stamp


(number of seconds since midnight
January 1, 1970).

10

CMDB_ATTR_DATA_TYPE_
DECIMAL

A fixed-point decimal attribute. Values


must be specified in C locale, for
example, 1234.56.

11

CMDB_ATTR_DATA_TYPE_
ATTACH

An attachment attribute.

Developers Reference Guide

CMDBAttributeLimit structure

Table 5-2: Data types list (Sheet 2 of 2)


Value Data type

Description

12

CMDB_ATTR_DATA_TYPE_
CURRENCY

A currency attribute.

13

CMDB_ATTR_DATA_TYPE_DATE

A Julian date number (number of days


since January 1, 4713 BC).

14

CMDB_ATTR_DATA_TYPE_TIME_
OF_DAY

The number of seconds since 12:00 a.m. of


the current day.

37

CMDB_ATTR_DATA_TYPE_
ATTACH_POOL

A pool for grouping attachments.

NOTE
Data types represented by values not in Table 5-2 are either unsupported or
display fields.

Integer limits
The integerLimits structure holds data limit definitions for an attribute of the
integer data type. It consists of the following elements:
rangeLow
rangeHigh

The lowest integer value allowed for the attribute.


The highest integer value allowed for the attribute.

Character limits
The charLimits structure holds data limit definitions for an attribute of the
character data type. It consists of the following elements:
maxLength
format

The maximum character length allowed for the attribute.


Used for character list data, specified as Ln, where n is the
number of items in the list. L4, for example, indicates a list of a
maximum of 4 items, with each item separated by a semicolon
(;). NULL indicates that a list is not used.

Real limits
The realLimits structure holds data limit definitions for an attribute of the real
data type. It consists of the following elements:
rangeLow
rangeHigh
precision

The lowest real value allowed for the attribute.


The highest real value allowed for the attribute.
The number of integers allowed to the right of the decimal
point for an attribute of the real data type.

Chapter 5 C API data structures

149

BMC Atrium Core 7.6.03

Decimal limits
The decimalLimits structure holds data limit definitions for an attribute of the
decimal data type. It consists of the following elements:
rangeLow
rangeHigh
precision

The lowest decimal value allowed for the attribute.


The highest decimal value allowed for the attribute.
The number of integers allowed to the right of the decimal
point for an attribute of the decimal data type.

Date limits
The dateLimits structure holds data limit definitions for an attribute of the date
data type. It consists of the following elements:
minDate
maxDate

The earliest date value allowed for the attribute.


The latest date value allowed for the attribute.

Enum limits
The enumLimits structure holds data limit definitions for an attribute of the enum
data type. It consists of the following element:
regularList

A name list of possible selection values for an attribute of the


enum data type.

Currency limits
The currencyLimits structure holds data limit definitions for an attribute of the
currency data type. It consists of the following elements:
rangeLow
rangeHigh
precision
functionalCurrencies
allowableCurrencies

150

Developers Reference Guide

The lowest currency value allowed for the attribute.


The highest currency value allowed for the attribute.
The number of integers allowed to the right of the
decimal point for an attribute of the currency data type.
Default list of functional currencies when new
currency attributes are created.
Default list of allowable currencies when new currency
attributes are created.

CMDBAttributeLimitList structure

Attachment limits
The attachLimits structure holds data limit definitions for an attribute of the
attachment data type. It consists of the following elements:
maxSize
attachmentPoolName

The maximum size in bytes allowed for the attachment


attribute.
The name of the attachment pool attribute with which
this attachment attribute is associated.

CMDBAttributeLimitList structure
The CMDBAttributeLimitList structure holds a list of data limit definitions for
attributes.
typedef struct CMDBAttributeLimitList
{
unsigned int
numItems;
CMDBAttributeLimit
*limitList;
} CMDBAttributeLimitList;

The CMDBAttributeLimitList structure consists of the following elements:


numItems

An integer value indicating the number of


CMDBAttributeLimit items in the list.

limitList

The list of attribute limit items that hold the limit


definitions for the attribute.

CMDBAttributeNameId structure
The CMDBAttributeNameId structure holds the namespace name and the class
name information for a class.
typedef struct CMDBAttributeNameId
{
ARNameType
namespaceName;
ARNameType
className;
ARNameType
attributeName;
} CMDBAttributeNameId;

The CMDBAttributeNameId structure consists of the following elements:


namespaceName
className
attributeName

The namespace name for the class.


The name of the class.
The name of the attribute.

Chapter 5 C API data structures

151

BMC Atrium Core 7.6.03

CMDBAttributeValueList structure
The CMDBAttributeValueList structure holds a list of values for an attribute.
typedef struct CMDBAttributeValueList
{
unsigned int
numItems;
CMDBAttributeValueStruct *attributeValueList;
} CMDBAttributeValueList;

The CMDBAttributeValueList structure consists of the following elements:


numItems
attributeValueList

An integer value indicating the number of


CMDBAttributeValueStruct items in the list.
A list of CMDBAttributeValueStruct items.

CMDBAttributeValueListList structure
The CMDBAttributeValueListList structure holds a list of values for an
attributes list.
typedef struct CMDBAttributeValueListList
{
unsigned int
numItems;
CMDBAttributeValueList *attributeValueListList;
} CMDBAttributeValueListList;

The CMDBAttributeValueListList structure consists of the following elements:


numItems
attributeValueListList

An integer value indicating the number of


CMDBAttributeValueList items in the list.
A list of CMDBAttributeValueList items.

CMDBAttributeValueStruct structure
The CMDBAttributeValueStruct structure holds values for attributes.
typedef struct CMDBAttributeValueStruct
{
ARNameType
attributeName;
ARValueStruct
attributeValue;
} CMDBAttributeValueStruct;

The CMDBAttributeValueStruct structure consists of the following elements:


attributeName
attributeValue

152

Developers Reference Guide

The name of the attribute.


The value of the attribute.

CMDBAuditInfoStruct structure

CMDBAuditInfoStruct structure
The CMDBAuditInfoStruct data structure holds the audit information to set audit
options for the class.
typedef struct CMDBAuditInfoStruct
{
unsigned int
type;
CMDBQualifierStruct
qual;
union {
ARNameType
logForm;
} u;
CMDB_CLASS_AUDITCHANGE_MASK
} CMDBAuditInfoStruct;

auditMask;

The CMDBAuditInfoStruct structure consists of the following elements:


type

The type of audit option to set.


0No auditing option set (None).
1Create a copy of an instance when an attribute is
modified (Copy).
2Store the information for the modified attributes in
a log (Log).

qual
logForm
auditMask

The qualification to retrieve the audit information for


the class.
The name of the BMC Remedy AR System form for the
Log audit option.
The setting (Audit Only Changed Fields) for what
type of activity triggers an audit. The options for
auditMask are of the type
CMDB_CLASS_AUDITCHANGE_MASK.
CMDB_CLASS_AUDITCHANGE_DEFAULT = 0Use the

value of the Disable Audit Only Change Fields system


setting on the BMC Remedy AR System server. The
system setting default is that only changing the
attribute to a different value triggers auditing.
CMDB_CLASS_AUDITCHANGE_YES = 1Audit when an
updated field value is different than the existing
value.
CMDB_CLASS_AUDITCHANGE_NO = 2Audit when a
field value is modified, even if the updated value is the
same as the existing value.

Chapter 5 C API data structures

153

BMC Atrium Core 7.6.03

CMDBAuditValueList structure
The CMDBAuditValueList data structure holds a list of audit values to retrieve.
typedef struct CMDBAuditValueList
{
unsigned int
operation;
ARAccessNameType
changedBy;
ARTimestamp
auditTimestamp;
ARNameList
attrNameChangeList;
CMDBAuditValueList *attrAuditValueList;
} CMDBAuditValueList;

The CMDBAuditValueList structure consists of the following elements:


operation

The type of audit operation performed.


0No audit operation performed
(CMDB_AUDIT_OPERATION_NONE).
1The modify operation performed
(CMDB_AUDIT_OPERATION_SET).
2The create operation performed
(CMDB_AUDIT_OPERATION_CREATE).
3The delete operation performed
(CMDB_AUDIT_OPERATION_DELETE).
4The merge operation performed
(CMDB_AUDIT_OPERATION_MERGE).

changedBy
auditTimestamp
attrNameChangeList
attrAuditValueList

154

Developers Reference Guide

The user who performed the audit operation.


The date and time when the audit operation was
performed.
The list of attribute names that changed in the audit
operation.
The list of attribute values that changed for the
specified attributes.

CMDBAuditValueListList structure

CMDBAuditValueListList structure
The CMDBAuditValueListList data structure holds a list of audit values list to
retrieve.
typedef struct CMDBAuditValueListList
{
unsigned int
numItems;
CMDBAuditValueList *attrAuditValueList;
} CMDBAuditValueListList;

The CMDBAuditValueListList structure consists of the following elements:


numItems

An integer value indicating the number of


CMDBAuditValueList structure items in the list.

attrAuditValueList

The list of audit value list.

CMDBClassNameId structure
The CMDBClassNameId structure holds the namespace name and the class name
information for a class.
typedef struct CMDBClassNameId
{
ARNameType
namespaceName;
ARNameType
className;
} CMDBClassNameId;

The CMDBClassNameId structure consists of the following elements:


namespaceName
className

The namespace name of the class.


The name of the class.

CMDBClassNameIdList structure
The CMDBClassNameIdList structure holds a list of CMDBClassNameId structures.
typedef struct CMDBClassNameIdList
{
unsigned int
numItems;
CMDBClassNameId *classNameIdList;
} CMDBClassNameIdList;

The CMDBClassNameIDList structure consists of the following elements:


numItems
classNameIdList

An integer value indicating the number of


CMDBClassNameIditems instances in the list.
The list of class names.
Chapter 5 C API data structures

155

BMC Atrium Core 7.6.03

CMDBClassRelationship structure
The CMDBClassRelationship structure holds the relationship information of the
CI classes.
typedef struct CMDBClassRelationship
{
CMDBClassNameID
relClassNames[2];
ARNameType
roleNames[2];
unsigned int
cardinality;
ARBoolean
isRole2WeakReference;
CMDBWeakPropagatedAttrsList
weakPropagatedAttrsList;
ARBoolean
cascadeDelete;
} CMDBClassRelationship;

The CMDBClassRelationship structure consists of the following elements:


relClassNames[2]
roleNames[2]
cardinality

The names of the two classes that are a part of the


relationship.
The role names for the two classes that are a part of
the relationship.
An integer identifying the cardinality of the
relationship between the related classes:
1One-to-one, one instance of a class is associated
with a single instance of another class
(CMDB_CLASS_RELATIONSHIP_CARDINALITY_1).
2Many-to-one, one or more instances of a class
are associated with one instance of another class
(CMDB_CLASS_RELATIONSHIP_CARDINALITY
_MANY_1).
3One-to-many, one instance of a class is

associated with one or more instances of another


class
(CMDB_CLASS_RELATIONSHIP_CARDINALITY_1
_MANY).

isRole2WeakReference

4Many-to-many, many instances of a class are


associated with many instances of another class
(CMDB_CLASS_RELATIONSHIP_CARDINALITY
_MANY_MANY).
A Boolean value indicating whether role 2 is a weak
reference:
TRUEThe role 2 class is a weak reference. Role 2 is

a weak entity and it uses role 1s primary key as part


of its own key. If the value is TRUE, cardinality must
be one-to-one or many-to-many.
FALSEThe role 2 class is not a weak reference.

156

Developers Reference Guide

CMDBClassTypeInfo structure

weakPropagatedAttrsList If the value of isRole2WeakReference is TRUE,


indicates the list of attributes that are propagated
from the role 1 class to the role 2 class.
cascadeDelete
A Boolean value indicating the type of delete
allowed between the related classes:
TRUEA cascade delete is allowed. Deleting an

instance in one class also deletes the instance in the


related class.
FALSEA cascade delete is not allowed.

This item is applicable only for one-to-one and oneto-many relationships.

CMDBClassTypeInfo structure
The CMDBClassTypeInfo structure holds the class type information.
typedef struct CMDBClassTypeInfo
{
unsigned int
classType;
union
{
CMDBClassRelationship
relationshipInfo;
} u;
} CMDBClassTypeInfo;

The CMDBClassTypeInfo structure consists of the following elements:


classType

An integer value identifying the type of class.


1The class type is regular
(CMDB_CLASS_TYPE_REGULAR).
2The class type is relationship
(CMDB_CLASS_TYPE_RELATIONSHIP).

relationshipInfo

If the classType parameter value is set to 2


(CMDB_CLASS_TYPE_RELATIONSHIP), the relationship
information is retrieved.

Chapter 5 C API data structures

157

BMC Atrium Core 7.6.03

CMDBExportItem structure
The CMDBExportItem data structure holds the items to export for the specified
item type.

NOTE
This is a legacy structure of the BMC Atrium CMDB API, and has been replaced by
newer functions, CMDBExportData and CMDBExportDef.
typedef CMDBExportItem
{
unsigned int itemType;
union
{
CMDBItemTypeClass
CMDBItemTypeAttribute
}
}CMDBExportItem;

classItem;
attributeItem;

The CMDBExportItem structure consists of the following elements:


itemType

The type of item to export.


0No item to export (CMDB_ITEM_TYPE_NONE).
1Export class (CMDB_ITEM_TYPE_CLASS).
2Export attribute (CMDB_ITEM_TYPE_ATTRIBUTE).

classItem
attributeItem

158

Developers Reference Guide

The class items to import, if the itemType is


CMDB_ITEM_TYPE_CLASS.
The attribute items to import, if the itemType is
CMDB_ITEM_TYPE_ATTRIBUTE.

CMDBExportItemList structure

CMDBExportItemList structure
The CMDBExportItemList data structure holds a list of CMDBExportItemStruct
structures.

NOTE
This is a legacy structure of the BMC Atrium CMDB API, and has been replaced by
newer functions, CMDBExportData and CMDBExportDef.
typedef struct CMDBExportItemList
{
unsigned int
numItems;
CMDBExportItemStruct
*exportItemList;
} CMDBExportItemList;

The CMDBExportItemList structure consists of the following elements:


numItems
exportItemList

An integer value indicating the number of


CMDBExportItemStruct items in the list.
The list of items to export.

CMDBExportItemStruct structure
The CMDBExportItemStruct data structure holds a single item to export.

NOTE
This is a legacy structure of the BMC Atrium CMDB API, and has been replaced by
newer functions, CMDBExportData and CMDBExportDef.
typedef struct CMDBExportItemStruct
{
unsigned int
itemType;
CMDBClassNameId
classNameId;
union {
char
*qualifier;
unsigned long
exportOption;
} u;} CMDBExportItemStruct;

Chapter 5 C API data structures

159

BMC Atrium Core 7.6.03

The CMDBExportItemStruct structure consists of the following elements:


itemType

An integer value indicating the type of information to


export.
1Export class definitions (meta data)
(CMDB_ITEM_TYPE_META_DATA).
2Export instance data
(CMDB_ITEM_TYPE_INSTANCE_DATA).

classNameId
qualifier

The namespace name and the class name of the class


that contains the items to export.
A query that determines the set of entries to export. The
qualification can include one or more attributes and
any combination of conditional, relational, and
arithmetic (numeric data types only) operations.
This item is applicable only if
CMDB_ITEM_TYPE_INSTANCE_DATA is set.

exportOption

An integer value indicating the type of classes to


export. If you specified the
CMDB_ITEM_TYPE_INSTANCE_DATA value for itemType,
provide an export option.
To use more than one export option, add the value of
each option. For example, 3 indicates the class (1) and
superclasses (2) will be exported. The default value for
this parameter is NULL, which means all classes are
exported.
1Export the class only
(CMDB_EXPORT_OPTION_CLASS_ONLY).
2Export superclasses
(CMDB_EXPORT_OPTION_SUPER_CLASSES).
4Export subclasses
(CMDB_EXPORT_OPTION_SUB_CLASSES).

This option is applicable only if


CMDB_ITEM_TYPE_META_DATA is set.

160

Developers Reference Guide

CMDBFederatedActivateInfo structure

CMDBFederatedActivateInfo structure
The CMDBFederatedActivateInfo data structure holds the federated instance
data activation information to retrieve.
typedef struct CMDBFederatedActivateInfo
{
unsigned int actionType;
unsigned int accessType;
union
{
CMDBFederatedARInfo arInfo;
char
*accessString;
} u;
} CMDBFederatedActivateInfo;

The CMDBFederatedActivateInfo structure consists of the following elements:


actionType

The action to perform.


0Activate none (CMDB_FEDERATION_ACTIVATION_NONE).
1<<0Return the expanded federated interface data
(CMDB_FEDERATION_ACTIVATION_EXPAND).
1<<0Expand and launch the federated interface
(CMDB_FEDERATION_ACTIVATION_LAUNCH).

accessType

The type of access required.


0Access a BMC Remedy AR System form for the federated
interface
(CMDB_FEDERATED_ACCESS_TYPE_AR).
1Access a URL for the federated interface
(CMDB_FEDERATED_ACCESS_TYPE_URL).
2Use a web service for the federated interface
(CMDB_FEDERATED_ACCESS_TYPE_WEBSERVICE).
3Start a process for the federated interface
(CMDB_FEDERATED_ACCESS_TYPE_PROCESS).
4Access a manual launch link information for the federated
interface (CMDB_FEDERATED_ACCESS_TYPE_MANUAL).
5Access a data store for the federated interface
(CMDB_FEDERATED_ACCESS_TYPE_DATA_STORE).
6Access a data store using a federated data class
(CMDB_FEDERATED_ACCESS_TYPE_CLASS).

arInfo
accessString

Contains information related to the BMC Remedy AR System


form.
Based on the accessType subclasses, contains the URL link,
process command, class ID, or other information.

Chapter 5 C API data structures

161

BMC Atrium Core 7.6.03

CMDBFederatedARInfo structure
The CMDBFederatedARInfo data structure holds the BMC Remedy AR System
related federated interface information to retrieve.
typedef struct CMDBFederatedARInfo
{
unsigned int
arAccessType;
ARNameType
server;
ARNameType
form;
ARNameType
view;
char
*qualifier;
char
*url;
} CMDBFederatedARInfo;

The CMDBFederatedARInfo structure consists of the following elements:


arAccessType

The access type for the BMC Remedy AR System.


0Retrieve BMC Remedy AR System URL
(CMDB_FEDERATED_ACCESS_TYPE_AR_URL).
1Retrieve BMC Remedy AR System Process
(CMDB_FEDERATED_ACCESS_TYPE_AR_PROCESS).

server
form
view
qualifier
url

162

Developers Reference Guide

The BMC Remedy AR System server name.


The BMC Remedy AR System form name.
The BMC Remedy AR System view name.
The qualifier string for accessing the BMC Remedy
AR System.
Contains the URL for a BMC Remedy AR System form
or any other external website. To access a BMC
Remedy AR System form, the default web path
specified on the BMC Remedy AR System server is
used.

CMDBGetObjectList structure

CMDBGetObjectList structure
The CMDBGetObjectList data structure holds a list of CI instances.
typedef struct CMDBGetObjectList
{
unsigned int
numItems;
CMDBGetObjectStruct
*objectList;
} CMDBGetObjectList;

The CMDBGetObjectList structure consists of the following elements:


numItems

An integer value indicating the number of


CMDBGetObjectStruct items in the list.

objectList

The list of CI instances.

CMDBGetObjectStruct structure
The CMDBGetObjectStruct data structure holds a CI instance.
typedef struct CMDBGetObjectStruct
{
CMDBClassNameId
classNameId;
ARNameType
instanceId;
CMDBAttributeValueList attributeValueList;
} CMDBGetObjectStruct;

The CMDBGetObjectStruct structure consists of the following elements:


classNameId
instanceId
attributeValueList

The class name ID for the class.


The instance ID of the object.
The list of attribute values.

CMDBGetRelationList structure
The CMDBGetRelationList data structure holds a list of relationships.
typedef struct CMDBGetRelationList
{
unsigned int
numItems;
CMDBGetRelationStruct
*relationList;
} CMDBGetRelationList;

The CMDBGetRelationList structure consists of the following elements:


numItems
relationList

An integer value indicating the number of


CMDBGetRelationStruct items in the list.
The list of relationships.
Chapter 5 C API data structures

163

BMC Atrium Core 7.6.03

CMDBGetRelationStruct structure
The CMDBGetRelationStruct data structure holds a single relationship.
typedef struct CMDBGetRelationStruct
{
CMDBClassNameId
classNameId;
ARNameType
instanceId;
ARNameType
roleNames[2];
CMDBClassNameId
relatedClassNames[2];
ARNameType
relatedClassIds[2];
ARNameType
relatedInstanceIds[2];
CMDBAttributeValueList attributeValueList;
} CMDBGetRelationStruct;

The CMDBGetRelationStruct structure consists of the following elements:


classNameId
instanceId
roleNames[2]
relatedClassNames[2]
relatedClassIds[2]
relatedInstanceIds[2]
attributeValueList

The namespace name and the class name of the


relationship class.
The instance ID of the related class.
The role names for the two classes that make up the
relationship.
The names of the two classes that make up the
relationship.
The class IDs of the two classes that make up the
relationship.
The instance IDs of the two classes that make up the
relationship.
The list of relationship attribute values.

CMDBGraphAdjacentList structure
The CMDBGraphAdjacentList data structure holds a list of adjacent nodes in
CMDBGraphAdjacentStruct.
typedef struct CMDBGraphAdjacentList
{
unsigned int
numItems;
CMDBGraphAdjacentStruct *adjacents;
} CMDBGraphAdjacentList;

The CMDBGraphAdjacentList structure consists of the following elements:


numItems

An integer value indicating the number of


CMDBGraphAdjacentStruct items in the list.

adjacents

164

Developers Reference Guide

The list of adjacent nodes.

CMDBGraphAdjacentStruct structure

CMDBGraphAdjacentStruct structure
The CMDBGraphAdjacentStruct data structure holds an adjacent node.
typedef struct CMDBGraphAdjacentStruct
{
CMDBClassNameId
relClassNameId;
CMDBQualifierStruct
relQual;
CMDBAttributeGetStruct relGetAttribute;
CMDBClassNameId
objClassNameId;
ARNameType
extensionId;
CMDBQualifierStruct
objQual;
CMDBAttributeGetStruct objGetAttribute;
} CMDBGraphAdjacentStruct;

The CMDBGraphAdjacentStruct structure consists of the following elements:


relClassNamesNameId The name of the class that makes up the relationship.
relQual
The qualification string that qualifies the relationship.
This item can be NULL.
relGetAttribute
The related attribute to retrieve from the relationship.
objClassNameId
The object class name.
extensionId
The extension ID of the object. This item can contain an
empty string.
objQual
The qualification of the object. This item can be NULL.
objGetAttribute
The object attribute to retrieve.

CMDBGraphList structure
The CMDBGraphList data structure is used to define the query graph list in the
CMDBGraphQuery function.
typedef struct CMDBGraphList
{
unsigned int
numItems;
CMDBGraphStruct
*graph;
} CMDBGraphList;

The CMDBGraphList structure consists of the following elements:


numItems
graph

An integer value indicating the number of


CMDBGraphStruct items in the list.
The graph structure.

Chapter 5 C API data structures

165

BMC Atrium Core 7.6.03

CMDBGraphStruct structure
The CMDBGraphStruct data structure holds each graph node in the query graph.
typedef struct CMDBGraphStruct
{
CMDBClassNameId
classNameId;
ARNameType
extensionId;
CMDBGraphAdjacentList
adjacentList;
} CMDBGraphStruct;

The CMDBGraphStruct structure consists of the following elements:


classNameId
extensionId
adjacentList

The name of the class for the object (node).


The extension ID of the node.
The list of adjacent objects (nodes).

CMDBGraphWalkObjectList structure
The CMDBGraphWalkObjectList structure holds a list of
CMDBGraphWalkObjectStruct structures. This structure is for internal use only.
typedef struct CMDBGraphWalkObjectList
{
CMDBClassNameIdList
classNameIdList;
unsigned int
numItems;
CMDBGraphWalkObjectStruct *objectList;
}CMDBGraphWalkObjectList;

The CMDBGraphWalkObjectList structure consists of the following elements:


The list of class name Ids of all the objects walked
in the graph.
numItems
An integer value indicating the number of
CMDBGraphWalkObjectStruct instances in
the list.
CMDBGraphWalkObjectStr A pointer to the list of
uct
CMDBGraphWalkObjectStruct structures.
classNameIdList

166

Developers Reference Guide

CMDBGraphWalkObjectStruct structure

CMDBGraphWalkObjectStruct structure
The CMDBGraphWalkObjectStruct structure holds the information about the
objects walked in the relationship graph, which is required to retrieve instances in
chunks. This structure is for internal use only.
typedef struct CMDBGraphWalkObjectStruct
{
unsigned int
classNameIdIndex;
ARNameType
instanceId;
ARBoolean
bNeedToWalkFurther;
unsigned int
level;
}CMDBGraphWalkObjectStruct;

The CMDBGraphWalkObjectStruct structure consists of the following elements:


classNameIdIndex
instanceId
bNeedToWalkFurther

level

An integer value indicating the index number in the


CMDBGraphWalkObjectList array.
Instance Id of the object in the array.
A Boolean value indicating whether to stop the graph
walk for the specific object in the query or whether to
continue the walk.
Level of the node in the relationship graph.

CMDBGraphWalkQueryStruct structure
The CMDBGraphWalkQueryStruct structure holds the parameters for the query.
This structure is used in the CMDBGraphWalkBegin function to set up the starting
node in the relationship graph for the query.
typedef struct CMDBGraphWalkQueryStruct
{
ARNameType
datasetId;
unsigned int
datasetMask;
CMDBGraphWalkRelation
walkRelation;
unsigned int
numLevels;
unsigned int
maxRetrieve;
CMDB_GRAPH_WALK_QUERY_MODE
queryMode;
CMDBGraphWalkSelectorAndFilterList objSelectorAndFilterList;
}CMDBGraphWalkQueryStruct;

Chapter 5 C API data structures

167

BMC Atrium Core 7.6.03

The CMDBGraphWalkQueryStruct structure consists of the following elements:


datasetId
datasetMask

The ID of the dataset from which to retrieve the


instances.
An integer value that specifies the dataset type for the
query.
0 Based on the datasetId passed, instances are

retrieved from either the overlay or the original


dataset (CMDB_GET_MASK_NONE).
1 << 0Allows you to retrieve instances from the

current dataset only


(CMDB_GET_DATASET_MODE_CURRENT).

walkRelation
numLevels

maxRetrieve
queryMode

A CMDBGraphWalkRelation structure, which


contains the qualification for the query.
An integer value indicating the number of levels to
walk in the relationship graph. If this parameter is set
to a value of 0, the query walks all the levels in the
graph.
The maximum number of objects to retrieve from the
list of objects returned.
An integer value that specifies the properties for
querying objects in the graph. The match is based on
the qualification specified in the
CMDBGraphWalkSelectorAndFilterStruct for an
object. If no qualification is specified in
CMDBGraphWalkSelectorAndFilterStruct, all the
objects in the graph are returned.
0 Skips those nodes in the graph walk that do not

match the qualification that you specified for the


query. Use this option to get the connected graph for
a given node. The graph walk is stopped and the
results are returned when the query finds the first
node that does not match the criteria
(CMDB_GRAPH_WALK_STOP_IF_NO_MATCH_FOUND).
1The graph walk is stopped and the results are
returned when the query finds the first node that
matches the qualification. The query returns only the
matching nodes and their relationships
(CMDB_GRAPH_WALK_STOP_IF_MATCH_FOUND).
2The query walks all levels of the graph to find

matching and nonmatching nodes. The query returns


only the matching nodes and their relationships
(CMDB_GRAPH_WALK_WALK_COMPLETE_GRAPH).
objSelectorAndFilterList A objSelectorAndFilterList structure, which
contains the selection and filter criteria for the query.

168

Developers Reference Guide

CMDBGraphWalkRelation structure

CMDBGraphWalkRelation structure
The CMDBGraphWalkRelation structure holds information about the relationship
to walk recursively, the qualification for the query, and the attributes to retrieve.
typedef struct CMDBGraphWalkRelation
{
CMDBClassNameId
classNameId;
ARNameList
*getAttrList;
CMDBQualifierStruct
*qualification;
unsigned int
direction;
ARBoolean
isImpactGraphWalk;
}CMDBGraphWalkRelation;

The CMDBGraphWalkRelation structure consists of the following elements:


classNameId
getAttrList
qualification
direction

The class name and namespace for which the attribute


values are specified.
The list of attributes to retrieve.
A pointer to the CMDBQualifierStruct structure,
which holds the qualification for the query.
An integer value indicating the direction in which to
traverse the relationship graph.
0Return those relationships in which the node is the
destination (CMDB_RELATIONSHIP_DIRECTION_OUT).
1Return those relationships in which the node is the
source (CMDB_RELATIONSHIP_DIRECTION_IN).
2Return those relationships in which the node is

either the source or the destination


(CMDB_RELATIONSHIP_DIRECTION_BOTH).

isImpactGraphWalk

A boolean value indicating whether to walk only


Impact relationships in the query for the given CI.
TRUEThe CMDBGraphWalk function uses only impact
attributes in the query. The query returns only those CIs
that share Impact relationships among each other.
FALSEWalk only regular relationships in the query.

The Impact relationships for the CI are ignored.

Chapter 5 C API data structures

169

BMC Atrium Core 7.6.03

CMDBGraphWalkRelationList structure
The CMDBGraphWalkRelationList structure holds information about the
relationship graph to walk and the type of attributes to retrieve in the query.
typedef struct CMDBGraphWalkRelationList
{
CMDB_GRAPH_WALK_ATTRIBUTE_FLAG_DEFAULT
unsigned int
CMDBGraphWalkRelation
}CMDBGraphWalkRelation;

attrFlag;
numItems;
*walkRelationList;

The CMDBGraphWalkRelationList structure consists of the following elements:


attrFlag

An integer value indicating the type of attributes to


select in the query when the object list in
CMDBGraphWalkSelectorAndFilterList is empty or
NULL.
0 If attributes omitted, select nothing
(CMDB_GRAPH_WALK_ATTRIBUTE_FLAG_DEFAULT_
NONE).
1 If attributes omitted, select all non-hidden

attributes
(CMDB_GRAPH_WALK_ATTRIBUTE_FLAG_DEFAULT_
NONHIDDEN).
2 If attributes omitted, select all attributes, hidden

and non-hidden
(CMDB_GRAPH_WALK_ATTRIBUTE_FLAG_DEFAULT_
ALL).

numItems
walkRelationList

170

Developers Reference Guide

An integer value indicating the number of


CMDBGraphWalkRelation instances in the list.
A pointer to the list of CMDBGraphWalkRelation
structures.

CMDBGraphWalkResultStruct structure

CMDBGraphWalkResultStruct structure
The CMDBGraphWalkResultStruct structure holds the graph walk query results.
typedef struct CMDBGraphWalkResultStruct
{
CMDBInstanceList
relationList;
CMDBInstanceList
objectList;
}CMDBGraphWalkResultStruct;

The CMDBGraphWalkResultStruct structure consists of the following elements:


relationList
objectList

A list of relationship instances that the query


retrieved.
A list of CI instances that the query retrieved.

Chapter 5 C API data structures

171

BMC Atrium Core 7.6.03

CMDBGraphWalkSelectorAndFilterList
structure
The CMDBGraphWalkSelectorAndFilterList structure holds a list of attributes of
CMDBGraphWalkSelectorAndFilterStruct structures for a specified object.
typedef struct CMDBGraphWalkSelectorAndFilterList
{
CMDB_GRAPH_WALK_OBJECT_FLAG_DEFAULT
objFlag;
CMDB_GRAPH_WALK_ATTRIBUTE_FLAG_DEFAULT
attrFlag;
unsigned int
numItems;
CMDBGraphWalkSelectorAndFilterStruct *objSelectorAndFilterList;
}CMDBGraphWalkSelectorAndFilterList;

The CMDBGraphWalkSelectorAndFilterList structure consists of the following


elements:
objFlag

An integer value indicating the objects to retrieve in the


query.
0If no specific objects are listed in the filter, select

nothing
(CMDB_GRAPH_WALK_OBJECT_FLAG_DEFAULT_NONE).
1 If no specific objects are listed in the filter, select all

objects walked
(CMDB_GRAPH_WALK_OBJECT_FLAG_DEFAULT_ALL).

attrFlag

An integer value indicating the type of attributes to


select in the query.
0 If no specific attributes are listed in the filter, select

nothing
(CMDB_GRAPH_WALK_ATTRIBUTE_FLAG_DEFAULT_
NONE).
1 If no specific attributes are listed in the filter, select

all non-hidden attributes


(CMDB_GRAPH_WALK_ATTRIBUTE_FLAG_DEFAULT_
NONHIDDEN).
2 If no specific attributes are listed in the filter, select

all attributes, hidden and non-hidden


(CMDB_GRAPH_WALK_ATTRIBUTE_FLAG_DEFAULT_
ALL).

An integer value indicating the number of


CMDBGraphWalkSelectorAndFilterStruct
instances in the list.
objSelectorAndFilterLi A pointer to the list of
st
CMDBGraphWalkSelectorAndFilterStruct
structures.

numItems

172

Developers Reference Guide

CMDBGraphWalkSelectorAndFilterStruct structure

CMDBGraphWalkSelectorAndFilterStruct
structure
The CMDBGraphWalkSelectorAndFilterStruct structure holds the filter criteria
and the list of attributes to retrieve in the graph walk query.
typedef struct CMDBGraphWalkSelectorAndFilterStruct
{
CMDBClassNameId
classNameId;
ARNameList
*attributes;
CMDBQualifierStruct
*qualification;
} CMDBGraphWalkSelectorAndFilterStruct;

The CMDBGraphWalkSelectorAndFilterStruct structure consists of the


following elements:
classNameId
attributes
qualification

The class name and namespace for which the attribute


values are specified.
The list of attributes to retrieve.
A pointer to the CMDBQualifierStruct structure,
which holds the qualification for the query.

Chapter 5 C API data structures

173

BMC Atrium Core 7.6.03

CMDBGraphWalkStateStruct structure
The CMDBGraphWalkStateStruct structure holds the information about all the
objects walked in the graph walk query. This structure is used for query chunking
purposes. Therefore, the default value of the structure members should not be
modified.
typedef struct CMDBGraphWalkStateStruct
{
CMDBGraphWalkQueryStruct
queryStruct;
CMDBGraphWalkObjectList
walkedObjectList;
ARBoolean
hasNextChunk;
unsigned int
firstRetrieve;
unsigned int
nextObjectIndex;
}CMDBGraphWalkStateStruct;

The CMDBGraphWalkStateStruct structure consists of the following elements:


queryStruct

walkedObjectList
hasNextChunk

firstRetrieve
nextObjectIndex

174

Developers Reference Guide

A CMDBGraphWalkQueryStruct structure, which


contains the qualifications for the graph walk
query.
The list of objects walked in the query chunk.
A Boolean value that indicates whether the next
chunk is available for querying. TRUE indicates
that another chunk is available.
The object to retrieve first in case chunking is
required.
The index in the walkedObjectList array for the
parent node. This structure member is for internal
use only.

CMDBImportItem structure

CMDBImportItem structure
NOTE
This is a legacy structure of the BMC Atrium CMDB API, and has been replaced by
newer functions, CMDBImportData and CMDBImportDef.
The CMDBImportItem data structure holds the items to import for the specified
item type.
typedef CMDBImportItem
{
unsigned int itemType;
union
{
CMDBItemTypeClass
CMDBItemTypeAttribute
}
}CMDBImportItem;

classItem;
attributeItem;

The CMDBImportItem structure consists of the following elements:


itemType

The type of item to import.


0No item to import (CMDB_ITEM_TYPE_NONE).
1Import class (CMDB_ITEM_TYPE_CLASS).
2Import attribute (CMDB_ITEM_TYPE_ATTRIBUTE).

classItem
attributeItem

The class item to import.


The attribute item to import.

CMDBImportItemList structure
NOTE
This is a legacy structure of the BMC Atrium CMDB API, and has been replaced by
newer functions, CMDBImportData and CMDBImportDef.
The CMDBImportItemList data structure holds a list of items to import.
typedef struct CMDBImportItemList
{
unsigned int
numItems;
CMDBImportItemStruct
*importItemList;
} CMDBImportItemList;

Chapter 5 C API data structures

175

BMC Atrium Core 7.6.03

The CMDBImportItemList structure consists of the following elements:


numItems
importItemList

An integer value indicating the number of


CMDBImportItemStruct items in the list.
A structure that holds the list of items to import. A NULL
value indicates that all items in the specified directory
will be imported.

CMDBImportItemStruct structure
NOTE
This is a legacy structure of the BMC Atrium CMDB API, and has been replaced by
newer functions, CMDBImportData and CMDBImportDef.
The CMDBImportItemStruct data structure holds the items to import.
typedef struct CMDBImportItemStruct
{
unsigned int
itemType;
CMDBClassNameId
classNameId;
unsigned long
importOption;
} CMDBImportItemStruct;

The CMDBImportItemStruct structure consists of the following elements:


itemType

An integer value indicating the type of information to


import.
1Import class definitions (meta data)
(CMDB_ITEM_TYPE_META_DATA).
2Import instance data
(CMDB_ITEM_TYPE_INSTANCE_DATA)

176

Developers Reference Guide

CMDBIndexList structure

classNameId
importOption

The namespace name and the class name of the class


that contains the items to import.
An integer value indicating how the import of instances
is handled if any duplicates are found during the
import. These option values are mutually exclusive.
1Generate an error (AR_MERGE_ENTRY_DUP_ERROR).
2Create a new entry with a new ID if the Entry ID

attribute and the ID specified already exist in the target


class (AR_MERGE_ENTRY_DUP_NEW_ID).
3Delete the existing entry and create a new entry in

its place if the Entry ID attribute and the ID specified


already exist in the target class
(AR_MERGE_ENTRY_DUP_OVERWRITE).
4Update the attributes specified in the existing entry

if the Entry ID attribute and the ID specified already


exist in the target class (AR_MERGE_ENTRY_DUP_MERGE).
5Create an entry with a new ID
(AR_MERGE_ENTRY_NEW_ID).

These constants are the same as used by the


ARMergeEntry function in the BMC Atrium Core C
API. For more information, see the BMC Atrium Core
ar.h file.
This option is applicable only if
CMDB_ITEM_TYPE_META_DATA is set.

CMDBIndexList structure
The CMDBIndexList structure holds index information for the class.
typedef struct CMDBIndexList
{
unsigned int
numItems;
CMDBIndexStruct *indexList;
} CMDBIndexList;

The CMDBIndexList structure consists of the following elements:


numItems
indexList

An integer value indicating the number of


CMDBIndexStruct items in the list.
The set of zero or more CMDBIndexStruct items
defined for the class. Each index can include from 1 to
16 attributes (limited by AR_MAX_INDEX_subclasses).
Diary attributes and character attributes larger than 255
bytes cannot be indexed.

Chapter 5 C API data structures

177

BMC Atrium Core 7.6.03

CMDBIndexStruct structure
The CMDBIndexStruct structure holds the attributes to index.
typedef struct CMDBIndexStruct
{
unsigned int
numAttributes;
ARNameType
attributeName[AR_MAX_INDEX_subclasses];
ARBoolean
unique;
ARBoolean
isPrimaryKey;
ARNameType
indexName;
} CMDBIndexStruct;

The CMDBIndexStruct structure consists of the following elements:


numAttributes
attributeName
unique

An integer value indicating the number of attributes to


index.
The names of attributes to index.
A Boolean value indicating if the index key must be
unique:
TRUEThe index key is unique.
FALSEThe index key is not unique.

isPrimaryKey

A Boolean value indicating whether to make this index


a primary key index:
TRUEThe index key is a primary key index.
FALSEThe index key is not a primary key index.

indexName

The name of the index.

CMDBInstanceList structure
The CMDBInstanceList structure holds a list of CMDBInstanceStruct structures.
typedef struct CMDBInstanceList
{
unsigned int
numItems;
CMDBInstanceStruct
*instanceList;
} CMDBInstanceList;

The CMDBInstanceList structure consists of the following elements:


numItems

An integer value indicating the number of


CMDBInstanceStruct items in the list.

instanceList

178

Developers Reference Guide

The list of CMDBInstanceStruct structures.

CMDBInstanceStruct structure

CMDBInstanceStruct structure
The CMDBInstanceStruct structure holds a list of attribute values for a specified
class and instance.
typedef struct CMDBInstanceStruct
{
CMDBClassNameId
classNameId;
ARNameType
instanceId;
CMDBAttributeValueList attributeValueList;
} CMDBInstanceStruct;

The CMDBInstanceStruct structure consists of the following elements:


classNameId
instanceId
attributeValueList

The class name and namespace for which the attribute


values are specified.
The instance for which the attribute values are
specified.
The list of attribute values for the instance. The values
in this list are ignored for the Delete operation.

CMDBItemTypeAttribute structure
The CMDBItemTypeAttribute data structure holds a list of attribute information.
typedef struct CMDBItemTypeAttribute
{
CMDBClassNameId classNameId;
ARNameList
attribNameList;
}CMDBItemTypeAttribute;

The CMDBItemTypeAttribute structure consists of the following elements:


classNameId
attributeNameList

The ID for the class.


The list of attribute names.

CMDBItemTypeClass structure
The CMDBItemTypeClass data structure holds the class name information.
typedef struct CMDBItemTypeClass
{
CMDBClassNameId classNameId;
}CMDBItemTypeClass;

The CMDBItemTypeClass structure consists of the following element:


classNameId

The ID for the class.


Chapter 5 C API data structures

179

BMC Atrium Core 7.6.03

CMDBNestedQueryStruct structure
The CMDBNestedQueryStruct structure holds the query condition and class details
to select from the result list.
typedef struct CMDBNestedQueryStruct
{
CMDBQueryObjectList
*queryObjects;
CMDBQueryObjectList
*queryObjectsOptional;
CMDBQueryObjectSelector
*queryObjectToSelect;
} CMDBNestedQueryStruct;

The CMDBNestedQueryStruct structure consists of the following elements:


A pointer to the CMDBQueryObjectList structure,
which is used to formulate the query. The values in this
structure provide the initial condition for the recursive
query. The query is formulated based on the sequence
in which the objects are listed.
queryObjectsOptional A pointer to the CMDBQueryObjectList structure,
which specifies the optional qualifications for the
query. For example, when querying for all computer
systems in an organization, you might also want to
retrieve the printers to which these computer systems
are connected. A computer system might not
inaccessibly be connected to a printer, in which case
returning a printer becomes optional.
queryObjectsToSelect The CMDBQueryObjectSelectorStruct instance that
contains the class name and attribute to select from the
result that met the required condition.
queryObjects

180

Developers Reference Guide

CMDBQualifierStruct structure

CMDBQualifierStruct structure
The CMDBQualifierStruct structure holds the qualifier structure for the query
based on the qualifier type that is specified.
typedef struct CMDBQualifierStruct
{
unsigned int
qualifierType;
union
{
char
*qualifierString;
ARQualifierStruct
qualifierStruct;
} u;
} CMDBQualifierStruct;

The CMDBQualifierStruct structure consists of the following elements:


qualifierType

An integer value indicating the type of qualifier.


1The qualifier is a string
(CMDB_QUALIFIER_TYPE_STRING)
2The qualifier is a structure
(CMDB_QUALIFIER_TYPE_STRUCT)

qualifierString

qualifierStruct

The qualification in string format. The qualification


string can include one or more attributes and any
combination of conditional, relational, and arithmetic
(numeric data types only) operations.
The qualification in structure format.

CMDBQueryArithOpStruct structure
The CMDBQueryArithOpStruct structure is used to specify the arithmetic
operation to perform in the query qualification. This structure also holds the left
and right operands to use in the qualification.
typedef struct CMDBQueryArithOpStruct
{
CMDB_QUERY_QUAL_ARITH_OP_TYPE
struct CMDBQueryQualifierValueStruct
struct CMDBQueryQualifierValueStruct
} CMDBQueryArithOpStruct;

operation;
*operandLeft;
*operandRight;

Chapter 5 C API data structures

181

BMC Atrium Core 7.6.03

The CMDBQueryArithOpStruct structure consists of the following elements:


operation

Specifies the arithmetic operation to perform in the


query.
1 Addition (+) (CMDB_QUERY_QUAL_ARITH_OP_ADD).
2 Subtraction (-)
(CMDB_QUERY_QUAL_ARITH_OP_SUBTRACT).
3 Multiplication (*)
(CMDB_QUERY_QUAL_ARITH_OP_MULTIPLY).
4 Division (/)
(CMDB_QUERY_QUAL_ARITH_OP_DIVIDE).
5 Modulus (%)
(CMDB_QUERY_QUAL_ARITH_OP_MODULO).
6 Negate, for example, the value of +5 is converted to
-5 (CMDB_QUERY_QUAL_ARITH_OP_NEGATE).

operandLeft

operandRight

Specifies the operand that appears to the left of the


arithmetic operator. For example, for an expression of
salary/100, salary is specified in operandLeft.
Specifies the operand that appears to the right of the
arithmetic operator. From the operandLeft example,
100 is specified in operandRight.

CMDBQueryAttributeName structure
The CMDBQueryAttributeName structure holds the attribute name to return in the
query.
typedef struct CMDBQueryAttributeName
{
ARNameType
ARNameType
} CMDBQueryAttributeName;

classAlias;
attributeName;

The CMDBQueryAttributeName structure consists of the following elements:


classAlias

This alias name for the class that is specified in the


CMDBQueryObject structure. The alias must be unique
across all CMDBQueryObject objects.

attributeName

182

Developers Reference Guide

The name of the attribute to specify in the query


qualification.

CMDBQueryCardinality

CMDBQueryCardinality
The CMDBQueryCardinality structure holds the range definition for the
relationship to walk in the query. If you require the CMDBQueryByPath function
to return all BMC_ComputerSystem CIs that are connected to three or less
BMC_DiskDrive CIs, set the minCount member to 1 and the MaxCount member to
3.
typedef struct CMDBQueryCardinality
{
int
int
}CMDBQueryCardinality;

minCount;
maxCount;

The CMDBQueryCardinality structure consists of the following elements:


minCount

maxCount

.An integer value indicating the minimum number of


CI endpoints to match for a given CI in the query. A
value of zero for this member indicates that the query
qualification will be ignored and only the CI specified
in the selection criteria will be returned.
For example, if you require the query to return all
BMC_ComputerSystem CIs that are connected to one
or less BMC_Printer CIs, set the minCount member to 0.
.An integer value indicating the maximum number of
CI endpoints to match for a given CI in the query.
Specify a value in this member that is greater than
minCount.
For example, if you require the query to return all
BMC_ComputerSystem CIs that are connected to five
or less BMC_Printer CIs, set the maxCount member to 5.
If you set maxCount to 0, the query will yield incorrect
results.

Chapter 5 C API data structures

183

BMC Atrium Core 7.6.03

CMDBQueryObject structure
The CMDBQueryObject structure holds the qualification for the query, such as
whether to retrieve a CI or a relationship class and how many levels to walk in the
graph.
typedef struct CMDBQueryObject
{
CMDBClassNameId
classNameId;
ARNameType
alias;
ARNameType
sourceNodeAlias;
CMDBQueryQualifierStruct
*qualification;
CMDB_QUERY_OBJECT_TYPE
queryObjectType;
CMDB_QUERY_JOIN_TYPE
joinType;
CMDBQueryQualifierStruct
*joinQualification;
union
{
CMDBQueryObjectRelationship relationshipInfo
} u;
} CMDBQueryObject;

The CMDBQueryObject structure consists of the following elements:


classNameId
alias

sourceNodeAlias

qualification
queryObjectType

The class name and namespace of the instance to query.


The alias name for the class that is specified in the
CMDBQueryObject structure. The alias must be unique
across all CMDBQueryObject objects.
The alias name of the source CI class for which the
related endpoints are requested in the query. Specify
this parameter when requesting multiple relationships
for a given CI class. This member is not required for
querying linear relationships in the format C->R->C.
If the value in this member is NULL, the previous node
in the query graph is the source node by default.
The CMDBQueryQualifierStruct structure that holds
the qualification for the query.
An integer value that specifies whether the query object
to retrieve is a CI (regular) or a relationship class.
1The class type is regular
(CMDB_CLASS_TYPE_REGULAR).
2The class type is relationship
(CMDB_CLASS_TYPE_RELATIONSHIP).

184

Developers Reference Guide

CMDBQueryObject structure

joinType

The type of join to execute in the query for any two


consecutive query objects in the query object list. You
can create an explicit join to relate any two CIs, even if
they do not have a relationship class connecting them.
-1No explicit Join type to perform in the query
(CMDB_QUERY_JOIN_TYPE_NONE =-1). If no explicit
Join type is specified, an INNER join is performed in the
query, using the relationship attributes in the
qualification.
0The Join type to perform in the query is Inner join.
(CMDB_QUERY_JOIN_TYPE_INNER = 0).
1The Join type to perform in the query is Left Outer
join. (CMDB_QUERY_JOIN_TYPE_LEFT = 1).
2The Join type to perform in the query is Right Outer
join. (CMDB_QUERY_JOIN_TYPE_RIGHT = 2).

joinQualification

The explicit join condition to execute in the query in


conjunction with the joinType.
For example, to determine the impact relationships for
the C1 class in the query C1->R1->C2, the joinType of
R1 is specified as Inner and the join qualification is
specified as C1.instanceid=
R1.impactdestinationid.
The joinType of C2 is Inner and the join qualification is
C2.instanceid = R2.impactsourceid.

relationshipInfo

A CMDBQueryObjectRelationship object that defines


the direction to walk in the graph and the minimum
and maximum number of relationships to return for the
specified CI class.

Chapter 5 C API data structures

185

BMC Atrium Core 7.6.03

CMDBQueryObjectList structure
The CMDBQueryObjectList structure holds a list of CMDBQueryObject structures.
Depending on the complexity of the query, CMDBQueryObjectList can have
multiple CMDBQueryObject structures. The first query object in the list should
always be a CI, followed by a relationship object, and then a CI object again. This
object structure is represented by C-->(R-->C)*, where (R-->C) can occur more than
once.
typedef struct CMDBQueryObjectList
{
unsigned int
numItems;
CMDBQueryObject
*queryObjectlist;
} CMDBQueryObjectList;

The CMDBQueryObjectList structure consists of the following elements:


numItems
queryObjectList

An integer value indicating the number of


CMDBQueryObject items in the list.
The list of CMDBQueryObject structures.

CMDBQueryObjectRelationship structure
The CMDBQueryObjectRelationship structure holds the information about the
relationship, such as the direction and the number of relationships to traverse in
the query.
typedef struct CMDBQueryObjectRelationship
{
unsigned int
direction;
CMDBQueryCardinality
downstreamCardinality;
} CMDBQueryObjectRelationship;

The CMDBQueryObjectRelationship structure consists of the following elements:


direction

The direction of the relationship map to traverse if the


class type in the queryObjectType parameter is
relationship.
0Relationship of a CI where the given CI is the

source (on the left), arrow coming out from the node
(CMDB_RELATIONSHIP_DIRECTION_OUT).
1Relationship of a CI where the given CI is the

destination (on the right), arrow pointing at the node


(CMDB_RELATIONSHIP_DIRECTION_IN).

downstreamCardinality A CMDBQueryCardinality object that contains


information about the number of relationships to
traverse in the query.

186

Developers Reference Guide

CMDBQueryObjectSelectorList structure

CMDBQueryObjectSelectorList structure
The CMDBQueryObjectSelectorList structure holds a list of
CMDBQueryObjectSelector structures. Depending on the list of attributes and
values requested in the query result, the CMDBQueryObjectSelectorList structure
can have multiple CMDBQueryObjectSelector items.
typedef struct CMDBQueryObjectSelectorList
{
unsigned int
numItems;
CMDBQueryObjectSelector
*queryObjectSelectorList;
unsigned int
flags;
} CMDBQueryObjectSelectorList;

The CMDBQueryObjectSelectorList structure consists of the following elements:


numItems

An integer value indicating the number of


CMDBQueryObjectSelector items in the list.

queryObjectSelectorList The list of CMDBQueryObjectSelector structures.


flags
Specifies the attributes to retrieve in the query.
0The attributes to fetch are none. The query fetches

the instance ID attribute by default when the flag is


set to this option.
(CMDB_QUERY_OBJECTSELECTOR_FLAG_DEFAULT
_NONE).
2The query fetches all non-hidden attributes
(CMDB_QUERY_OBJECTSELECTOR_FLAG_DEFAULT_
NONHIDDEN).
3The query fetches all hidden and non-hidden

attributes
(CMDB_QUERY_OBJECTSELECTOR_FLAG_DEFAULT
_ALL).

Chapter 5 C API data structures

187

BMC Atrium Core 7.6.03

CMDBQueryObjectSelectorStruct structure
The CMDBQueryObjectSelector structure holds the list of attributes to retrieve
from the query result.
typedef struct CMDBQueryObjectSelectorStruct
{
ARNameType
alias;
ARNameList
*attributes;
} CMDBQueryObjectSelectorStruct;

The CMDBQueryObjectSelectorStruct structure consists of the following elements:


alias

attributes

The alias name for the class that is specified in the


CMDBQueryObject structure. The alias must be unique
across all CMDBQueryObject and
queryObjectsOptional objects.
The list of attributes to return for the given class
referred by the alias.

CMDBQueryQualifierAndOrStruct structure
The CMDBQueryQualifierAndOrStruct structure holds the left and right
operands of a query.
typedef struct CMDBQueryQualifierAndOrStruct
{
struct CMDBQueryQualifierStruct *operandLeft;
struct CMDBQueryQualifierStruct *operandRight;
} CMDBQueryQualifierAndOrStruct;

The CMDBQueryQualifierAndOrStruct structure consists of the following


elements:
operandLeft

The CMDBQueryQualifierStruct instance that


contains the value that appears to the left of the AND or
OR logical condition.
For example, in the qualification, Type = Operating
system AND Model = Microsoft Windows XP, the
Type qualification is specified in operandLeft.

operandRight

The CMDBQueryQualifierStruct instance that


contains the value that appears to the right of the AND
or OR logical operator.
For example, in the qualification, Type = Operating
system AND Model = Microsoft Windows XP, the
Model qualification is specified in operandRight.

188

Developers Reference Guide

CMDBQueryQualifierSetOpStruct structure

CMDBQueryQualifierSetOpStruct structure
The CMDBQueryQualifierSetOpStruct structure is used to specify the attribute
and right operand for an IN or NOT IN type of operation.
typedef struct CMDBQueryQualifierSetOpStruct
{
unsigned int
operation;
ARNameType
attribute;
CMDBQueryQualifierValueSetStruct
*operandRight;
} CMDBQueryQualifierSetOpStruct;

The CMDBQueryQualifierSetOpStruct structure consists of the following


elements:
operation

An integer value indicating the type of SET operation to


perform in the query.
8An IN operation to perform in the query, for
example, Model IN Microsoft Windows XP,
Microsoft Windows 2003, Microsoft Windows
2000
(CMDB_QUERY_QUAL_SETOP_IN).
9A NOT IN operation to perform in the query, for
example, Model NOT IN Microsoft Windows XP,
Microsoft Windows 2003, Microsoft Windows
2000
(CMDB_QUERY_QUAL_SETOP_NOT_IN).

attribute

operandRight

The name of the attribute in the qualification that


should match a specific value, for example, ClassName
= BMC_ComputerSystem. In this example, ClassName,
will be specified in attribute, which is the left
operand in the expression.
A pointer to the
CMDBQueryQualifierValueSetStruct structure,
which contains the list of values or query for the Set
operation.

Chapter 5 C API data structures

189

BMC Atrium Core 7.6.03

CMDBQueryQualifierSimpleOpStruct structure
The CMDBQueryQualifierSimpleOpStruct structure holds the attribute and the
right operand for a SIMPLE type of operation.
typedef struct CMDBQueryQualifierSimpleOpStruct
{
unsigned int
operation;
ARNameType
attribute;
CMDBQueryQualifierValueStruct
*operandRight;
} CMDBQueryQualifierSimpleOpStruct;

The CMDBQueryQualifierSimpleOpStruct structure consists of the following


elements:
operation

An integer value indicating the type of relational or


inequality operation to perform in the query.
1Equal to (=)
(CMDB_QUERY_QUAL_SIMPLEOP_EQUAL).
2Greater than (>)
(CMDB_QUERY_QUAL_SIMPLEOP_GREATER).
3Greater than or equal to (> =)
(CMDB_QUERY_QUAL_SIMPLEOP_GREATER_EQUAL).
4Less than (<)
(CMDB_QUERY_QUAL_SIMPLEOP_LESS).
5Less than or equal to (< =)
(CMDB_QUERY_QUAL_SIMPLEOP_LESS_EQUAL).
6Not equal to (!=)
(CMDB_QUERY_QUAL_SIMPLEOP_NOT_EQUAL).
7Like (Like) (CMDB_QUERY_QUAL_SIMPLEOP_LIKE).

190

Developers Reference Guide

CMDBQueryQualifierSimpleOpStruct structure

attribute

operandRight

The name of the attribute in the qualification that


should match a specific value, for example, ClassName
= BMC_ComputerSystem. In this example, ClassName
will be specified in attribute.
A pointer to the CMDBQueryQualifierValueStruct,
which specifies the type of qualifier operand that
appears to the right of the relational or inequality
operator.
1 The right operand is a value, for example,
ClassName = BMC_ComputerSystem. In this example,
BMC_ComputerSystem will be specified in
operandRight
(CMDB_QUERY_QUAL_VALUE_TYPE_VALUE).
2 The right operand is an attribute name, which can be

of the current query object class or of another class, for


example, ClassName = A1.ClassName. In this
example, A1.ClassName will be specified in
operandRight
(CMDB_QUERY_QUAL_VALUE_TYPE_ATTRIBUTENAME).
3 The right operand is an arithmetic expression, for
example, QtyInStock = 90/100. In this example, the

arithmetic operator / will be specified in the


operandRight
(CMDB_QUERY_QUAL_VALUE_TYPE_ARITHMETIC).

Chapter 5 C API data structures

191

BMC Atrium Core 7.6.03

CMDBQueryQualifierStruct structure
The CMDBQueryQualifierStruct structure holds the qualification for the query.
CIs and relationships that the query returns depend on the qualification specified
in this structure. This is a top-level structure that holds the query qualifications.
typedef struct CMDBQueryQualifierStruct
{
CMDB_QUERY_QUAL_OP_TYPE
union
{
CMDBQueryQualifierAndOrStruct
struct CMDBQueryQualifierStruct
CMDBQueryQualifierSimpleOpStruct
CMDBQueryQualifierSetOpStruct
} u;
} CMDBQueryQualifierStruct;

operation;

andor;
*notQual;
*simpleOp;
*setOp;

The CMDBQueryQualifierStruct structure consists of the following elements:


operation

Specifies the type of logical operation to perform in the query.


Depending on the option that is set for operation, specify the
value for any one of the other members in the structure.
0 No logical operation to perform in the query
(CMDB_QUERY_QUAL_OP_NONE)
1 The logical operation to perform in the query is AND
(CMDB_QUERY_QUAL_OP_AND).
2 The logical operation to perform in the query is OR
(CMDB_QUERY_QUAL_OP_OR).
3 The logical operation to perform in the query is NOT, for
example, != (CMDB_QUERY_QUAL_OP_NOT)
4 The logical operation to perform in the query is SIMPLE
(CMDB_QUERY_QUAL_OP_SIMPLE).
5 The logical operation to perform in the query is SET
(CMDB_QUERY_QUAL_OP_SET).

andor

A CMDBQueryQualifierAndOrStruct structure that specifies


the left and right operand in a AND or OR logical operation if
operation is set to either CMDB_QUERY_QUAL_OP_AND or
CMDB_QUERY_QUAL_OP_OR.

notQual

A CMDBQueryQualifierStruct structure that specifies the !=


condition for the logical operation if operation is set to
CMDB_QUERY_QUAL_OP_NOT.

192

Developers Reference Guide

CMDBQueryQualifierValueSetStruct structure

simpleOp

setOp

A CMDBQueryQualifierSimpleOpStruct structure that


specifies the simple logical operation to perform, for example, =,
<, or >.
A CMDBQueryQualifierSetOpStruct structure that specifies
the IN, or NOT IN operation to perform, for example, Model
NOT IN Microsoft Windows XP, Microsoft Windows 2003,
Microsoft Windows 2000.

CMDBQueryQualifierValueSetStruct structure
The CMDBQueryQualifierValueSetStruct structure holds literal values or the
query statement for a nested query.
typedef struct CMDBQueryQualifierValueSetStruct
{
unsigned int type;
union
{
ARValueList
valueSet;
struct CMDBNestedQueryStruct
*query;
} u;
} CMDBQueryQualifierValueSetStruct;

The CMDBQueryQualifierValueSetStruct structure consists of the following


elements:
type

Specifies the type of query value for a SET operation.


Depending on the option that is set for type, specify the
value for any one of the other members in the structure.
1 A set of values specified to compare against in the

nested query
(CMDB_QUERY_QUAL_VALUESET_TYPE_VALUESET).
2 The inner query to use in the nested query statement
(CMDB_QUERY_QUAL_VALUESET_TYPE_QUERY).

valueSet

The list of literal values for the SET query statement, for
example, Model IN Microsoft Windows XP,
Microsoft Windows 2003, Microsoft Windows
2000. This member is filled in if type is set to 1.

query

A pointer to the CMDBNestedQueryStruct structure


that holds the inner query in a nested query, for
example, Select computerId from
ComputerSystem where locationId in (select
locId from PhysicalLocation where LocName !=
Sunnyvale). This member is filled in if type is set
to 2.

Chapter 5 C API data structures

193

BMC Atrium Core 7.6.03

CMDBQueryQualifierValueStruct structure
The CMDBQueryQualifierValueStruct structure holds the set of values and
query conditions for a nested query.
typedef struct CMDBQueryQualifierValueStruct
{
CMDB_QUERY_QUAL_VALUE_TYPE
type;
union
{
ARValueStruct
value;
CMDBQueryAttributeName
attributeName;
CMDBQueryArithOpStruct
arithOp;
} u;
} CMDBQueryQualifierValueStruct;

The CMDBQueryQualifierValueStruct structure consists of the following


elements:
type

Specifies the object type for the structure instance that


appears to the right of the logical operator. Depending
on the option that is set for type, specify the value for
any one of the other members in the structure.
1 The right operand is a
value(CMDB_QUERY_QUAL_VALUE_TYPE_VALUE).
2 The right operand is an attribute name of a class
(CMDB_QUERY_QUAL_VALUE_TYPE_ATTRIBUTENAME).
3 The right operand is an arithmetic expression
(CMDB_QUERY_QUAL_VALUE_TYPE_ARITHMETIC).

value

The literal value for the query if type is set to


CMDB_QUERY_QUAL_VALUE_TYPE_VALUE.

attributeName

arithOp

194

Developers Reference Guide

A CMDBQueryAttribteName structure that specifies


the attribute name for the query if the type is set to
CMDB_QUERY_QUAL_VALUE_TYPE_ATTRIBUTENAME.
The CMDBQueryArithOpStruct structure for the query
if type is set to
CMDB_QUERY_QUAL_VALUE_TYPE_ARITHMETIC. The
structure holds the arithmetic operator and value for
the attribute, for example, / 100.

CMDBQueryResultGraph

CMDBQueryResultGraph
The CMDBQueryResultGraph structure is used to return the query results in a list
or a graph format depending on the format requested.
typedef struct CMDBQueryResultGraph
{
CMDB_QUERY_RESULT_FORMAT_TYPE
formatType;
unsigned int
numItems;
unsigned int
*numMatches;
ARNameList
aliasOrderForListFormat;
union
{
CMDBInstanceList *instanceListList;
CMDBGraphQueryResult *graphQueryResult;
} u;
} CMDBQueryResultGraph;

The CMDBQueryResultGraph structure consists of the following elements:


formatType

The format in which to return the CI and


relationships that match the query criteria.
0The query results are returned in a list or linear

format
(CMDB_QUERY_RESULT_STRUCT_FORMAT_LIST).
1The query results are divided in two parts: a
list of CI nodes and a list of relationship edges,
which helps in constructing a CI and relationship
graph
(CMDB_QUERY_RESULT_STRUCT_FORMAT_CMDB_G
RAPH).
2The query results are returned in a graph

format if the number of rows that matches the


criteria is within the chunk size. The results are
returned in a list format if the number of rows
that matches is greater than the chunk size
(CMDB_QUERY_RESULT_STRUCT_FORMAT_
CHUNK_BASED).

numItems

numMatches

An integer value indicating the number of


CMDBInstanceList items returned by the query
if the format type requested is
CMDB_QUERY_RESULT_STRUCT_FORMAT_LIST.
A pointer to the numMatches member that holds
the number of CI and relationship instances that
the query matched. This member contains a NULL
value if the numMatches member of the
CMDBQueryStruct structure is set to FALSE.

Chapter 5 C API data structures

195

BMC Atrium Core 7.6.03

aliasOrderForListFormat

The order of query object aliases to which the row


of instances belong in the results that are
returned.
For example, if you specify alias order as
personqueryobj, computersqueryobj,
monitorsqueryobj in the selector list and instruct
the query to return instance IDs for them, the
alias order associates the instances IDs in the
result row with query object in the selector list.

instanceListList

graphQueryResult

The alias order is applicable only to the list format


type.
The list of CMDBInstanceList structures that
hold the CIs and relationships returned by the
query in a list or linear format.
A pointer to the top-level query result structure
that holds the query results if the format type
requested is
CMDB_QUERY_RESULT_STRUCT_FORMAT_CMDB_GR
APH.

196

Developers Reference Guide

CMDBQuerySortStruct

CMDBQuerySortStruct
The CMDBQuerySortStruct structure is used to sort the results that the CMDBQuery
function returns, based on the attribute specified in the CMDBQuerySortStruct
structure.
typedef struct CMDBQuerySortStruct
{
ARNameType
alias;
ARNameType
attributeName;
unsigned int
sortorder;
} CMDBQuerySortStruct;

The CMDBQuerySortStruct structure consists of the following elements:


alias

attributeName

This alias name for the class that is specified in the


CMDBQueryObject structure. The alias must be unique
across all CMDBQueryObject objects.
The attribute name on which to sort the result list that
the query returns.
Note: Make sure that the attributes you specify belong to the

CI nodes that are a part of the query inputs. Otherwise, the


sort functionality might not yield results.

sortOrder

An integer value indicating the sort order for the


attribute.
1 The attribute is sorted in ascending order
(CMDB_QUERY_SORT_ASCENDING).
2 The attribute is sorted in descending order
(CMDB_QUERY_SORT_DESCENDING).

CMDBQuerySortList
The CMDBQuerySortList structure holds a list of CMDBQuerySortStruct
structures.
typedef struct CMDBQuerySortList
{
unsigned int
numItems;
CMDBQuerySortStruct *querySortList;
} CMDBQuerySortList;

The CMDBQuerySortList structure consists of the following elements:


numItems
querySortList

An integer value indicating the number of


CMDBQuerySortStruct items in the list.
The list of attributes and their sort orders, which is the
basis for sorting the results that the query returns.

Chapter 5 C API data structures

197

BMC Atrium Core 7.6.03

CMDBQueryStruct structure
The CMDBQueryStruct structure holds a list of query objects with qualification for
the instances to retrieve. This is a top-level structure, which is used in the
CMDBQueryByPath function.
typedef struct CMDBQueryStruct
{
ARNameType
unsigned int
CMDBQueryObjectList
CMDBQueryObjectOptionalList
CMDBQueryObjectSelectorList
unsigned int
unsigned int
CMDB_QUERY_STRUCT_MASK_TYPE
CMDBQuerySortList
ARBoolean
} CMDBQueryStruct;

datasetId;
datasetMask;
*queryObjects;
*queryObjectsOptional;
*queryObjectsToSelect;
firstRetrieve;
maxRetrieve;
queryMask;
querySortList;
numMatches;

The CMDBQueryStruct structure consists of the following elements:


datasetId
datasetMask

The ID of the dataset from which to retrieve the


instances.
An integer value that specifies the dataset type for the
query.
0 Based on the datasetId passed, instances are

retrieved from either the overlay or the original dataset


(CMDB_GET_MASK_NONE).
1 << 0Allows you to retreive instances from the

current dataset only


.(CMDB_GET_DATASET_MODE_CURRENT).
queryObjects
A pointer to CMDBQueryObjectList, which contains a
list of CMDBQueryObject structures that specify the
qualifications for the instance to retrieve.
queryObjectsOptional A pointer to the CMDBQueryObjectList structure,
which specifies the optional qualifications for the
query. For example, when querying for all computer
systems in an organization, you might also want to
retrieve the printers to which these computer systems
are connected. A computer system might not be
connected to a printer, in which case returning a printer
becomes optional.
queryObjectsToSelect A pointer to CMDBQueryObjectSelectorList, which
contain the class name and attributes to select from each
instance in the result that met the required condition.
firstRetrieve
The first object to retrieve from the list of objects
returned.

198

Developers Reference Guide

CMDBQueryStruct structure

maxRetrieve
queryMask

The maximum number of objects to retrieve from the


list of objects returned.
An integer value that specifies the properties for
returning the query results.
0The query results are returned in a list or linear
format (CMDB_QUERY_RESULT_STRUCT_FORMAT_LIST).
1The query results are divided in two parts: a list of

CIs nodes and a list of relationship edges, which helps


in constructing a CI and relationship graph
(CMDB_QUERY_RESULT_STRUCT_FORMAT_CMDB_GRAPH).
2The query results are returned in a graph format if

the number of rows that matches the criteria is within


the chunk size. The results are returned in a list format
if the number of rows that matches is greater than the
chunk size (CMDB_QUERY_RESULT_STRUCT_FORMAT_
CHUNK_BASED).

querySortList
numMatches

The list of attributes and the sort orders, based on which


the query results are returned.
A Boolean value indicating whether to return the total
number of CI and relationship instances that the call
matched in the query.
TRUEReturn the number of instances that match the

query.
FALSENo matched instances to return.

Chapter 5 C API data structures

199

BMC Atrium Core 7.6.03

CMDBGraphQueryResult
The CMDBGraphQueryResult structure holds the results that the
CMDBQueryByPath function returns. The query returns the results in a graph
format or a linear format. When requested in a graph format, the query results are
grouped and stored in two parts: CIs and relationships.
If the query result contains a CI with two different relationships, the CI list will
includes only one entry for the specific CI. For example, if a BMC_Printer instance
is connected to two different BMC_ComputerSystem instances, the BMC_Printer
instance is listed only once.
The CMDBGraphQueryResult structure is a top-level result structure, which uses
CMDBNodeListList to store the list of CIs and CMDBEdgeListList to store the list
of relationships to return for the query results.
typedef struct CMDBGraphQueryResult
{
CMDBNodeListList
nodeListList;
CMDBEdgeListList
edgeListList;
} CMDBGraphQueryResult;

The CMDBGraphQueryResult structure consists of the following elements:


nodeListList
edgeListList

The list of CMDBNodeListList structures that hold the


CIs returned in the query.
The list of CMDBEdgeListList structures that hold the
relationships returned in the query.

CMDBStdEdgeResult
The CMDBStdEdgeResult structure holds the relationship part of the query
result.
typedef struct CMDBStdEdgeResult
{
ARNameType
alias;
CMDBStdRelationshipList relationshipList;
} CMDBStdEdgeResult;

The CMDBStdEdgeResult structure consists of the following elements:


alias

relationshipList

200

Developers Reference Guide

The alias name for the class that is specified in the


CMDBQueryObject structure. The alias must be unique
across all CMDBQueryObject objects.
The CMDBStdRelationshipList structure that holds
the relationship part of the query result.

CMDBEdgeListList

CMDBEdgeListList
The CMDBEdgeListList structure holds a list of CMDBRelationshipResultList
structures that store the relationship part of the query result.
typedef struct CMDBEdgeListList
{
unsigned int
numItems;
CMDBRelationshipResultList *relationshipResultList;
} CMDBEdgeListList;

The CMDBEdgeListList structure consists of the following elements:


An integer value indicating the number of
CMDBRelationshipResultList items in the list.
relationshipResultList A pointer to the CMDBRelationshipResultList
structure that holds the relationship part of the query
result.

numItems

CMDBNodeList
The CMDBNodeList structure holds the CI part of the query result.
typedef struct CMDBNodeList
{
ARNameType
alias;
CMDBInstanceList instanceList;
} CMDBNodeList;

The CMDBNodeList structure consists of the following elements:


alias

instanceList

The alias name for the class that is specified in the


CMDBQueryObject structure. The alias must be unique
across all CMDBQueryObject objects.
A list of CMDBInstanceStruct structures that hold the
attribute values for a specified class and instance.

Chapter 5 C API data structures

201

BMC Atrium Core 7.6.03

CMDBNodeListList
The CMDBNodeListList structure holds a list of CMDBNodeList structures that
store the CI part of the query result.
typedef struct CMDBNodeListList
{
unsigned int
numItems;
CMDBNodeList
*nodeList;
} CMDBNodeListList;

The CMDBNodeListList structure consists of the following elements:


numItems
nodeList

An integer value indicating the number of


CMDBNodeList items in the list.
A pointer to the CMDBNodeList structure that holds the
CI part of the query result.

CMDBRelationshipResult
The CMDBRelationshipResult structure holds the source instance ID, destination
instance ID, and a pointer to the relationship object for the relationship instances
returned in the query results for the specified CI.
typedef struct CMDBRelationshipResult
{
ARNameType
srcInstanceId;
ARNameType
destInstanceId;
CMDBInstanceStruct *relationshipInstance;
} CMDBRelationshipResult;

The CMDBRelationshipResult structure consists of the following elements:


srcInstanceId
destinationInstanceId
relationshipInstance

202

Developers Reference Guide

The source instance ID in the relationship.


The destination CI in the relationship.
A pointer to the CMDBInstanceStruct structure that
holds the relationship instance information.

CMDBRelationshipResultList

CMDBRelationshipResultList
The CMDBRelationshipResultList structure holds a list of
CMDBRelationshipResult structures that store the relationship information for
the results returned by the query.
typedef struct CMDBRelationshipResultList
{
ARNameType
alias;
unsigned int
numItems;
CMDBRelationshipResult
*relationshipInstance;
} CMDBRelationshipResultList;

The CMDBRelationshipResultList structure consists of the following elements:


alias

numItems
relationshipInstance

The alias name for the class that is specified in the


CMDBQueryObject structure. The alias must be unique
across all CMDBQueryObject objects.
An integer value indicating the number of
CMDBRelationshipResult items in the list.
A pointer to the CMDBRelationshipResult structure
that holds the source instance ID and destination
instance ID information for the relationships returned
in the query.

CMDBREClassQualList structure
The CMDBREClassQualList data structure holds a list of
CMDBREClassQualStruct structures.
typedef struct CMDBREClassQuaList
{
unsigned int
numItems;
CMDBREClassQualStruct
*classQualList;
}CMDBREClassQuaList;

The CMDBREClassQualList structure consists of the following elements:


numItems

An integer value indicating the number of


CMDBREClassQualStruct structure items in the list.

classQualList

A list of CMDBClassQualStruct structures.

Chapter 5 C API data structures

203

BMC Atrium Core 7.6.03

CMDBREClassQualStruct structure
The CMDBREClassQualStruct data structure holds information about the class
qualification.
typedef struct CMDREBClassQualStruct
{
ARNameType
classId;
CMDBQualifierStruct
*qual;
}CMDBREClassQualStruct;

The CMDBREClassQualStruct structure consists of the following elements:


classId
qual

The ID of the class.


The qualification for the class. If the qualification
contains a null value, all the instances in the class are
reconciled.

CMDBREDatasetList structure
The CMDBREDatasetList data structure holds a list of CMDBREDatasetPair
structures.
typedef Struct CMDBREDatasetList
{
Unsigned int
numItems;
CMDBREDatasetPair* datasetList;
}CMDBREDatasetList;

The CMDBREDatasetList structure consists of the following elements:


numItems

An integer value indicating the number of


CMDBREDatasetPair items in the list.

datasetList

204

Developers Reference Guide

A list of CMDBREDatasetPair items.

CMDBREDatasetPair structure

CMDBREDatasetPair structure
The CMDBREDatasetPair data structure holds information about the datasets to
use in the reconciliation job.
typedef Struct CMDBREDatasetPair
{
ARNameType workingDataset;
ARNameType dataset;
}CMDBREDatasetPair;

The CMDBREDatasetPair structure consists of the following elements:


workingDataset

dataset

The dataset name of the working dataset. If this field


contains a Null, the dataset for the reconciliation job is
replaced with workingDataset before reconciliation.
The dataset for the reconciliation job. If the
workingDataset field in the structure contains a Null,
the dataset specified in this field is used.

CMDBREJobRunInfo structure
The CMDBREJobRunInfo data structure holds information about a currently
running Reconciliation Engine job.
typedef struct CMDBREJobRunInfo
{
ARNameType
jobRunId;
ARNameType
jobInstanceId;
ARNameType
jobName;
ARTimestamp
startTime;
ARTimestamp
endTime;
unsigned int
jobState;
} CMDBREJobRunInfo;

The CMDBREJobRunInfo structure consists of the following elements:


jobRunId
jobInstanceId
jobName
startTime
endTime
jobStatus

The Reconciliation Engine job run ID.


The instance ID of the Reconciliation Engine job.
The name of the Reconciliation Engine job.
The start time of the job.
The end time of the job.
The current status of the Reconciliation Engine job.

Chapter 5 C API data structures

205

BMC Atrium Core 7.6.03

CMDBREJobRunInfoList structure
The CMDBREJobRunInfoList data structure holds a list of Reconciliation Engine
jobs that are currently running.
typedef struct CMDBREJobRunInfoList
{
unsigned int
numItems;
CMDBREJobRunInfo
*jobRunList;
} CMDBREJobRunInfoList;

The CMDBREJobRunInfoList structure consists of the following elements:


numItems
jobRunList

An integer value indicating the number of


CMDBREJobRunInfo items in the list.
The list of Reconciliation Engine jobs that are currently
in progress.

CMDBSortList structure
The CMDBSortList structure holds a list of attributes to sort.
typedef struct CMDBSortList
{
unsigned int
numItems;
CMDBSortStruct
*sortList;
} CMDBSortList;

The CMDBSortList structure consists of the following elements:


numItems

An integer value indicating the number of


CMDBSortStruct items in the list.

sortList

206

Developers Reference Guide

A list of CMDBSortStruct items.

CMDBSortStruct structure

CMDBSortStruct structure
The CMDBSortStruct structure holds the attribute to sort.
typedef struct CMDBSortStruct
{
ARNameType
attributeName;
unsigned int
sortOrder;
} CMDBSortStruct;

The CMDBSortStruct structure consists of the following elements:


attributeName
sortOrder

The name of the attribute to sort.


An integer value indicating sort order.
1Sort attributes in ascending order
(CMDB_SORT_ASCENDING).
2Sort attributes in descending order
(CMDB_SORT_DESCENDING).

CMDBUIComponentInfo structure
The CMDBUIComponentInfo data structure holds the UI components to retrieve.
typedef struct CMDBUIComponentInfo
{
ARNameType
classId;
ARLocaleType
locale;
unsigned int
componentType;
ARNameType
componentId;
char
*tag1;
char
*tag2;
char
*tag3;
char
*tag4;
char
*tag5;
char
*tag6;
char
*tag7;
char
*encodedQual;
} CMDBUIComponentInfo;

The CMDBUIComponentInfo structure consists of the following elements:


classId
locale

An integer value indicating the class ID for the UI


component.
The name of the locale specific to the component. If no
locale is specified in this subclasses, the default locale is
used.

Chapter 5 C API data structures

207

BMC Atrium Core 7.6.03

componentType

The integer value indicating the component type.


0The information to retrieve is a component type of
None. (CMDB_COMPONENT_TYPE_NONE).
1The icon type component to retrieve
(CMDB_COMPONENT_TYPE_ICON).
2The localized label type component to retrieve
(CMDB_COMPONENT_TYPE_LOCALIZEDSTRING).
3The tooltip type component to retrieve
(CMDB_COMPONENT_TYPE_TOOLTIP).
4The user interface graphical line information to
retrieve (CMDB_COMPONENT_TYPE_LINE).
100The server configuration information to retrieve
(CMDB_COMPONENT_TYPE_CMDB_SERVER_
CONFIGURATION).
101The saved query information to retrieve for the APIs
(CMDB_COMPONENT_TYPE_CMDB_SAVED_QUERY). This

option is for BMC use only.


102The CI scope saved query information to retrieve
for the APIs (CMDB_COMPONENT_TYPE_CMDB_CI_SCOPE_
SAVED_QUERY). This option is for internal use only. A CI
scope refers to the specific attributes that are displayed
when you query and drill down on a CI in the Atrium
Explorer.
900The Atrium Explorer view to retrieve
(CMDB_COMPONENT_TYPE_EXPLORER_VIEW). This option is
for internal use only.
901The saved query to retrieve for Atrium Explorer
(CMDB_COMPONENT_TYPE_SAVED_QUERY). This option is
for internal use only.
902The Atrium Explorer filter to retrieve
(CMDB_COMPONENT_TYPE_EXPLORER_FILTER). This option
is for internal use only.
903The user preference to retrieve for the Atrium
Explorer (CMDB_COMPONENT_TYPE_ATRIUM_USER_PREF).

This option is for internal use only.


904The adapter used for configuring federated data to
retrieve (CMDB_COMPONENT_TYPE_FEDERATION_ADAPTER).
This option is for internal use only.
905The plug-in configuration used for federated data to
retrieve
(CMDB_COMPONENT_TYPE_FEDERATION_PLUGIN_CONFIG).
This option is for internal use only.

208

Developers Reference Guide

CMDBUIComponentInfo structure

906The quick edit attribute to retrieve


(CMDB_COMPONENT_TYPE_QUICK_EDIT_ATTRIBUTES).
This attribute is displayed when you right-click an
instance and select Quick Edit in the Display pane.
907The Atrium Explorer group threshold value to
retrieve (CMDB_COMPONENT_TYPE_EXPLORER_GROUP_
THRESHOLD). The group threshold value controls the total
number of like CIs displayed in the Atrium Explorer at a
given time (for example, disk drives or computer
systems).
908The class label to retrieve
(CMDB_COMPONENT_TYPE_CLASS_LABEL_ATTRIBUTE).
This attribute is displayed in the Atrium Explorer as the
label for the class icon.

componentID

909The class display name to retrieve


(CMDB_COMPONENT_TYPE_CLASS_DISPLAY_NAME). This is
the display name for the class that is used in the Atrium
Explorer.
An integer value indicating the ID of the component. The
composite values of componentType and componentId
for a component form a unique value, based on which a
unique index is created.

The CMDB_COMPONENT_TYPE_CMDB_SAVED_QUERY and


CMDB_COMPONENT_TYPE_CMDB_CI_SCOPE component
types use this tag to stores the name of the saved query.
For all other component types, the CMDB engine autopopulates the instance ID by default.

Chapter 5 C API data structures

209

BMC Atrium Core 7.6.03

tag1

An information tag allows you to provide descriptions for


the components. You might use more than one tag at a
time to provide descriptions for a specific component
type. These tags are used to filter a specific component
type.
Each of the component types use this tag in the following
ways:
CMDB_COMPONENT_TYPE_ICONUsed to specify the

owner of the icon.


CMDB_COMPONENT_TYPE_LOCALIZED_LABELUsed to

specify the owner of the localized label.


CMDB_COMPONENT_TYPE_TOOLTIPUsed to specify the

owner of the tool tip.


CMDB_COMPONENT_TYPE_LINEUsed to specify the

owner of the UI line.


CMDB_COMPONENT_TYPE_CMDB_SAVED_QUERYUsed to

specify the category name for the saved query.


CMDB_COMPONENT_TYPE_CMDB_CI_SCOPE_
SAVED_QUERYUsed to specify the category name of the

tag2

CI scope for the saved query.


Each of the component types use this tag in the following
ways:
CMDB_COMPONENT_TYPE_ICONUsed to specify the size of

the icon.
CMDB_COMPONENT_TYPE_LOCALIZED_LABELUsed to
specify the attribute name of the localized string. This tag
is left blank if it is a label for a class.
CMDB_COMPONENT_TYPE_CMDB_SAVED_QUERYUsed to

specify the description for the saved query.


CMDB_COMPONENT_TYPE_CMDB_CI_SCOPE_
SAVED_QUERYUsed to specify the description of the CI

scope for the saved query.

210

Developers Reference Guide

CMDBUIComponentResult structure

tag3

Each of the component types use this tag in the following


ways:
CMDB_COMPONENT_TYPE_ICONUsed to specify the image

type of the icon for the component type (for example, JPG,
BMP, or GIF).
CMDB_COMPONENT_TYPE_CMDB_SAVED_QUERYUsed to

specify the characteristics for the saved query.


CMDB_COMPONENT_TYPE_CMDB_CI_SCOPE_
SAVED_QUERYUsed to specify the characteristics of the

CI scope for the saved query.


CMDB_COMPONENT_TYPE_CMDB_SAVED_QUERYUsed to

tag4
tag5
tag6

specify the version number of the saved query XML file.


Used to specify the weight of the icon for the
CMDB_COMPONENT_TYPE_ICON component type.
Used to describe a specific component type.
Used to store the version number of the saved query XML
file for the CMDB_COMPONENT_TYPE_CMDB_SAVED_QUERY
and
CMDB_COMPONENT_TYPE_CMDB_CI_SCOPE_SAVED_QUERY

tag7
encodedQual

component types. The query definitions for the saved


query and CI scope saved query components are stored in
an XML file for data manipulation.
Reserved for future use.
The encoded qualifier for the UI component query.

CMDBUIComponentResult structure
The CMDBUIComponentResult data structure holds the component query result.
typedef struct CMDBUIComponentResult
{
ARNameType
instanceId;
CMDBUIComponentIno
componentInfo;
char
*dataString;
ARAttachStruct
*attachVal;
} CMDBUIComponentResult;

The CMDBUIComponentResult structure consists of the following elements:


instanceId
componentInfo
dataString
attachVal

An integer value indicating the class ID of the UI


component class.
Contains the component information for the specific
instance.
Contains the component data string.
Contains the attachment for the component.

Chapter 5 C API data structures

211

BMC Atrium Core 7.6.03

CMDBUIComponentResultList structure
The CMDBUIComponentResultList data structure holds the component query
result.
typedef struct CMDBUIComponentResultList
{
unsigned int
numItems;
CMDBUIComponentResult *componentResList;
} CMDBUIComponentResultList;

The CMDBUIComponentResultList structure consists of the following elements:


numItems

An integer value indicating the number of


CMDBUIComponent items in the list.

componentResultList

Contains a list of UI components.

CMDBVersionInfo structure
The CMDBVersionInfo structure holds version information for the BMC Atrium
Core components.
typedef struct CMDBVersionInfo
{
ARNameType
applicationId;
ARNameType
applicationName;
unsigned int
majorVer;
unsigned int
minorVer;
unsigned int
maintenanceVer;
unsigned int
patchNum;
} CMDBVersionInfo;

The CMDBVersionInfo structure consists of the following elements:


applicationId
applicationName
majorVer
minorVer
maintenanceVer
patchNum

212

Developers Reference Guide

An ID for the application.


The name for the application.
The major part (preceding the dot) of the version
number information.
The minor part (succeeding the dot) of the version
number information.
The maintenance version number.
The patch number.

CMDBVersionInfoList structure

CMDBVersionInfoList structure
The CMDBVersionInfoList structure holds a list of version information elements
for the CMDB component.
typedef struct CMDBVersionInfoList
{
unsigned int
numItems;
CMDBVersionInfo *versionInfoList;
} CMDBVersionInfoList;

The CMDBVersionInfoList structure consists of the following elements:


numItems
versionInfoList

The number of items in the list.


A list of version information.

CMDBWeakPropagatedAttrs structure
The CMDBWeakPropagatedAttrs structure holds a list of source and target
attributes to use for attribute value propagation when isRole2WeakReference is
TRUE.
The specified source and target attributes must already exist on the role one and
role two classes. This list describes the mapping of the attribute values from the
role one class to be propagated to the role two class.
typedef struct CMDBWeakPropagatedAttrs
{
ARNameType
sourceAttributeName;
ARNameType
targetAttributeName;
} CMDBWeakPropagatedAttrs;

The CMDBWeakPropagatedAttrs structure consists of the following elements:


sourceAttributeName
targetAttributeName

The name of the attribute on the role one class.


The name of the attribute on the role two class.

Chapter 5 C API data structures

213

BMC Atrium Core 7.6.03

CMDBWeakPropagatedAttrsList structure
The CMDBWeakPropagatedAttrsList structure holds a list of
CMDBWeakPropagatedAttrs structures.
typedef struct CMDBWeakPropagatedAttrsList
{
unsigned int
numItems;
CMDBWeakPropagatedAttrs
*attrsList;
} CMDBWeakPropagatedAttrsList;

The CMDBWeakPropagatedAttrsList structure consists of the following


elements:
numItems
attrsList

An integer value indicating the number of


CMDBWeakPropagatedAttrs items in the list.
The list of attributes to propagate from the role one
class to the role two class.

CMDBXMLExportItemList structure
The CMDBXMLExportItemList data structure holds a list of items to export.
typedef struct CMDBXMLExportItemList
unsigned int
CMDBXMLExportItemStruct
}CMDBXMLExportItemList;

numItems;
*exportItemList;

The CMDBXMLExportItemList structure consists of the following elements:


numItems
exportItemList

214

Developers Reference Guide

An integer value indicating the number of


CMDBXMLExportItem items in the list.
A structure that holds the list of items to export.

CMDBXMLImportItemList structure

CMDBXMLImportItemList structure
The CMDBXMLImportItemList data structure holds a list of XML items to import.
typedef struct CMDBXMLImportItemList
unsigned int
numItems;
CMDBXMLImportItemStruct *importItemList;
}CMDBXMLImportItemList;

The CMDBXMLImportItemList structure consists of the following elements:


numItems

An integer value indicating the number of


CMDBXMLImportItem items in the list.

exportItemList

A structure that holds the list of XML items to import.

Chapter 5 C API data structures

215

BMC Atrium Core 7.6.03

216

Developers Reference Guide

Appendix

cmdbdriver commands

This section describes the cmdbdriver commands for cmdbdriver scripting


constructs and specific C API functions.
The following topics are provided:

 cmdbdriver commands for C API functions (page 218)


 Commands for controlling cmdbdriver (page 223)

Appendix A cmdbdriver commands

217

BMC Atrium Core 7.6.03

cmdbdriver commands for C API functions


This section describes the cmdbdriver commands for specific C API functions.

Class commands for cmdbdriver


Table A-1 lists the cmdbdriver commands for BMC Atrium CMDB data model
classes.
Table A-1: cmdbdriver commands for class C API functions
Command Full name

Description

gc

get class

Retrieves the class information from the OBJSTR:Class form.


This command corresponds with the CMDBGetClass C API
function.

sc

set class

Sets the class properties in the OBJSTR:Class form. This


command corresponds with the CMDBSetClass C API
function.

cc

create class

Creates a class with the core attributes in the OBJSTR:Class.


This command corresponds with the CMDBCreateClass C API
function.

dc

delete class

Deletes a specified class. This command corresponds with the


CMDBDelete Class C API function.

glc

get list class

Retrieves a list of classes. This command corresponds with


the CMDBGetListClass C API function.

Attribute commands for cmdbdriver


Table A-2 lists the cmdbdriver commands for BMC Atrium CMDB data model
attributes.
Table A-2: cmdbdriver commands for attribute C API functions (Sheet 1 of 2)

218

Command Full name

Description

ga

get attribute

Retrieves a single attribute. This command corresponds with


the CMDBGetAttribute C API function.

sa

set attribute

Sets the properties of an attribute. This command corresponds


with the CMDBSetAttribute C API function.

ca

create
attribute

Creates a new attribute of a class with the specified properties.


This command corresponds with the CMDBCreateAttribute C
API function.

gma

get multiple
attributes

Retrieves multiple attributes. This command corresponds


with the CMDBGetMultipleAttributes C API function.

cma

create
multiple
attributes

Creates multiple new attributes of a class with the specified


properties. This command corresponds with the
CMDBCreateMultipleAttributes C API function.

Developers Reference Guide

cmdbdriver commands for C API functions

Table A-2: cmdbdriver commands for attribute C API functions (Sheet 2 of 2)


Command Full name

Description

sma

set multiple
attributes

Sets multiple attributes with the specified properties. This


command corresponds with the CMDBSetMultipleAttributes
C API function.

da

delete
attribute

Deletes the attribute with the specified ID. This command


corresponds with the CMDBDeleteAttribute C API function.

Instance commands for cmdbdriver


Table A-3 lists the cmdbdriver commands for instances in your BMC Atrium
CMDB.
Table A-3: cmdbdriver commands for instance C API functions
Command Full name

Description

gi

get instance

Retrieves information about the instance. This command


corresponds with the CMDBGetInstance C API function.

si

set instance

Sets attribute values for the specified CI or relationship class.


This command corresponds with the CMDBSetInstance C API
function.

ci

create
instance

Creates a CI or relationship instance of the specified class. This


command corresponds with the CMDBCreateInstance C API
function.

di

delete
instance

Deletes the instance of the class. This command corresponds


with the CMDBDeleteInstance C API function.

gli

get list
instance

Retrieves a list of instances. This command corresponds with


the CMDBGetListInstance C API function.

gmi

get multiple
instances

Retrieves multiple instances. This command corresponds with


the CMDBGetMultipleInstances C API function.

cmi

create
multiple
instances

Creates multiple CI or relationship instances in the specified


dataset. This command corresponds with the
CMDBCreateMultipleInstances C API function.

gib

get instance
blob

Retrieves the attachment, or binary large object (BLOB), stored


for the attachment subclasses. This command corresponds
with the CMDBGetInstanceBLOB C API function.

gui

get user
interface
object

Retrieves a list of various UI components for a specified class.


This command corresponds with the
CMDBGetCMDBUIComponents C API function.

Appendix A cmdbdriver commands

219

BMC Atrium Core 7.6.03

RE job run commands for cmdbdriver


Table A-4 lists the cmdbdriver commands for Reconciliation Engine job runs.
Table A-4: cmdbdriver commands for job run C API functions
Command Full name

Description

sjr

start job run

Starts an existing Reconciliation Engine job. This command


corresponds with the CMDBStartJobRun C API function.

cjr

cancel job
run

Cancels a currently running Reconciliation Engine job. This


command corresponds with the CMDBCancelJobRun C API
function.

gjr

get job run

Gets information about the currently running reconciliation


job and retrieves a job log. This command corresponds with
the CMDBGetJobRun C API function.

gljr

get list job


run

Get a list of running Reconciliation Engine jobs. This


command corresponds with the CMDBGetListJobRun C API
function.

Federation commands for cmdbdriver


Table A-5 lists the cmdbdriver commands for federation.
Table A-5: cmdbdriver commands for federation C API functions
Command Full name

Description

gf

get

Returns related FederatedInterface instances for a specific CI.


This command corresponds with the
CMDBGetRelatedFederatedInContext C API function.

af

activate

Expands the FederatedInterface instance for a specific CI and


federated interface. This command corresponds with the
CMDBActivateFederatedInContext C API function.

Import and export commands for cmdbdriver


Table A-5 lists the cmdbdriver commands for importing and exporting classes
and data.
Table A-6: cmdbdriver commands for import and export C API functions (Sheet 1 of 2)

220

Command Full name

Description

expdf

export def

Exports a list of specified class definitions. This command


corresponds with the CMDBExportDef C API function.

impdf

import def

Imports a list of specified class definitions. This command


corresponds with the CMDBImportDef C API function

expdt

export data

Exports the specified class data for a specific qualification. This


command corresponds with the CMDBExportData C API
function

impdt

import data

Imports the specified instance data. This command


corresponds with the CMDBImportData C API function

Developers Reference Guide

cmdbdriver commands for C API functions

Table A-6: cmdbdriver commands for import and export C API functions (Sheet 2 of 2)
Command Full name

Description

xexpdf

Xexport def

Exports a list of specified class definitions in XML format. This


command corresponds with the CMDBExportDef C API
function.

xexpdt

Xexport data Exports the specified class data for a specific qualification in
XML format. This command corresponds with the
CMDBExportData C API function.

Query By Path commands for cmdbdriver


Table A-7 lists the cmdbdriver commands for Query By Path operations. All of
these commands correspond with the CMDBQueryByPath C API function.
Table A-7: cmdbdriver commands for C API functions
Command Full name

Description

qbp

query by
path

Retrieves a list of instances for the specified qualifications.


This function takes a query object as a parameter. Before
executing the qbp command, use the cqq command to create
the query qualification and then use the cqobj comment to
create the query object.

cqobj

create query Creates the query object for the Query By Path command.
object

cqq

create query Creates the query qualifications for the create query object
qual
command.

Graph Walk Query command for cmdbdriver


The gwq command enables you to retrieve a list of instances for the specified
qualifications. Use this function to retrieve instances when you do not know the
exact relationship path to follow. This command corresponds with the
CMDBGraphWalkBegin, CMDBGraphWalkNext, and CMDBGraphWalkEnd C
API classes.

Miscellaneous cmdbdriver commands


Table A-8 lists the cmdbdriver commands for miscellaneous BMC Atrium Core
operations.
Table A-8: cmdbdriver commands for miscellaneous C API functions (Sheet 1 of 2)
Command Full name

Description

sync

synch

Creates AR System forms from the data model definitions that


hold instance data, and workflow, which enforces class
hierarchy and data integrity. This command corresponds with
the CMDBSynchMetaData C API function.

ssp

set port

Sets the specified server port. This command corresponds with


the CMDBSetServerPort C API function.

Appendix A cmdbdriver commands

221

BMC Atrium Core 7.6.03

Table A-8: cmdbdriver commands for miscellaneous C API functions (Sheet 2 of 2)


Command Full name

Description

dver

dr ver

Returns the cmdbdriver version installed on your system.

bbet

bgntran

Indicates that subsequent API functions are part of the bulk


transaction. This command corresponds with the
CMDBBeginBulkEntryTransaction C API function.

ebet

endran

This function commits or rolls back the bulk transaction,


depending on the action type. This command corresponds
with the CMDBEndBulkEntryTransaction C API function.

gver

gver

Retrieves the version information for any BMC Atrium Core


component that is installed.

gac

sudit copy

Retrieves a copy of the specified CI instance if the attribute


data for the instance is modified.

exp

export

Exports the specified class definitions from the specified


server. This command corresponds with the CMDBExportDef
C API function.

imp

import

Imports the specified class definitions to the specified server.


This function has been deprecated since BMC Atrium CMDB
version 2.1.00. For more information about the CMDBImport
function, see the BMC Atrium CMDB 2.1.00 Developers
Reference Guide.

222

grq

graph query Searches related instances. This command corresponds with


the CMDBGraphQuery C API function.

cg

create GUID Creates a globally unique identifier. This command


corresponds with the CMDBCreateGuid C API function.

upgr

upgrade

For internal use only.

expp

expand
param

Accepts an unexpanded string that contains parameters and


substitutes values from the attribute value list provided in the
CMDBAttributeValueList structure. This command
corresponds with the CMDBExpandParametersForCI C API
function.

rq

run qual

Performs validation on a list of attributes for a specified CI.


This command corresponds with the
CMDBRunQualificationForCI C API function.

gwq

graph walk
query

Retrieves a list of instances for the specified qualifications. Use


this function to retrieve instances when you do not know the
exact relationship path to follow. This command corresponds
with the CMDBGraphWalkBegin, CMDBGraphWalkNext,
and CMDBGraphWalkEnd C API functions.

Developers Reference Guide

Commands for controlling cmdbdriver

Commands for controlling cmdbdriver


This section describes the commands for controlling cmdbdriver.

Initialization and termination commands for cmdbdriver


Table A-9 lists the commands for initializing and terminating the cmdbdriver
program.
Table A-9: cmdbdriver initialization and termination commands
Command

Command full
name

What it does

init

init

Initializes a session of the cmdbriver program. To


successfully use the cmdbdriver program, first
log in to and then initialize a session.

term

term

Terminates a session of the cmdbdriver program.

h, ?

help

Displays the list of cmdbdriver commands.

e, q

exit

Exits the cmdbdriver program.

log

login

Allows you to log in to a session of the


cmdbdriver program. To successfully use the
cmdbdriver program, first log in to and then
initialize a session.

Recording and logging commands for cmdbdriver


Table A-10 lists the commands for controlling cmdbdriver recording and logging.
Table A-10: cmdbdriver recording and logging commands (Sheet 1 of 2)
Command

Command full
name

What it does

rec

record

Starts recording the commands issued during a


cmdbdriver session. The rec command helps
create cmdbdriver scripts, which can be used for
installing extensions to the data model. This
command records only the input commands that
you issue during a session.

srec

stop rec

Stops recording a cmdbdriver session.

oout

open out

Starts recording output of the commands that you


issue during a cmdbdriver session.

cout

close out

Closes the file created for recording the output of


commands that you issue during a cmdbdriver
session.

ex

execute

Executes a specific cmdbdriver script file.

Appendix A cmdbdriver commands

223

BMC Atrium Core 7.6.03

Table A-10: cmdbdriver recording and logging commands (Sheet 2 of 2)


Command

Command full
name

What it does

bl

bgn loop

Begins a looping construct in a cmdbdriver script


file. You must specify the number of iterations as a
condition for the loop. This command is used only
in script files.

el

end loop

Ends a looping construct in a cmdbdriver script


file.

Thread and timer commands for cmdbdriver


Table A-11 lists the commands for controlling cmdbdriver threads and timers.
Table A-11: cmdbdriver thread and timer commands
Command

Command full
name

What it does

lt

launch

Creates a timer thread for a command. You can


delay the processing of commands using the rst
command. The sleep time can be any number
between zero and the specified number of seconds.

lwt

launch wait

Launches a thread that waits for an event to occur.


You can release the wait for the thread with the rwt
command.

rwt

release wait

Releases all the threads that are launched by the


launch wait (lwt) command.

st

sleep

Issues a sleep timer on a thread for the specified


number of seconds.

rst

random sleep

Issues a sleep timer on a thread that occurs for a


random number of seconds within the specified
range.

msst

msec sleep

Issues a sleep timer on a thread for the specified


number of milliseconds.

Session configuration commands for cmdbdriver


Table A-12 lists the commands for cmdbdriver session information.
Table A-12: cmdbdriver session configuration commands

224

Command

Command full
name

What it does

gsc

get conf

Retrieves session configuration information.

ssc

set conf

Sets session configuration information.

Developers Reference Guide

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Index
A

activating federated instances 71, 161


adjacency lists 54
adjacency matrixes 54
adjacent nodes 164, 165
Apache Axis2 36
API compatibility 26
architecture overview 18
architecture, BMC Atrium CMDB API 18
attachLimits structure 151
attachment limits 151
attributes
C API data structures 144
class 179
creating multiple 74, 82
data structures 144
definitions 144
deleting 86, 87
expanding CI parameters 91
index information 178
managing 68
name 179
propagation sources 213
propagation targets 213
retrieval information 146
retrieving 94, 107
setting 126, 133
sort information 206, 207
validating CI 125
values 152
audits
class options 153
retrieving CI data 100
retrieving modified CI instances 100
value lists 154, 155
Axis2 36

BLOBs (binary large objects), retrieving instance 103


BMC Atrium Configuration Management Database
(BMC Atrium CMDB) 43, 44
BMC Atrium Configuration Management Database
(BMC Atrium CMDB) APIs
architecture 18
C 19
Java 20
overview 18
programming 22
programs, when to write 22
sample source code 43
terminology changes 23
web services 20
BMC Atrium Core Console versus API
programming 22
BMC Atrium Core Web Services API 36
BMC Atrium Core Web Services Infrastructure 36
BMC Atrium Core Web Services Registry 36
BMC Remedy Action Request System (BMC Remedy
AR System)
creating forms 138
federated data 162
BMC Software, contacting 2
bulk entries
beginning transactions 72
committing transactions 90
ending transactions 90
invoking API calls 67
rolling back transactions 90
starting 72
transaction functions 67

C
C API
See also C API data structures overview
compilers 34
compiling on HP machines 34

Index

225

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
C API (continued)
components 19
driver source code 29
header files 29
installation package 29
library files 30
library links 34
overview 19
C API attribute data structures
attachLimits 151
charLimits 149
CMDBAttributeGetStruct 146
CMDBAttributeLimit 147
CMDBAttributeLimitList 151
CMDBAttributeNameId 151
CMDBAttributeValueList 152
CMDBAttributeValueListList 152
CMDBAttributeValueStruct 152
CMDBSortList 206
CMDBSortStruct 207
CMDBWeakPropagatedAttrs 213
CMDBWeakPropagatedAttrsList 214
currencyLimits 150
dateLimits 150
decimalLimits 150
enumLimits 150
integerLimits 149
overview 144
realLimits 149
C API bulk entry transaction functions
CMDBBeginBulkEntryTransaction 72
CMDBEndBulkEntryTransaction 90
overview 67
C API class data structures
CMDBClassRelationship 156
CMDBClassTypeInfo 157
CMDBIndexList 177
CMDBIndexStruct 178
overview 144
C API copy functions 67
CopyCMDBInstanceStruct 67
CopyCMDBQueryStruct 67
C API data model functions
CMDBCreateAttribute 74
CMDBCreateClass 77
CMDBCreateMultipleAttributes 82
CMDBDeleteAttribute 86
CMDBDeleteClass 87
CMDBGetAttribute 94
CMDBGetClass 97
CMDBGetListClass 104
CMDBGetMultipleAttributes 107

226

Developers Reference Guide

C API data model functions (continued)


CMDBSetAttribute 126
CMDBSetClass 128
CMDBSetMultipleAttributes 133
CMDBSynchMetaData 138
overview 68
C API data structures overview 19, 141
C API environment functions
CMDBGetServerPort 115
CMDBInitialization 123
CMDBSetServerPort 136
CMDBSystemInit 139
CMDBTermination 139
overview 68
C API export and import functions
CMDBExportData 92
CMDBExportDef 93
CMDBImportData 121
CMDBImportDef 122
overview 68
C API federation data structures
CMDBFederatedActivateInfo 161
CMDBFederatedARInfo 162
overview 144
C API federation functions
CMDBActivateFederatedInContext 71
CMDBExpandParametersForCI 91
CMDBGetRelatedFederatedInContext 114
CMDBRunQualificationForCI 125
overview 68
C API free functions 69
C API functions overview 19, 65
C API general purpose data structures
CMDBVersionInfo 212
CMDBVersionInfoList 213
overview 144
C API import and export data structures
CMDBExportItem 158
CMDBExportItemList 159
CMDBExportItemStruct 159
CMDBImportItem 175
CMDBImportItemList 175
CMDBImportItemStruct 176
CMDBItemTypeAttribute 179
CMDBItemTypeClass 179
CMDBXMLExportItemList 214
CMDBXMLImportItemList 215
overview 144
C API instance data structures
CMDBAuditInfoStruct 153
CMDBAuditValueList 154
CMDBAuditValueListList 155

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
C API instance data structures (continued)
CMDBClassNameId 155
CMDBClassNameIdList 155
CMDBInstanceList 178
CMDBInstanceStruct 179
CMDBQualifierStruct 181
overview 144
C API instance functions
CMDBCreateInstance 81
CMDBCreateMultipleInstances 85
CMDBDeleteInstance 88
CMDBDeleteMultipleInstances 89
CMDBGetCopyAuditData 100
CMDBGetInstance 102
CMDBGetInstanceBLOB 103
CMDBGetListInstance 105
CMDBGetMultipleInstances 110
CMDBSetInstance 131
CMDBSetMultipleInstances 135
overview 70
C API query data structures
CMDBGetObjectList 163
CMDBGetObjectStruct 163
CMDBGetRelationList 163
CMDBGetRelationStruct 164
CMDBGraphAdjacentList 164
CMDBGraphAdjacentStruct 165
CMDBGraphList 165
CMDBGraphStruct 166
CMDBGraphWalkObjectList 166
CMDBGraphWalkObjectStruct 167
CMDBGraphWalkQueryStruct 167
CMDBGraphWalkRelation 169
CMDBGraphWalkRelationList 170
CMDBGraphWalkResultStruct 171
CMDBGraphWalkSelectorAndFilterList 172
CMDBGraphWalkSelectorAndFilterStruct 173
CMDBGraphWalkStateStruct 174
CMDBNestedQueryStruct 180
CMDBQueryArithOpStruct 181
CMDBQueryAttributeName 182
CMDBQueryObject 184
CMDBQueryObjectList 186
CMDBQueryObjectSelectorList 187
CMDBQueryObjectSelectorStruct 188
CMDBQueryQualifierAndOrStruct 188
CMDBQueryQualifierSetOpStruct 189
CMDBQueryQualifierSimpleOpStruct 190
CMDBQueryQualifierStruct 192
CMDBQueryQualifierValueSetStruct 193
CMDBQueryQualifierValueStruct 194

C API query data structures (continued)


CMDBQueryStruct 198
overview 145
C API query functions
by path 124
CMDBGraphQuery 53, 116
CMDBGraphWalkBegin 118
CMDBGraphWalkEnd 119
CMDBGraphWalkNext 120
CMDBQueryByPath 46
overview 50, 70
C API Reconciliation Engine data structures
CMDBREClassQualList 203
CMDBREClassQualStruct 204
CMDBREDatasetList 204
CMDBREDatasetPair 205
CMDBREJobRunInfo 205
CMDBREJobRunInfoList 206
overview 146
C API Reconciliation Engine functions
CMDBCancelJobRun 73
CMDBGetJobRun 112
CMDBGetListJobRun 113
CMDBStartJobRun 137
overview 70
C API sessions
initializing 123
terminating 139
C API user interface component data structures
CMDBUIComponentInfo 207
CMDBUIComponentResult 211
CMDBUIComponentResultList 212
overview 146
C API user interface component functions
CMDBGetCMDBUIComponents 111
overview 70
C API utility functions
CMDBCreateGuid 80
CMDBGetVersions 115
overview 70
Calbro Services query examples 47, 51
calls
C API function 19
debugging with data structure contents 43
invoking bulk entry API 67
character limits 149
charLimits structure 149
chunks, next in graph walk 120
CI instances
See instances
classes
accessing BMC Atrium CMDB directly 44

Index

227

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
classes (continued)
attribute index information 178
audit options 153
C API data structures 144
class names 151
configuration item (CI) definitions 144
creating with cmdbdriver 37
creating with core attributes 77
data 144
data structures 144
deleting 87
exporting definitions 93
exporting qualified 92
importing data 121
importing definitions 122
index information 177
managing 68
names 151, 155, 179
namespace names 151, 155
relationship definitions 144
relationship information 156
retrieving 97, 104
retrieving list of UI components 111
setting properties 128
type information 157
CMDBActivateFederatedInContext function 71
CMDBAttributeGetStruct structure 146
CMDBAttributeLimit structure 147
CMDBAttributeLimitList structure 151
CMDBAttributeNameId structure 151
CMDBAttributeValueList structure 152
CMDBAttributeValueListList structure 152
CMDBAttributeValueStruct structure 152
CMDBAuditInfoStruct structure 153
CMDBAuditValueList structure 154
CMDBAuditValueListList structure 155
CMDBBeginBulkEntryTransaction function 72
CMDBCancelJobRun function 73
CMDBClassNameId structure 155
CMDBClassNameIdList structure 155
CMDBClassRelationship structure 156
CMDBClassTypeInfo structure 157
CMDBCreateAttribute function 74
CMDBCreateClass function 77
CMDBCreateGuid function 80
CMDBCreateInstance function 81
CMDBCreateMultipleAttribute function 82
CMDBCreateMultipleAttributes function 82
CMDBCreateMultipleInstances function 85
CMDBDeleteAttribute function 86
CMDBDeleteClass function 87
CMDBDeleteInstance function 88

228

Developers Reference Guide

CMDBDeleteMultipleInstances function 89
cmdbdriver program
commands for API functions 218
commands for controlling 223
overview 37
using from command line 39
cmdbdriver.sh file 39
CMDBEndBulkEntryTransaction function 90
CMDBExpandParametersForCI function 91
CMDBExportData function 92
CMDBExportDef function 93
CMDBExportItem structure 158
CMDBExportItemList structure 159
CMDBExportItemStruct structure 159
CMDBFederatedActivateInfo structure 161
CMDBFederatedARInfo structure 162
CMDBGetAttribute function 94
CMDBGetClass function 97
CMDBGetCMDBUIComponents function 111
CMDBGetCopyAuditData function 100
CMDBGetInstance function 102
CMDBGetInstanceBLOB function 103
CMDBGetJobRun function 112
CMDBGetListClass function 104
CMDBGetListInstance function 105
CMDBGetListJobRun function 113
CMDBGetMultipleAttribute function 107
CMDBGetMultipleInstances function 110
CMDBGetObjectList structure 163
CMDBGetObjectStruct structure 163
CMDBGetRelatedFederatedInContext function 114
CMDBGetRelationList structure 163
CMDBGetRelationStruct structure 164
CMDBGetServerPort function 115
CMDBGetVersions function 115
CMDBGraphAdjacentList structure 164
CMDBGraphAdjacentStruct structure 165
CMDBGraphList structure 165
CMDBGraphQuery function 53, 116
CMDBGraphStruct structure 166
CMDBGraphWalkBegin function 118
CMDBGraphWalkEnd function 119
CMDBGraphWalkNext function 120
CMDBGraphWalkObjectList structure 166
CMDBGraphWalkObjectStruct structure 167
CMDBGraphWalkQueryStruct structure 167
CMDBGraphWalkRelation data structure 169
CMDBGraphWalkRelation structure 169
CMDBGraphWalkRelationList structure 170
CMDBGraphWalkResultStruct structure 171
CMDBGraphWalkSelectorAndFilterList
structure 172

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
CMDBGraphWalkSelectorAndFilterStruct
structure 173
CMDBGraphWalkStateStruct structure 174
CMDBImportData function 121
CMDBImportDef function 122
CMDBImportItem structure 175
CMDBImportItemList structure 175
CMDBImportItemStruct structure 176
CMDBIndexList structure 177
CMDBIndexStruct structure 178
CMDBInitialization function 123
CMDBInstanceList structure 178
CMDBInstanceStruct structure 179
CMDBItemTypeAttribute structure 179
CMDBItemTypeClass structure 179
CMDBNestedQueryStruct structure 180
CMDBQualifierStruct structure 181
CMDBQueryArithOpStruct structure 181
CMDBQueryAttributeName structure 182
CMDBQueryByPath function 46, 124
CMDBQueryObject structure 184
CMDBQueryObjectList structure 186
CMDBQueryObjectSelectorList structure 187
CMDBQueryObjectSelectorStruct structure 188
CMDBQueryQualifierAndOrStruct structure 188
CMDBQueryQualifierSetOpStruct structure 189
CMDBQueryQualifierSimpleOpStruct structure 190
CMDBQueryQualifierStruct structure 192
CMDBQueryQualifierValueSetStruct structure 193
CMDBQueryQualifierValueStruct structure 194
CMDBQueryStruct structure 198
CMDBREClassQualList structure 203
CMDBREClassQualStruct structure 204
CMDBREDatasetList structure 204
CMDBREDatasetPair structure 205
CMDBREJobRunInfo structure 205
CMDBREJobRunInfoList structure 206
CMDBRunQualificationForCI function 125
CMDBSetAttribute function 126
CMDBSetClass function 128
CMDBSetInstance function 131
CMDBSetMultipleAttribute function 133
CMDBSetMultipleInstances function 135
CMDBSetServerPort function 136
CMDBSortList structure 206
CMDBSortStruct structure 207
CMDBStartJobRun functions 137
CMDBSynchMetaData function 138
CMDBSystemInit function 139
CMDBTermination function 139
CMDBUIComponentInfo structure 207
CMDBUIComponentResult structure 211

CMDBUIComponentResultList structure 212


CMDBVersionInfo structure 212
CMDBVersionInfoList structure 213
CMDBWeakPropagatedAttrs structure 213
CMDBWeakPropagatedAttrsList structure 214
CMDBXMLExportItemList structure 214
CMDBXMLImportItemList structure 215
commands
cmdbdriver 39
cmdbdriver for API functions 218
controlling cmdbdriver 223
compilers, C API 34
components, C API 19
configuration items
See instances
copy functions 67
CopyCMDBGraphWalkQueryStruct function 67
CopyCMDBGraphWalkRelation function 67
CopyCMDBGraphWalkRelationList function 67
CopyCMDBGraphWalkResultStruct function 67
CopyCMDBGraphWalkSelectorAndFilterList
function 67
CopyCMDBGraphWalkSelectorAndFilterStruct
function 67
CopyCMDBInstanceList function 67
CopyCMDBInstanceStruct function 67
CopyCMDBNestedQueryStruct function 67
CopyCMDBQueryObject function 67
CopyCMDBQueryObjectList function 67
CopyCMDBQueryObjectSelectorList function 67
CopyCMDBQueryQualifierStruct function 67
CopyCMDBQueryQualifierValueStruct function 67
CopyCMDBQuerySortList function 67
CopyCMDBQuerySortStruct function 67
CopyCMDBQueryStruct function 67
creating
AR System forms 138
attributes, multiple 74, 82
classes 77
classes with cmdbdriver 37
forms 138
instances with cmdbdriver 37
instances, CI 81
instances, multiple CI 85
instances, multiple relationship 85
instances, relationship 81
unique IDs 80
currency limits 150
currencyLimits structure 150
customer support 3

Index

229

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

D
data limits 150
data model functions, C API 68
data structures, C API
attribute 144
class 144
export 144
federation 144
general purpose 144
import 144
instance 144
list of 144
overview 141
query 145
Reconciliation Engine 146
user interface component 146
data structures, printing 43
date limits 150
dateLimits structure 150
debugging APIs 43
debugging calls with data structure contents 43
decimal limits 150
decimalLimits structure 150
definitions
attribute 144
configuration item (CI) 144
exporting class 93
importing class 122
relationship 144
deleting
attributes 86
classes 87
instances 88
instances, multiple 89

E
enum limits 150
enumLimits structure 150
environment functions 68
examples
CMDBGraphQuery function 55
finding all CIs related to instances 51
finding all computers in divisions 47
finding relationships of CI instances 57, 60
expanding
CI parameters 91
federated instances 71
exporting
BMC Atrium CMDB data 68
C API data structures 144
230

Developers Reference Guide

exporting (continued)
C API functions 68
class data, qualified 92
class definitions 93
data 144
functions 68
items 158, 159

F
federated instances
activating 71, 161
retrieving 114
federation
AR system data 162
data structures 144
expanding instances 71
functions 68
instance activation data 161
launching instances 71
retrieving instances 114
filtering graph nodes 173
forms, creating 138
free functions 69
FreeCMDBAttributeGetStruct function 69
FreeCMDBAttributeLimit function 69
FreeCMDBAttributeLimitList function 69
FreeCMDBAttributeLimitStruct function 69
FreeCMDBAttributeValueList function 69
FreeCMDBAttributeValueListList function 69
FreeCMDBAuditInfoStruct function 69
FreeCMDBAuditValueList function 69
FreeCMDBAuditValueListList function 69
FreeCMDBClassNameIdList function 69
FreeCMDBClassTypeInfo function 69
FreeCMDBExportItemList function 69
FreeCMDBExportItemStruct function 69
FreeCMDBFederatedActivateInfo function 69
FreeCMDBGetObjectList function 69
FreeCMDBGetRelationList function 69
FreeCMDBGraphAdjacentList function 69
FreeCMDBGraphAdjacentStruct function 69
FreeCMDBGraphList function 69
FreeCMDBGraphStruct function 69
FreeCMDBGraphWalkObjectList function 69
FreeCMDBGraphWalkObjectStruc function 69
FreeCMDBGraphWalkObjectStruct function 69
FreeCMDBGraphWalkQueryStruct function 69
FreeCMDBGraphWalkRelation function 69
FreeCMDBGraphWalkRelationList function 69
FreeCMDBGraphWalkResultStruct function 69

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
FreeCMDBGraphWalkSelectorAndFilterList
function 69
FreeCMDBGraphWalkSelectorAndFilterStruct
function 69
FreeCMDBGraphWalkStateStruct function 69
FreeCMDBImportItemList function 69
FreeCMDBIndexList function 69
FreeCMDBInstanceList function 69
FreeCMDBNestedQueryStruct function 69
FreeCMDBQualifierStruct function 69
FreeCMDBQueryObject function 69
FreeCMDBQueryObjectList function 69
FreeCMDBQueryObjectSelectorList function 69
FreeCMDBQueryQualifierStruct function 69
FreeCMDBQueryQualifierValueStruct function 69
FreeCMDBQueryResultGraph function 69
FreeCMDBQuerySortList function 69
FreeCMDBQuerySortStruct function 69
FreeCMDBQueryStruct function 69
functions, C API
bulk entry transaction 67
copy 67
data model 68
environment 68
export and import 68
federation 68
free 69
instance 70
list of 67
query 70
Reconciliation Engine 70
user interface component 70
utility 70

G
general purpose data structures 144
graph nodes
filtering 173
structure 166
graph walk
beginning 118
ending 119
next chunk 120
object list 166
objects 167
query functions 50
query results 171
query structure 167
relationship to walk 169
starting 118
state 174

graphs
adjacency lists 54
adjacency matrixes 54
C API query data structures 145
lists 165

H
header files
BMC Atrium CMDB program 35, 36
C API 29
HP computers using C API, compiling 34

I
IDs, creating globally unique 80
importing
C API data structures 144
C API functions 68
class data 121
class definitions 122
CMDB data 68
data 144
functions 68
items 175, 176
initializing
C API sessions 123
networks 139
servers 139
installing C API package 29
instance BLOBs, retrieving 103
instances
attributes 179
C API management functions 70
C API structures 144
configuration item (CI) 163
creating configuration item (CI) 81
creating relationship 81
creating with cmdbdriver 37
data 144
definitions 144
deleting 88
expanding CI parameters 91
expanding federated 71
federated 71, 114, 161
finding related 45
launching federated 71
lists 178
management functions 70
relationship 163, 164
retrieving 102, 105, 110
retrieving BLOBs 103
Index

231

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
instances (continued)
retrieving CI audit data 100
retrieving federated 114
retrieving list of 105
retrieving multiple 110
retrieving single 102
searching for related 116
setting attributes for multiple 135
setting CI 131
setting relationship 131
structures 144
integer limits 149
integerLimits attribute structure 149
items to export 158, 159
items to import 175, 176

J
Java API
environment components 35
header files 35, 36
overview 20
program requirements 35
jobs
See reconciliation jobs

L
launching federated instances 71
library
files, C API 30
links, C API 34
limits
attachment 151
character 149
currency 150
date 150
decimal 150
enum 150
integer 149
real 149
linking libraries, C API 34

M
managing
attributes 68
classes 68
data models 68
instances 70
reconciliation jobs 70

232

Developers Reference Guide

matrixes, representing graphs as adjacency 54


memory, releasing 69
minimum API version 21

N
names
class 151, 155
namespace 151, 155
networks, initializing 139
next chunk, graph walk 120
nodes, adjacent 164

P
parameters, expanding CI 91
ports
retrieving 115
setting 136
print routines, BMC Atrium CMDB 43
print.c file 43
printing 43
product support 3
programming BMC Atrium CMDB APIs 22
programs
cmdbdriver 37
header files in Java API 35, 36
propagating attribute values 213

Q
qualifications
reconciliation jobs 203, 204
string 181
strings 181
queries
C API data structures 145
CI and relationship by path 124
example 57, 60
filtering graph walk for 172, 173
functions 70
graph list definitions 165
graph lists 165
graph nodes for 166
nested objects 180

R
real data limits 149
realLimits attribute structure 149

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Reconciliation Engine
C API data structures 146
C API functions 70
managing jobs 70
reconciliation jobs
canceling 73
datasets 204, 205
qualifications 203, 204
retrieving 112, 113
retrieving data for running 112
retrieving list of running 113
retrieving logs 112
running 205, 206
starting 137
relationships
See instances
requirements 21, 35

S
samples
BMC Atrium CMDB API source code 43
C API driver programs 29
source code 43
scripts, using 40
searching for instances 116
server ports
retrieving 115
setting 136
servers
initializing 139
retrieving ports 115
setting ports 136
sessions
initializing C API 123
terminating C API 139
source code
C API driver 29
sample BMC Atrium CMDB API 43
SQL views 44
support, customer 3

U
user interface components
data structures 146
functions 70
query results 211, 212
retrieving 207
retrieving lists 111
utilities
BMC Atrium CMDB 70
functions 70

V
validating attributes, CI 125
versions, retrieving BMC Atrium CMDB
component 115
views, SQL 44

W
web services API
Apache Axis2 36
BMC Atrium Core Web Services
Infrastructure 36
BMC Atrium Core Web Services Registry 36
documentation 36
overview 20

T
technical support 3
terminating C API sessions 139
terminology, Atrium Console versus API 23

Index

233

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

234

Developers Reference Guide

*160639*
*160639*
*160639*
*160639*
*160639*

Você também pode gostar