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
Name | Type | Description | Mandatory |
---|---|---|---|
allow_override | Attribute | Type of allowed override for the attribute. | False |
branch | Attribute | Type of branch support for the attribute, if not defined it will be inherited from the node. | False |
choices | Attribute | Define a list of valid choices for a dropdown attribute. | False |
computed_attribute | Attribute | Defines how the value of this attribute will be populated. | False |
default_value | Attribute | Default value of the attribute. | False |
deprecation | Attribute | Mark attribute as deprecated and provide a user-friendly message to display | False |
description | Attribute | Short description of the attribute. | False |
enum | Attribute | Define a list of valid values for the attribute. | False |
kind | Attribute | Defines the type of the attribute. | True |
label | Attribute | Human friendly representation of the name. Will be autogenerated if not provided | False |
max_length | Attribute | Set a maximum number of characters allowed for a given attribute. | False |
min_length | Attribute | Set a minimum number of characters allowed for a given attribute. | False |
name | Attribute | Attribute name, must be unique within a model and must be all lowercase. | True |
optional | Attribute | Indicate if this attribute is mandatory or optional. | False |
order_weight | Attribute | Number used to order the attribute in the frontend (table and view). Lowest value will be ordered first. | False |
read_only | Attribute | Set the attribute as Read-Only, users won't be able to change its value. Mainly relevant for internal object. | False |
regex | Attribute | Regex uses to limit the characters allowed in for the attributes. | False |
state | Attribute | Expected state of the attribute after loading the schema | False |
unique | Attribute | Indicate 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
Key | Value |
---|---|
Name | allow_override |
Kind | Text |
Description | Type of allowed override for the attribute. |
Optional | True |
Default Value | any |
Constraints | |
Accepted Values | none any |
branch
Key | Value |
---|---|
Name | branch |
Kind | Text |
Description | Type of branch support for the attribute, if not defined it will be inherited from the node. |
Optional | True |
Default Value | |
Constraints | |
Accepted Values | aware agnostic local |
choices
Key | Value |
---|---|
Name | choices |
Kind | List |
Description | Define a list of valid choices for a dropdown attribute. |
Optional | True |
Default Value | |
Constraints |
computed_attribute
Key | Value |
---|---|
Name | computed_attribute |
Kind | JSON |
Description | Defines how the value of this attribute will be populated. |
Optional | True |
Default Value | |
Constraints |
default_value
Key | Value |
---|---|
Name | default_value |
Kind | Any |
Description | Default value of the attribute. |
Optional | True |
Default Value | |
Constraints |
deprecation
Key | Value |
---|---|
Name | deprecation |
Kind | Text |
Description | Mark attribute as deprecated and provide a user-friendly message to display |
Optional | True |
Default Value | |
Constraints | Length: min -, max 128 |
description
Key | Value |
---|---|
Name | description |
Kind | Text |
Description | Short description of the attribute. |
Optional | True |
Default Value | |
Constraints | Length: min -, max 128 |
enum
Key | Value |
---|---|
Name | enum |
Kind | List |
Description | Define a list of valid values for the attribute. |
Optional | True |
Default Value | |
Constraints |
inherited
Key | Value |
---|---|
Name | inherited |
Kind | Boolean |
Description | Internal value to indicate if the attribute was inherited from a Generic node. |
Optional | True |
Default Value | False |
Constraints |
kind
Key | Value |
---|---|
Name | kind |
Kind | Text |
Description | Defines the type of the attribute. |
Optional | False |
Default Value | |
Constraints | |
Accepted Values | ID Dropdown Text TextArea DateTime Email Password HashedPassword URL File MacAddress Color Number Bandwidth IPHost IPNetwork Boolean Checkbox List JSON Any |
label
Key | Value |
---|---|
Name | label |
Kind | Text |
Description | Human friendly representation of the name. Will be autogenerated if not provided |
Optional | True |
Default Value | |
Constraints | Length: min -, max 32 |
max_length
Key | Value |
---|---|
Name | max_length |
Kind | Number |
Description | Set a maximum number of characters allowed for a given attribute. |
Optional | True |
Default Value | |
Constraints |
min_length
Key | Value |
---|---|
Name | min_length |
Kind | Number |
Description | Set a minimum number of characters allowed for a given attribute. |
Optional | True |
Default Value | |
Constraints |
name
Key | Value |
---|---|
Name | name |
Kind | Text |
Description | Attribute name, must be unique within a model and must be all lowercase. |
Optional | False |
Default Value | |
Constraints | Regex: ^[a-z0-9\_]+$ Length: min 3, max 32 |
optional
Key | Value |
---|---|
Name | optional |
Kind | Boolean |
Description | Indicate if this attribute is mandatory or optional. |
Optional | True |
Default Value | True |
Constraints |
order_weight
Key | Value |
---|---|
Name | order_weight |
Kind | Number |
Description | Number used to order the attribute in the frontend (table and view). Lowest value will be ordered first. |
Optional | True |
Default Value | |
Constraints |
read_only
Key | Value |
---|---|
Name | read_only |
Kind | Boolean |
Description | Set the attribute as Read-Only, users won't be able to change its value. Mainly relevant for internal object. |
Optional | True |
Default Value | False |
Constraints |
regex
Key | Value |
---|---|
Name | regex |
Kind | Text |
Description | Regex uses to limit the characters allowed in for the attributes. |
Optional | True |
Default Value | |
Constraints |
state
Key | Value |
---|---|
Name | state |
Kind | Text |
Description | Expected state of the attribute after loading the schema |
Optional | True |
Default Value | present |
Constraints | |
Accepted Values | present absent |
unique
Key | Value |
---|---|
Name | unique |
Kind | Boolean |
Description | Indicate if the value of this attribute must be unique in the database for a given model. |
Optional | True |
Default Value | False |
Constraints |
node
Key | Value |
---|---|
Name | node |
Kind | Object |
Description |