diff --git a/schemas/infrahub/schema/1.4.0.json b/schemas/infrahub/schema/1.4.0.json new file mode 100644 index 0000000..6ce74c4 --- /dev/null +++ b/schemas/infrahub/schema/1.4.0.json @@ -0,0 +1,1661 @@ +{ + "$defs": { + "AllowOverrideType": { + "enum": [ + "none", + "any" + ], + "title": "AllowOverrideType", + "type": "string" + }, + "AttributeParameters": { + "additionalProperties": false, + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Id" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present" + } + }, + "title": "AttributeParameters", + "type": "object" + }, + "AttributeSchema": { + "additionalProperties": false, + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The ID of the attribute", + "title": "Id", + "update": "not_applicable" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present", + "description": "Expected state of the attribute after loading the schema", + "update": "not_applicable" + }, + "name": { + "description": "Attribute name, must be unique within a model and must be all lowercase.", + "maxLength": 32, + "minLength": 3, + "pattern": "^[a-z0-9\\_]+$", + "title": "Name", + "type": "string", + "update": "migration_required" + }, + "kind": { + "description": "Defines the type of the attribute.", + "title": "Kind", + "type": "string", + "update": "migration_required" + }, + "enum": { + "anyOf": [ + { + "items": {}, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Define a list of valid values for the attribute.", + "title": "Enum", + "update": "validate_constraint" + }, + "computed_attribute": { + "anyOf": [ + { + "$ref": "#/$defs/ComputedAttribute" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Defines how the value of this attribute will be populated.", + "update": "allowed" + }, + "choices": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DropdownChoice" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Define a list of valid choices for a dropdown attribute.", + "title": "Choices", + "update": "validate_constraint" + }, + "regex": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Regex uses to limit the characters allowed in for the attributes. (deprecated: please use parameters.regex instead)", + "title": "Regex", + "update": "validate_constraint" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Set a maximum number of characters allowed for a given attribute. (deprecated: please use parameters.max_length instead)", + "title": "Max Length", + "update": "validate_constraint" + }, + "min_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Set a minimum number of characters allowed for a given attribute. (deprecated: please use parameters.min_length instead)", + "title": "Min Length", + "update": "validate_constraint" + }, + "label": { + "anyOf": [ + { + "maxLength": 32, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Human friendly representation of the name. Will be autogenerated if not provided", + "title": "Label", + "update": "allowed" + }, + "description": { + "anyOf": [ + { + "maxLength": 128, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Short description of the attribute.", + "title": "Description", + "update": "allowed" + }, + "read_only": { + "default": false, + "description": "Set the attribute as Read-Only, users won't be able to change its value. Mainly relevant for internal object.", + "title": "Read Only", + "type": "boolean", + "update": "allowed" + }, + "unique": { + "default": false, + "description": "Indicate if the value of this attribute must be unique in the database for a given model.", + "title": "Unique", + "type": "boolean", + "update": "validate_constraint" + }, + "optional": { + "default": false, + "description": "Indicate if this attribute is mandatory or optional.", + "title": "Optional", + "type": "boolean", + "update": "validate_constraint" + }, + "branch": { + "anyOf": [ + { + "$ref": "#/$defs/BranchSupportType" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Type of branch support for the attribute, if not defined it will be inherited from the node.", + "update": "not_supported" + }, + "order_weight": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Number used to order the attribute in the frontend (table and view). Lowest value will be ordered first.", + "title": "Order Weight", + "update": "allowed" + }, + "default_value": { + "anyOf": [ + {}, + { + "type": "null" + } + ], + "default": null, + "description": "Default value of the attribute.", + "title": "Default Value", + "update": "allowed" + }, + "inherited": { + "default": false, + "description": "Internal value to indicate if the attribute was inherited from a Generic node.", + "title": "Inherited", + "type": "boolean", + "update": "not_applicable" + }, + "allow_override": { + "$ref": "#/$defs/AllowOverrideType", + "default": "any", + "description": "Type of allowed override for the attribute.", + "update": "allowed" + }, + "parameters": { + "anyOf": [ + { + "$ref": "#/$defs/AttributeParameters" + }, + { + "$ref": "#/$defs/TextAttributeParameters" + }, + { + "$ref": "#/$defs/NumberAttributeParameters" + }, + { + "$ref": "#/$defs/NumberPoolParameters" + } + ], + "description": "Extra parameters specific to this kind of attribute", + "title": "Parameters", + "update": "validate_constraint" + }, + "deprecation": { + "anyOf": [ + { + "maxLength": 128, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Mark attribute as deprecated and provide a user-friendly message to display", + "title": "Deprecation", + "update": "allowed" + } + }, + "required": [ + "name", + "kind" + ], + "title": "AttributeSchema", + "type": "object" + }, + "BranchSupportType": { + "enum": [ + "aware", + "agnostic", + "local" + ], + "title": "BranchSupportType", + "type": "string" + }, + "ComputedAttribute": { + "additionalProperties": false, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "Jinja2" + } + } + }, + "then": { + "properties": { + "jinja2_template": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "jinja2_template" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "TransformPython" + } + } + }, + "then": { + "properties": { + "transform": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "transform" + ] + } + } + ], + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Id" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present" + }, + "kind": { + "$ref": "#/$defs/ComputedAttributeKind" + }, + "jinja2_template": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The Jinja2 template in string format, required when assignment_type=jinja2", + "title": "Jinja2 Template" + }, + "transform": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The Python Transform name or ID, required when assignment_type=transform", + "title": "Transform" + } + }, + "required": [ + "kind" + ], + "title": "ComputedAttribute", + "type": "object" + }, + "ComputedAttributeKind": { + "enum": [ + "User", + "Jinja2", + "TransformPython" + ], + "title": "ComputedAttributeKind", + "type": "string" + }, + "DropdownChoice": { + "additionalProperties": false, + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Id" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "color": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Color" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Label" + } + }, + "required": [ + "name" + ], + "title": "DropdownChoice", + "type": "object" + }, + "GenericSchema": { + "additionalProperties": false, + "description": "A Generic can be either an Interface or a Union depending if there are some Attributes or Relationships defined.", + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The ID of the node", + "title": "Id", + "update": "not_applicable" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present", + "description": "Expected state of the node/generic after loading the schema", + "update": "not_applicable" + }, + "name": { + "description": "Node name, must be unique within a namespace and must start with an uppercase letter.", + "maxLength": 32, + "minLength": 2, + "pattern": "^[A-Z][a-zA-Z0-9]+$", + "title": "Name", + "type": "string", + "update": "migration_required" + }, + "namespace": { + "description": "Node Namespace, Namespaces are used to organize models into logical groups and to prevent name collisions.", + "maxLength": 32, + "minLength": 3, + "pattern": "^[A-Z][a-z0-9]+$", + "title": "Namespace", + "type": "string", + "update": "migration_required" + }, + "description": { + "anyOf": [ + { + "maxLength": 128, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Short description of the model, will be visible in the frontend.", + "title": "Description", + "update": "allowed" + }, + "label": { + "anyOf": [ + { + "maxLength": 64, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Human friendly representation of the name/kind", + "title": "Label", + "update": "allowed" + }, + "branch": { + "$ref": "#/$defs/BranchSupportType", + "default": "aware", + "description": "Type of branch support for the model.", + "update": "not_supported" + }, + "default_filter": { + "anyOf": [ + { + "pattern": "^[a-z0-9\\_]*$", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Default filter used to search for a node in addition to its ID. (deprecated: please use human_friendly_id instead)", + "title": "Default Filter", + "update": "allowed" + }, + "human_friendly_id": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Human friendly and unique identifier for the object.", + "title": "Human Friendly Id", + "update": "allowed" + }, + "display_labels": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "List of attributes to use to generate the display label", + "title": "Display Labels", + "update": "allowed" + }, + "include_in_menu": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Defines if objects of this kind should be included in the menu.", + "title": "Include In Menu", + "update": "allowed" + }, + "menu_placement": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Defines where in the menu this object should be placed.", + "title": "Menu Placement", + "update": "allowed" + }, + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Defines the icon to use in the menu. Must be a valid value from the MDI library https://icon-sets.iconify.design/mdi/", + "title": "Icon", + "update": "allowed" + }, + "order_by": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "List of attributes to use to order the results by default", + "title": "Order By", + "update": "allowed" + }, + "uniqueness_constraints": { + "anyOf": [ + { + "items": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "List of multi-element uniqueness constraints that can combine relationships and attributes", + "title": "Uniqueness Constraints", + "update": "validate_constraint" + }, + "documentation": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Link to a documentation associated with this object, can be internal or external.", + "title": "Documentation", + "update": "allowed" + }, + "attributes": { + "description": "Node attributes", + "items": { + "$ref": "#/$defs/AttributeSchema" + }, + "title": "Attributes", + "type": "array", + "update": "not_applicable" + }, + "relationships": { + "description": "Node Relationships", + "items": { + "$ref": "#/$defs/RelationshipSchema" + }, + "title": "Relationships", + "type": "array", + "update": "not_applicable" + }, + "hierarchical": { + "default": false, + "description": "Defines if the Generic support the hierarchical mode.", + "title": "Hierarchical", + "type": "boolean", + "update": "validate_constraint" + }, + "generate_profile": { + "default": true, + "description": "Indicate if a profile schema should be generated for this schema", + "title": "Generate Profile", + "type": "boolean", + "update": "validate_constraint" + }, + "generate_template": { + "default": false, + "description": "Indicate if an object template schema should be generated for this schema", + "title": "Generate Template", + "type": "boolean", + "update": "allowed" + }, + "used_by": { + "description": "List of Nodes that are referencing this Generic", + "items": { + "type": "string" + }, + "title": "Used By", + "type": "array", + "update": "not_applicable" + } + }, + "required": [ + "name", + "namespace" + ], + "title": "GenericSchema", + "type": "object" + }, + "HashableModelState": { + "enum": [ + "present", + "absent" + ], + "title": "HashableModelState", + "type": "string" + }, + "NodeExtensionSchema": { + "additionalProperties": false, + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Id" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present" + }, + "kind": { + "title": "Kind", + "type": "string" + }, + "attributes": { + "items": { + "$ref": "#/$defs/AttributeSchema" + }, + "title": "Attributes", + "type": "array" + }, + "relationships": { + "items": { + "$ref": "#/$defs/RelationshipSchema" + }, + "title": "Relationships", + "type": "array" + } + }, + "required": [ + "kind" + ], + "title": "NodeExtensionSchema", + "type": "object" + }, + "NodeSchema": { + "additionalProperties": false, + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The ID of the node", + "title": "Id", + "update": "not_applicable" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present", + "description": "Expected state of the node/generic after loading the schema", + "update": "not_applicable" + }, + "name": { + "description": "Node name, must be unique within a namespace and must start with an uppercase letter.", + "maxLength": 32, + "minLength": 2, + "pattern": "^[A-Z][a-zA-Z0-9]+$", + "title": "Name", + "type": "string", + "update": "migration_required" + }, + "namespace": { + "description": "Node Namespace, Namespaces are used to organize models into logical groups and to prevent name collisions.", + "maxLength": 32, + "minLength": 3, + "pattern": "^[A-Z][a-z0-9]+$", + "title": "Namespace", + "type": "string", + "update": "migration_required" + }, + "description": { + "anyOf": [ + { + "maxLength": 128, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Short description of the model, will be visible in the frontend.", + "title": "Description", + "update": "allowed" + }, + "label": { + "anyOf": [ + { + "maxLength": 64, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Human friendly representation of the name/kind", + "title": "Label", + "update": "allowed" + }, + "branch": { + "$ref": "#/$defs/BranchSupportType", + "default": "aware", + "description": "Type of branch support for the model.", + "update": "not_supported" + }, + "default_filter": { + "anyOf": [ + { + "pattern": "^[a-z0-9\\_]*$", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Default filter used to search for a node in addition to its ID. (deprecated: please use human_friendly_id instead)", + "title": "Default Filter", + "update": "allowed" + }, + "human_friendly_id": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Human friendly and unique identifier for the object.", + "title": "Human Friendly Id", + "update": "allowed" + }, + "display_labels": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "List of attributes to use to generate the display label", + "title": "Display Labels", + "update": "allowed" + }, + "include_in_menu": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Defines if objects of this kind should be included in the menu.", + "title": "Include In Menu", + "update": "allowed" + }, + "menu_placement": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Defines where in the menu this object should be placed.", + "title": "Menu Placement", + "update": "allowed" + }, + "icon": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Defines the icon to use in the menu. Must be a valid value from the MDI library https://icon-sets.iconify.design/mdi/", + "title": "Icon", + "update": "allowed" + }, + "order_by": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "List of attributes to use to order the results by default", + "title": "Order By", + "update": "allowed" + }, + "uniqueness_constraints": { + "anyOf": [ + { + "items": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "List of multi-element uniqueness constraints that can combine relationships and attributes", + "title": "Uniqueness Constraints", + "update": "validate_constraint" + }, + "documentation": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Link to a documentation associated with this object, can be internal or external.", + "title": "Documentation", + "update": "allowed" + }, + "attributes": { + "description": "Node attributes", + "items": { + "$ref": "#/$defs/AttributeSchema" + }, + "title": "Attributes", + "type": "array", + "update": "not_applicable" + }, + "relationships": { + "description": "Node Relationships", + "items": { + "$ref": "#/$defs/RelationshipSchema" + }, + "title": "Relationships", + "type": "array", + "update": "not_applicable" + }, + "inherit_from": { + "description": "List of Generic Kind that this node is inheriting from", + "items": { + "type": "string" + }, + "title": "Inherit From", + "type": "array", + "update": "validate_constraint" + }, + "generate_profile": { + "default": true, + "description": "Indicate if a profile schema should be generated for this schema", + "title": "Generate Profile", + "type": "boolean", + "update": "validate_constraint" + }, + "generate_template": { + "default": false, + "description": "Indicate if an object template schema should be generated for this schema", + "title": "Generate Template", + "type": "boolean", + "update": "allowed" + }, + "hierarchy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Internal value to track the name of the Hierarchy, must match the name of a Generic supporting hierarchical mode", + "title": "Hierarchy", + "update": "validate_constraint" + }, + "parent": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Expected Kind for the parent node in a Hierarchy, default to the main generic defined if not defined.", + "title": "Parent", + "update": "validate_constraint" + }, + "children": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Expected Kind for the children nodes in a Hierarchy, default to the main generic defined if not defined.", + "title": "Children", + "update": "validate_constraint" + } + }, + "required": [ + "name", + "namespace" + ], + "title": "NodeSchema", + "type": "object" + }, + "NumberAttributeParameters": { + "additionalProperties": false, + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Id" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present" + }, + "min_value": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Set a minimum value allowed.", + "title": "Min Value", + "update": "validate_constraint" + }, + "max_value": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Set a maximum value allowed.", + "title": "Max Value", + "update": "validate_constraint" + }, + "excluded_values": { + "anyOf": [ + { + "pattern": "^(\\d+(?:-\\d+)?)(?:,\\d+(?:-\\d+)?)*$", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "List of values or range of values not allowed for the attribute, format is: '100,150-200,280,300-400'", + "title": "Excluded Values", + "update": "validate_constraint" + } + }, + "title": "NumberAttributeParameters", + "type": "object" + }, + "NumberPoolParameters": { + "additionalProperties": false, + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Id" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present" + }, + "end_range": { + "default": 9223372036854775807, + "description": "End range for numbers for the associated NumberPool", + "title": "End Range", + "type": "integer", + "update": "validate_constraint" + }, + "start_range": { + "default": 1, + "description": "Start range for numbers for the associated NumberPool", + "title": "Start Range", + "type": "integer", + "update": "validate_constraint" + }, + "number_pool_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The ID of the numberpool associated with this attribute", + "title": "Number Pool Id", + "update": "not_supported" + } + }, + "title": "NumberPoolParameters", + "type": "object" + }, + "RelationshipCardinality": { + "enum": [ + "one", + "many" + ], + "title": "RelationshipCardinality", + "type": "string" + }, + "RelationshipDeleteBehavior": { + "enum": [ + "no-action", + "cascade" + ], + "title": "RelationshipDeleteBehavior", + "type": "string" + }, + "RelationshipDirection": { + "enum": [ + "bidirectional", + "outbound", + "inbound" + ], + "title": "RelationshipDirection", + "type": "string" + }, + "RelationshipKind": { + "enum": [ + "Generic", + "Attribute", + "Component", + "Parent", + "Group", + "Hierarchy", + "Profile", + "Template" + ], + "title": "RelationshipKind", + "type": "string" + }, + "RelationshipSchema": { + "additionalProperties": false, + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The ID of the relationship schema", + "title": "Id", + "update": "not_applicable" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present", + "description": "Expected state of the relationship after loading the schema", + "update": "not_applicable" + }, + "name": { + "description": "Relationship name, must be unique within a model and must be all lowercase.", + "maxLength": 32, + "minLength": 3, + "pattern": "^[a-z0-9\\_]+$", + "title": "Name", + "type": "string", + "update": "allowed" + }, + "peer": { + "description": "Type (kind) of objects supported on the other end of the relationship.", + "pattern": "^[A-Z][a-zA-Z0-9]+$", + "title": "Peer", + "type": "string", + "update": "validate_constraint" + }, + "kind": { + "$ref": "#/$defs/RelationshipKind", + "default": "Generic", + "description": "Defines the type of the relationship.", + "update": "allowed" + }, + "label": { + "anyOf": [ + { + "maxLength": 32, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Human friendly representation of the name. Will be autogenerated if not provided", + "title": "Label", + "update": "allowed" + }, + "description": { + "anyOf": [ + { + "maxLength": 128, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Short description of the relationship.", + "title": "Description", + "update": "allowed" + }, + "identifier": { + "anyOf": [ + { + "maxLength": 128, + "pattern": "^[a-z0-9\\_]+$", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Unique identifier of the relationship within a model, identifiers must match to traverse a relationship on both direction.", + "title": "Identifier", + "update": "allowed" + }, + "cardinality": { + "$ref": "#/$defs/RelationshipCardinality", + "default": "many", + "description": "Defines how many objects are expected on the other side of the relationship.", + "update": "validate_constraint" + }, + "min_count": { + "default": 0, + "description": "Defines the minimum objects allowed on the other side of the relationship.", + "title": "Min Count", + "type": "integer", + "update": "validate_constraint" + }, + "max_count": { + "default": 0, + "description": "Defines the maximum objects allowed on the other side of the relationship.", + "title": "Max Count", + "type": "integer", + "update": "validate_constraint" + }, + "common_parent": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Name of a parent relationship on the peer schema that must share the same related object with the object's parent.", + "title": "Common Parent", + "update": "validate_constraint" + }, + "common_relatives": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "List of relationship names on the peer schema for which all objects must share the same set of peers.", + "title": "Common Relatives", + "update": "allowed" + }, + "order_weight": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Number used to order the relationship in the frontend (table and view). Lowest value will be ordered first.", + "title": "Order Weight", + "update": "allowed" + }, + "optional": { + "default": true, + "description": "Indicate if this relationship is mandatory or optional.", + "title": "Optional", + "type": "boolean", + "update": "validate_constraint" + }, + "branch": { + "anyOf": [ + { + "$ref": "#/$defs/BranchSupportType" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Type of branch support for the relatioinship, if not defined it will be determine based both peers.", + "update": "not_supported" + }, + "inherited": { + "default": false, + "description": "Internal value to indicate if the relationship was inherited from a Generic node.", + "title": "Inherited", + "type": "boolean", + "update": "not_applicable" + }, + "direction": { + "$ref": "#/$defs/RelationshipDirection", + "default": "bidirectional", + "description": "Defines the direction of the relationship, Unidirectional relationship are required when the same model is on both side.", + "update": "not_supported" + }, + "hierarchical": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Internal attribute to track the type of hierarchy this relationship is part of, must match a valid Generic Kind", + "title": "Hierarchical", + "update": "not_supported" + }, + "on_delete": { + "anyOf": [ + { + "$ref": "#/$defs/RelationshipDeleteBehavior" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Default is no-action. If cascade, related node(s) are deleted when this node is deleted.", + "update": "allowed" + }, + "allow_override": { + "$ref": "#/$defs/AllowOverrideType", + "default": "any", + "description": "Type of allowed override for the relationship.", + "update": "allowed" + }, + "read_only": { + "default": false, + "description": "Set the relationship as read-only, users won't be able to change its value.", + "title": "Read Only", + "type": "boolean", + "update": "allowed" + }, + "deprecation": { + "anyOf": [ + { + "maxLength": 128, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Mark relationship as deprecated and provide a user-friendly message to display", + "title": "Deprecation", + "update": "allowed" + } + }, + "required": [ + "name", + "peer" + ], + "title": "RelationshipSchema", + "type": "object" + }, + "SchemaExtension": { + "additionalProperties": false, + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Id" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present" + }, + "nodes": { + "items": { + "$ref": "#/$defs/NodeExtensionSchema" + }, + "title": "Nodes", + "type": "array" + } + }, + "title": "SchemaExtension", + "type": "object" + }, + "TextAttributeParameters": { + "additionalProperties": false, + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Id" + }, + "state": { + "$ref": "#/$defs/HashableModelState", + "default": "present" + }, + "regex": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Regular expression that attribute value must match if defined", + "title": "Regex", + "update": "validate_constraint" + }, + "min_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Set a minimum number of characters allowed.", + "title": "Min Length", + "update": "validate_constraint" + }, + "max_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Set a maximum number of characters allowed.", + "title": "Max Length", + "update": "validate_constraint" + } + }, + "title": "TextAttributeParameters", + "type": "object" + } + }, + "additionalProperties": false, + "properties": { + "version": { + "title": "Version", + "type": "string" + }, + "generics": { + "items": { + "$ref": "#/$defs/GenericSchema" + }, + "title": "Generics", + "type": "array" + }, + "nodes": { + "items": { + "$ref": "#/$defs/NodeSchema" + }, + "title": "Nodes", + "type": "array" + }, + "extensions": { + "$ref": "#/$defs/SchemaExtension", + "default": { + "id": null, + "state": "present", + "nodes": [] + } + } + }, + "required": [ + "version" + ], + "title": "InfrahubSchema", + "type": "object" +} \ No newline at end of file diff --git a/schemas/infrahub/schema/develop.json b/schemas/infrahub/schema/develop.json index a113fc1..6ce74c4 100644 --- a/schemas/infrahub/schema/develop.json +++ b/schemas/infrahub/schema/develop.json @@ -67,7 +67,7 @@ "description": "Defines the type of the attribute.", "title": "Kind", "type": "string", - "update": "validate_constraint" + "update": "migration_required" }, "enum": { "anyOf": [ diff --git a/schemas/infrahub/schema/latest.json b/schemas/infrahub/schema/latest.json index 118b085..eba4c28 120000 --- a/schemas/infrahub/schema/latest.json +++ b/schemas/infrahub/schema/latest.json @@ -1 +1 @@ -1.3.0.json \ No newline at end of file +1.4.0.json \ No newline at end of file diff --git a/schemas/python-sdk/repository-config/1.14.0.json b/schemas/python-sdk/repository-config/1.14.0.json new file mode 100644 index 0000000..b220ad7 --- /dev/null +++ b/schemas/python-sdk/repository-config/1.14.0.json @@ -0,0 +1,330 @@ +{ + "$defs": { + "InfrahubCheckDefinitionConfig": { + "additionalProperties": false, + "properties": { + "name": { + "description": "The name of the Check Definition", + "title": "Name", + "type": "string" + }, + "file_path": { + "description": "The file within the repository with the check code.", + "format": "path", + "title": "File Path", + "type": "string" + }, + "parameters": { + "description": "The input parameters required to run this check", + "title": "Parameters", + "type": "object" + }, + "targets": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The group to target when running this check, leave blank for global checks", + "title": "Targets" + }, + "class_name": { + "default": "Check", + "description": "The name of the check class to run.", + "title": "Class Name", + "type": "string" + } + }, + "required": [ + "name", + "file_path" + ], + "title": "InfrahubCheckDefinitionConfig", + "type": "object" + }, + "InfrahubGeneratorDefinitionConfig": { + "additionalProperties": false, + "properties": { + "name": { + "description": "The name of the Generator Definition", + "title": "Name", + "type": "string" + }, + "file_path": { + "description": "The file within the repository with the generator code.", + "format": "path", + "title": "File Path", + "type": "string" + }, + "query": { + "description": "The GraphQL query to use as input.", + "title": "Query", + "type": "string" + }, + "parameters": { + "description": "The input parameters required to run this check", + "title": "Parameters", + "type": "object" + }, + "targets": { + "description": "The group to target when running this generator", + "title": "Targets", + "type": "string" + }, + "class_name": { + "default": "Generator", + "description": "The name of the generator class to run.", + "title": "Class Name", + "type": "string" + }, + "convert_query_response": { + "default": false, + "description": "Decide if the generator should convert the result of the GraphQL query to SDK InfrahubNode objects.", + "title": "Convert Query Response", + "type": "boolean" + } + }, + "required": [ + "name", + "file_path", + "query", + "targets" + ], + "title": "InfrahubGeneratorDefinitionConfig", + "type": "object" + }, + "InfrahubJinja2TransformConfig": { + "additionalProperties": false, + "properties": { + "name": { + "description": "The name of the transform", + "title": "Name", + "type": "string" + }, + "query": { + "description": "The name of the GraphQL Query", + "title": "Query", + "type": "string" + }, + "template_path": { + "description": "The path within the repository of the template file", + "format": "path", + "title": "Template Path", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Description for this transform", + "title": "Description" + } + }, + "required": [ + "name", + "query", + "template_path" + ], + "title": "InfrahubJinja2TransformConfig", + "type": "object" + }, + "InfrahubPythonTransformConfig": { + "additionalProperties": false, + "properties": { + "name": { + "description": "The name of the Transform", + "title": "Name", + "type": "string" + }, + "file_path": { + "description": "The file within the repository with the transform code.", + "format": "path", + "title": "File Path", + "type": "string" + }, + "class_name": { + "default": "Transform", + "description": "The name of the transform class to run.", + "title": "Class Name", + "type": "string" + }, + "convert_query_response": { + "default": false, + "description": "Decide if the transform should convert the result of the GraphQL query to SDK InfrahubNode objects.", + "title": "Convert Query Response", + "type": "boolean" + } + }, + "required": [ + "name", + "file_path" + ], + "title": "InfrahubPythonTransformConfig", + "type": "object" + }, + "InfrahubRepositoryArtifactDefinitionConfig": { + "additionalProperties": false, + "properties": { + "name": { + "description": "The name of the artifact definition", + "title": "Name", + "type": "string" + }, + "artifact_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Name of the artifact created from this definition", + "title": "Artifact Name" + }, + "parameters": { + "description": "The input parameters required to render this artifact", + "title": "Parameters", + "type": "object" + }, + "content_type": { + "description": "The content type of the rendered artifact", + "title": "Content Type", + "type": "string" + }, + "targets": { + "description": "The group to target when creating artifacts", + "title": "Targets", + "type": "string" + }, + "transformation": { + "description": "The transformation to use.", + "title": "Transformation", + "type": "string" + } + }, + "required": [ + "name", + "parameters", + "content_type", + "targets", + "transformation" + ], + "title": "InfrahubRepositoryArtifactDefinitionConfig", + "type": "object" + }, + "InfrahubRepositoryGraphQLConfig": { + "additionalProperties": false, + "properties": { + "name": { + "description": "The name of the GraphQL Query", + "title": "Name", + "type": "string" + }, + "file_path": { + "description": "The file within the repository with the query code.", + "format": "path", + "title": "File Path", + "type": "string" + } + }, + "required": [ + "name", + "file_path" + ], + "title": "InfrahubRepositoryGraphQLConfig", + "type": "object" + } + }, + "additionalProperties": false, + "properties": { + "check_definitions": { + "description": "User defined checks", + "items": { + "$ref": "#/$defs/InfrahubCheckDefinitionConfig" + }, + "title": "Check Definitions", + "type": "array" + }, + "schemas": { + "description": "Schema files", + "items": { + "format": "path", + "type": "string" + }, + "title": "Schemas", + "type": "array" + }, + "jinja2_transforms": { + "description": "Jinja2 data transformations", + "items": { + "$ref": "#/$defs/InfrahubJinja2TransformConfig" + }, + "title": "Jinja2 Transforms", + "type": "array" + }, + "artifact_definitions": { + "description": "Artifact definitions", + "items": { + "$ref": "#/$defs/InfrahubRepositoryArtifactDefinitionConfig" + }, + "title": "Artifact Definitions", + "type": "array" + }, + "python_transforms": { + "description": "Python data transformations", + "items": { + "$ref": "#/$defs/InfrahubPythonTransformConfig" + }, + "title": "Python Transforms", + "type": "array" + }, + "generator_definitions": { + "description": "Generator definitions", + "items": { + "$ref": "#/$defs/InfrahubGeneratorDefinitionConfig" + }, + "title": "Generator Definitions", + "type": "array" + }, + "queries": { + "description": "GraphQL Queries", + "items": { + "$ref": "#/$defs/InfrahubRepositoryGraphQLConfig" + }, + "title": "Queries", + "type": "array" + }, + "objects": { + "description": "Objects", + "items": { + "format": "path", + "type": "string" + }, + "title": "Objects", + "type": "array" + }, + "menus": { + "description": "Menus", + "items": { + "format": "path", + "type": "string" + }, + "title": "Menus", + "type": "array" + } + }, + "title": "InfrahubRepositoryConfig", + "type": "object" +} \ No newline at end of file diff --git a/schemas/python-sdk/repository-config/latest.json b/schemas/python-sdk/repository-config/latest.json index 65ce964..97dc6ca 120000 --- a/schemas/python-sdk/repository-config/latest.json +++ b/schemas/python-sdk/repository-config/latest.json @@ -1 +1 @@ -1.13.0.json \ No newline at end of file +1.14.0.json \ No newline at end of file