Skip to main content

Attribute

In a schema file, an attribute can be defined inside a node, a generic or a node extension.

Summary

Below is the list of all available options to define an Attribute in the schema

NameTypeDescriptionMandatory
allow_overrideAttributeType of allowed override for the attribute.False
branchAttributeType of branch support for the attribute, if not defined it will be inherited from the node.False
choicesAttributeDefine a list of valid choices for a dropdown attribute.False
default_valueAttributeDefault value of the attribute.False
descriptionAttributeShort description of the attribute.False
enumAttributeDefine a list of valid values for the attribute.False
kindAttributeDefines the type of the attribute.True
labelAttributeHuman friendly representation of the name. Will be autogenerated if not providedFalse
max_lengthAttributeSet a maximum number of characters allowed for a given attribute.False
min_lengthAttributeSet a minimum number of characters allowed for a given attribute.False
nameAttributeAttribute name, must be unique within a model and must be all lowercase.True
optionalAttributeIndicate if this attribute is mandatory or optional.False
order_weightAttributeNumber used to order the attribute in the frontend (table and view). Lowest value will be ordered first.False
read_onlyAttributeSet the attribute as Read-Only, users won't be able to change its value. Mainly relevant for internal object.False
regexAttributeRegex uses to limit the characters allowed in for the attributes.False
stateAttributeExpected state of the attribute after loading the schemaFalse
uniqueAttributeIndicate if the value of this attribute must be unique in the database for a given model.False

Example

nodes:
- name: Rack
attributes:
- name: name
kind: Text
unique: True
description: Unique identifier for the rack
extensions:
nodes:
- kind: CoreProposedChange
attribute:
- name: ticket_id
kind: Text
unique: True
optional: False
description: Internal Ticket ID from Service Now

Reference Guide

allow_override

KeyValue
Nameallow_override
KindText
DescriptionType of allowed override for the attribute.
OptionalTrue
Default Valueany
Constraints
Accepted Valuesnone any

branch

KeyValue
Namebranch
KindText
DescriptionType of branch support for the attribute, if not defined it will be inherited from the node.
OptionalTrue
Default Value
Constraints
Accepted Valuesaware agnostic local

choices

KeyValue
Namechoices
KindList
DescriptionDefine a list of valid choices for a dropdown attribute.
OptionalTrue
Default Value
Constraints

default_value

KeyValue
Namedefault_value
KindAny
DescriptionDefault value of the attribute.
OptionalTrue
Default Value
Constraints

description

KeyValue
Namedescription
KindText
DescriptionShort description of the attribute.
OptionalTrue
Default Value
ConstraintsLength: min -, max 128

enum

KeyValue
Nameenum
KindList
DescriptionDefine a list of valid values for the attribute.
OptionalTrue
Default Value
Constraints

inherited

KeyValue
Nameinherited
KindBoolean
DescriptionInternal value to indicate if the attribute was inherited from a Generic node.
OptionalTrue
Default ValueFalse
Constraints

kind

KeyValue
Namekind
KindText
DescriptionDefines the type of the attribute.
OptionalFalse
Default Value
Constraints
Accepted ValuesID Dropdown Text TextArea DateTime Email Password HashedPassword URL File MacAddress Color Number Bandwidth IPHost IPNetwork Boolean Checkbox List JSON Any

label

KeyValue
Namelabel
KindText
DescriptionHuman friendly representation of the name. Will be autogenerated if not provided
OptionalTrue
Default Value
ConstraintsLength: min -, max 32

max_length

KeyValue
Namemax_length
KindNumber
DescriptionSet a maximum number of characters allowed for a given attribute.
OptionalTrue
Default Value
Constraints

min_length

KeyValue
Namemin_length
KindNumber
DescriptionSet a minimum number of characters allowed for a given attribute.
OptionalTrue
Default Value
Constraints

name

KeyValue
Namename
KindText
DescriptionAttribute name, must be unique within a model and must be all lowercase.
OptionalFalse
Default Value
ConstraintsRegex: ^[a-z0-9\_]+$
Length: min 3, max 32

optional

KeyValue
Nameoptional
KindBoolean
DescriptionIndicate if this attribute is mandatory or optional.
OptionalTrue
Default ValueTrue
Constraints

order_weight

KeyValue
Nameorder_weight
KindNumber
DescriptionNumber used to order the attribute in the frontend (table and view). Lowest value will be ordered first.
OptionalTrue
Default Value
Constraints

read_only

KeyValue
Nameread_only
KindBoolean
DescriptionSet the attribute as Read-Only, users won't be able to change its value. Mainly relevant for internal object.
OptionalTrue
Default ValueFalse
Constraints

regex

KeyValue
Nameregex
KindText
DescriptionRegex uses to limit the characters allowed in for the attributes.
OptionalTrue
Default Value
Constraints

state

KeyValue
Namestate
KindText
DescriptionExpected state of the attribute after loading the schema
OptionalTrue
Default Valuepresent
Constraints
Accepted Valuespresent absent

unique

KeyValue
Nameunique
KindBoolean
DescriptionIndicate if the value of this attribute must be unique in the database for a given model.
OptionalTrue
Default ValueFalse
Constraints

node

KeyValue
Namenode
KindObject
Description