Deployment
In order to deploy cmdb schema please make use of the code located in indigo cmdb repository indigo-dc/cmdb:
https://github.com/indigo-dc/cmdb
System requirements:
nodejs
npmAfter cloning the repository please install the package:
npm installConfiguration
In order to configure database location please edit config.js file. The format is pretty self explanatory. Sample configuration is attached below:
exports.url = "http://username:password@host:5984/dbname"Schema definition
To edit the schema itself navigate to schemas folder and make neccessary changes. Sample schema definitions should look like:
image.js
module.exports = {
type: "object",
additionalProperties: true,
list: {
filters: {
image_name: ["image_name"],
service: ["service"]
},
value: {
image_id: "image_id",
image_name: "image_name"
}
},
belongs_to: [{
type: 'service',
many_name: 'images',
foreign_key: 'service',
value: {
image_id: "image_id",
image_name: "image_name",
service: "service"
}
}],
properties: {
image_id: {
type: "string",
required: true
},
image_name: {
type: "string",
required: true
},
architecture: {
type: "string",
required: false
},
type: {
type: "string",
required: false
},
distribution: {
type: "string",
required: false
},
version: {
type: "string",
required: false
},
service: {
type: "string",
required: true
}
}
}provider.js
service.js
Deployment execution
When the configuration is ready, one can deploy CMDB by running following command
Last updated