This documentation supports the 21.3 (12.3) version of BMC Discovery.

JSON format for model definitions


A Model Definition is described by a JSON object with the following keys:

Key

Required/optional

Description

name

required

Name of the model

key

required but generated if necessary

Unique key identifying the model

temp_key

optional

Temporary key that can be used for relationship references when creating multiple models. The key is only valid for the duration of the API request.

kind

required except for rules_template 

Node kind constructed by the model. One of:

  • BusinessService
  • TechnicalService
  • BusinessApplicationInstance
type

required

The type of model. One of the following. These types can be directly manipulated by the user in a UI:

  • rules_template – blueprint / template set of rules with parameters the user must provide
  • rules – instantiation of a blueprint / template, or stand-alone rules unique to this model
  • sam – start anywhere model – user defined contents, AI updates
  • static – user defined contents, no automatic updates

These cannot be directly manipulated by the user at a model definition level:

  • instance – instance of a multi-instance rules model (or multi-instance SAM in future)
  • imported – contents from an import source; updates by import
version

optional

Version of the model (not version of the created service), as a single integer

description

optional

Description of the model

notes

optional

User-entered notes

compatibility

optional

String indicating the client that created the model definition, allowing that client to get back models that are compatible with the subset of features it supports. If the model is edited in DSM (or elsewhere than the specified client), compatibility is cleared, meaning that it is no longer necessarily restricted to features supported by the client.

Expected values: "aiops", "bhom"

attributes

optional

Object containing key/value pairs of static attributes to store on the constructed BusinessService node (dynamic attributes can be set with named values in the conditions)

metadata

optional

Object containing arbitrary key/value pairs that are stored on the model definition

conditions

required if type=rules_template 

if type=rules , one of conditions or templates is required

parameters

read only

If type=rules_template, parameters is set to a flat array of all the parameters defined in conditions (to avoid the UI having to recurse into the conditions to extract them)

templates

if type=rules, one of conditions or templates is required

Object where the key is the key of the template model definition and the value is an object containing the parameters required by the template. For example:

{
  "key_of_template_1": { "param1": "value1", "param2": "value2" },
  "key_of_template_2": { "param1": "value3" }
}

If the user has overridden the operator from the template, the value contains a partial expression including the operator, but only including the right side of the expression,

e.g. { "type": "operator", "right": literal }

Normally, each template is only instantiated once. If the same template is instantiated multiple times with different parameters, the value in the templates object can be an array of objects rather than a single object:

{
  "key_of_template": [ { "param": "value1" }, { "param": "value2" } ]
}

contents

required if:
type in sam, static; optional if type is rules; not permitted if type is rules_template

Contents specified in JSON-format-for-model-contents

Relationships to other models

depended_upon

automatic

Array of keys of models that this model depends upon

dependants

automatic

Array of keys of models that depend on this

containers

automatic

Array of keys of models that contain this one

contained

automatic

Array of keys of models that are contained in this one

instances

automatic

Array of keys of models that are instances of a template / blueprint model, or instances of a multi-instance model

Lifecycle-related attributes

node_id

automatic

The hex node id of the ModelDefinition node used to store this model

published

automatic

Boolean to indicate whether the model is published or not. When it is published, it has an associated BusinessService, TechnicalService or BusinessApplicationInstance node that it is maintaining.

A model of type rules_template may not be set to be published.

published_id

read only

If the model is published, contains the hex node id of the published node

cloned_from

read only

When a model is published and the user edits it, the model is "cloned" into a temporary copy that can persist the user's in-progress edits without affecting the published model. If this model is a clone, cloned_from contains the node id of the published version of the model.

cloned_to

read only

If this is a published model that has a clone for edit, contains the node id of the clone.

favorite

automatic

Boolean. If true, the model is a favorite of the calling user.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*