Foundation Data & Integrations
Configuration Management Datab...
Adding a new CMDB Class/Table
9 min
overview adding a new class requires the creation of a new servicely table, defining the view definition and then the addition of a record in the cmdbmetadata table to provide a step by step guide on this, this will be done using a specific scenario this scenario being; we wish to add a new ci class representing apple laptops as there are special attributes that we wish to capture that do not belong on the general cmdblaptop ci class, has enough custom fields to warrant its own table choose the parent ci class you can view the existing physical tree by choosing the view physical {{cmdb}} tree menu item in the cmdb/administration section of the left hand menu the obvious parent ci class is cmdblaptop in this scenario, however in other scenarios in my not be as clear because ci class inheritance is an is a relationship the question must be asked if the new ci class really is a version of the parent ci class you might want to choose cmdbenduserdevice as the parent ci class, but then you would not have available the attributes on cmdblaptop and might have to duplicate them the general idea is to place the new ci class as low in the tree as it needs to go to make attributes available that it needs create the new {{cmdb}} table choose application/table/create new table from the left hand menu, which will open up form builder fill in the table details you can ignore menu creation for now as it is sometimes unclear how the menu structure should look for ci classes, so choose none for that choice the convention is to give ci classes a name that starts with {{cmdb}} to distinguish them from other tables in servicely we’ll make the table label {{cmdb}} apple laptop as that fits the naming convention used throughout the cmdb this will make the table name cmdbapplelaptop the label is used as a more friendly version of the table name in the ui we search in the parent table list for laptop as that is the parent table we want all the settings in the advanced options panel can be left at their defaults we that has been filled in you can click on the save table and configure fields button to start adding fields after clicking we get the add fields modal we will add one field named chip family which will be a choice field with two possible values intel or apple silicon you can use the choice editor to add the choices at this stage by typing the choice label into the choice label box and clicking add/update the choice key and order will be generated automatically all other settings on the other panels can be left at their defaults click the create button to add the field create and new is a a shortcut for adding the field and then re presenting the add field modal again to add more, but we only have the one in this scenario you will see that the field has been added to the form you can modify the form as you wish at this stage but there is an important consideration to not add any other fields to the form from the available fields list on the right this is because we are creating a view definition fragment in this scenario to take advantage of the rollup capability of {{cmdb}} forms click the save button to save the newly created table to the database a progress modal will appear add cmdbmetadata record when it has finished the form will appear note that this will not display the rollup capability until the metadata record has been added to the cmdbmetadata table for the newly created ci class choose the cmdb/administration/cmdb metadata menu item and you will see the existing records click the new button to create a new record the create form will open the name by convention is the underlying table name so it will be cmdbapplelaptop the title is by convention is the underlying table label and so it will be {{cmdb}} apple laptop the logical domain can be abstract domain for now it is important that view definition is fragment is set to true for rollup behaviour to work icon selection and custom infobox template can be left alone for now as the defaults are acceptable click create to create the record now if you go to the url /#/cmdbapplelaptop/ create you will see the rolled up view definition with all the other fields and view definition fragments made available on tabs you will notice that there is no table for {{cmdb}} laptop this is because it currently has no fields in one were added then a tab would appear automatically add a {{cmdb}} relationship let’s create an apple laptop and add a relationship between it and a router fill in the form as follows and click create go to the url /#/cmdbrouter/ create and fill in the form as follows and click create go to the menu item cmdb/relationships/new relationship and fill in the form as follows and click create go to the list of all {{cmdb}} apple laptops by going to the url /#/cmdbapplelaptop click on the first record and you will see the record form it now has one relationship view related cis click on the view related items button to see the {{cmdb}} diagram