This documentation supports the 9.1 to 9.1 Service Pack 3 version and its patches of BMC Atrium Core. The documentation for version 9.1.04 and its patches is available here.

To view the latest version, select the version from the Product version menu.

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



Input argument

Description

control

The 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.

classNameId

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

datasetId

The unique identifier for the dataset. Instances are created in a dataset based on the value specified in this parameter.

attributeValueList

A 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.

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.

Return values



Return value

Description

instanceId

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

status

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

Was this page helpful? Yes No Submitting... Thank you

Comments