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. (deprecated: please use parameters.max_length instead) | False |
min_length | Attribute | Set a minimum number of characters allowed for a given attribute. (deprecated: please use parameters.min_length instead) | 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 |
parameters | Attribute | Extra parameters specific to this kind of attribute | 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. (deprecated: please use parameters.regex instead) | 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