Models API Reference¶
Low-level API reference for buildzr.models module.
This module contains the auto-generated Pydantic models that represent the Structurizr JSON schema. These are the underlying data structures used by the DSL classes.
models ¶
Enterprise
dataclass
¶
The enterprise associated with this model.
Source code in buildzr/models/models.py
Location ¶
Location1 ¶
HttpHealthCheck
dataclass
¶
Describes a HTTP based health check.
Source code in buildzr/models/models.py
interval
class-attribute
instance-attribute
¶
The polling interval, in seconds.
timeout
class-attribute
instance-attribute
¶
The timeout after which a health check is deemed as failed, in milliseconds.
headers
class-attribute
instance-attribute
¶
A set of name-value pairs corresponding to HTTP headers that should be sent with the request.
InteractionStyle ¶
Perspective
dataclass
¶
Represents an architectural perspective, that can be applied to elements and relationships.
Source code in buildzr/models/models.py
PaperSize ¶
Bases: Enum
The paper size that should be used to render this view.
Source code in buildzr/models/models.py
Mode ¶
Bases: Enum
Whether elements/relationships are being included or excluded based upon the set of tags.
Source code in buildzr/models/models.py
FilteredView
dataclass
¶
Represents a view on top of a view, which can be used to include or exclude specific elements.
Source code in buildzr/models/models.py
key
class-attribute
instance-attribute
¶
A unique identifier for this view.
order
class-attribute
instance-attribute
¶
An integer representing the creation order of this view.
title
class-attribute
instance-attribute
¶
The title of this view (optional).
description
class-attribute
instance-attribute
¶
The description of this view.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
baseViewKey
class-attribute
instance-attribute
¶
The key of the view on which this filtered view is based.
mode
class-attribute
instance-attribute
¶
Whether elements/relationships are being included or excluded based upon the set of tags.
tags
class-attribute
instance-attribute
¶
The set of tags to include/exclude elements/relationships when rendering this filtered view.
ImageView
dataclass
¶
A view that has been rendered elsewhere (e.g. PlantUML, Mermaid, Kroki, etc) as a image (e.g. PNG).
Source code in buildzr/models/models.py
key
class-attribute
instance-attribute
¶
A unique identifier for this view.
order
class-attribute
instance-attribute
¶
An integer representing the creation order of this view.
title
class-attribute
instance-attribute
¶
The title of this view (optional).
description
class-attribute
instance-attribute
¶
The description of this view.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
elementId
class-attribute
instance-attribute
¶
The ID of the element this view is associated with (optional).
content
class-attribute
instance-attribute
¶
The content of this image view, which needs to be a URL or a data URI.
contentType
class-attribute
instance-attribute
¶
The content type of this view (e.g. “image/png”).
ElementView
dataclass
¶
An instance of a model element (Person, Software System, Container or Component) in a View.
Source code in buildzr/models/models.py
Routing ¶
Bases: Enum
The routing algorithm used when rendering this individual relationship.
Source code in buildzr/models/models.py
Vertex
dataclass
¶
The X, Y coordinate of a bend in a line.
Source code in buildzr/models/models.py
AnimationStep
dataclass
¶
An animation step
Source code in buildzr/models/models.py
order
class-attribute
instance-attribute
¶
The order of this animation step.
elements
class-attribute
instance-attribute
¶
The set of element IDs that should be included in this animation step.
relationships
class-attribute
instance-attribute
¶
The set of relationship IDs that should be included in this animation step.
Dimensions
dataclass
¶
Represents a width and height pair.
Source code in buildzr/models/models.py
Implementation ¶
RankDirection ¶
AutomaticLayout
dataclass
¶
Represents the auto-layout configuration for a given view.
Source code in buildzr/models/models.py
implementation
class-attribute
instance-attribute
¶
The automatic layout implementation.
rankDirection
class-attribute
instance-attribute
¶
The algorithm rank direction.
rankSeparation
class-attribute
instance-attribute
¶
The separation between ranks (pixels).
nodeSeparation
class-attribute
instance-attribute
¶
The separation between nodes in the same rank (pixels).
edgeSeparation
class-attribute
instance-attribute
¶
The separation between edges (pixels).
vertices
class-attribute
instance-attribute
¶
Whether vertices should be created during automatic layout.
MetadataSymbols ¶
Bases: Enum
The type of symbols to use when rendering metadata.
Source code in buildzr/models/models.py
Font
dataclass
¶
Represents a font, including a name and an optional URL for web fonts.
Source code in buildzr/models/models.py
Branding
dataclass
¶
A wrapper for the font and logo for diagram/documentation branding purposes.
Source code in buildzr/models/models.py
Shape ¶
Bases: Enum
The shape used to render the element.
Source code in buildzr/models/models.py
Border ¶
ElementStyle
dataclass
¶
A definition of an element style.
Source code in buildzr/models/models.py
tag
class-attribute
instance-attribute
¶
The tag to which this element style applies.
width
class-attribute
instance-attribute
¶
The width of the element, in pixels.
height
class-attribute
instance-attribute
¶
The height of the element, in pixels.
background
class-attribute
instance-attribute
¶
The background colour of the element, as a HTML RGB hex string (e.g. ‘#ffffff’).
stroke
class-attribute
instance-attribute
¶
The stroke colour of the element, as a HTML RGB hex string (e.g. ‘#000000’).
strokeWidth
class-attribute
instance-attribute
¶
The width of the stroke, in pixels.
color
class-attribute
instance-attribute
¶
The foreground (text) colour of the element, as a HTML RGB hex string (e.g. ‘#ffffff’).
fontSize
class-attribute
instance-attribute
¶
The standard font size used to render text, in pixels.
shape
class-attribute
instance-attribute
¶
The shape used to render the element.
icon
class-attribute
instance-attribute
¶
A Base64 data URI representation of a PNG/JPG/GIF file.
border
class-attribute
instance-attribute
¶
The type of border used to render the element.
opacity
class-attribute
instance-attribute
¶
The opacity used when rendering the element; 0-100.
metadata
class-attribute
instance-attribute
¶
Whether the element metadata should be shown or not.
description
class-attribute
instance-attribute
¶
Whether the element description should be shown or not.
Routing1 ¶
RelationshipStyle
dataclass
¶
A definition of a relationship style.
Source code in buildzr/models/models.py
tag
class-attribute
instance-attribute
¶
The tag to which this relationship style applies.
thickness
class-attribute
instance-attribute
¶
The thickness of the line, in pixels.
color
class-attribute
instance-attribute
¶
The colour of the line, as a HTML RGB hex string (e.g. ‘#ffffff’).
fontSize
class-attribute
instance-attribute
¶
The standard font size used to render the relationship annotation, in pixels.
width
class-attribute
instance-attribute
¶
The width of the relationship annotation, in pixels.
dashed
class-attribute
instance-attribute
¶
A flag to indicate whether the line is rendered as dashed or not.
routing
class-attribute
instance-attribute
¶
The routing algorithm used when rendering lines.
position
class-attribute
instance-attribute
¶
The position of the annotation along the line; 0 (start) to 100 (end).
opacity
class-attribute
instance-attribute
¶
The opacity used when rendering the line; 0-100.
Format ¶
DocumentationSection
dataclass
¶
A documentation section.
Source code in buildzr/models/models.py
Status ¶
Decision
dataclass
¶
A decision record (e.g. architecture decision record).
Source code in buildzr/models/models.py
date
class-attribute
instance-attribute
¶
The date that the decision was made (ISO 8601 format).
status
class-attribute
instance-attribute
¶
The status of the decision.
content
class-attribute
instance-attribute
¶
The Markdown or AsciiDoc content of the section.
format
class-attribute
instance-attribute
¶
The content format type.
elementId
class-attribute
instance-attribute
¶
The ID of the element (in the model) that this decision applies to (optional).
Image
dataclass
¶
Terminology
dataclass
¶
Provides a way for the terminology on diagrams, etc to be modified (e.g. language translations).
Source code in buildzr/models/models.py
enterprise
class-attribute
instance-attribute
¶
The terminology used when rendering the enterprise boundary.
person
class-attribute
instance-attribute
¶
The terminology used when rendering people.
softwareSystem
class-attribute
instance-attribute
¶
The terminology used when rendering software systems.
container
class-attribute
instance-attribute
¶
The terminology used when rendering containers.
component
class-attribute
instance-attribute
¶
The terminology used when rendering components.
code
class-attribute
instance-attribute
¶
The terminology used when rendering code elements.
deploymentNode
class-attribute
instance-attribute
¶
The terminology used when rendering deployment nodes.
relationship
class-attribute
instance-attribute
¶
The terminology used when rendering relationships.
Visibility ¶
Scope ¶
Role ¶
User
dataclass
¶
Represents a user who should have access to a workspace.
Source code in buildzr/models/models.py
APIResponse
dataclass
¶
An API response.
Source code in buildzr/models/models.py
Relationship
dataclass
¶
A relationship between two elements.
Source code in buildzr/models/models.py
id
class-attribute
instance-attribute
¶
The ID of this relationship in the model.
description
class-attribute
instance-attribute
¶
A short description of this relationship.
tags
class-attribute
instance-attribute
¶
A comma separated list of tags associated with this relationship.
url
class-attribute
instance-attribute
¶
The URL where more information about this relationship can be found.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
perspectives
class-attribute
instance-attribute
¶
The set of perspectives associated with this relationship.
sourceId
class-attribute
instance-attribute
¶
The ID of the source element.
destinationId
class-attribute
instance-attribute
¶
The ID of the destination element.
technology
class-attribute
instance-attribute
¶
The technology associated with this relationship (e.g. HTTPS, JDBC, etc).
interactionStyle
class-attribute
instance-attribute
¶
The interaction style (synchronous or asynchronous).
linkedRelationshipId
class-attribute
instance-attribute
¶
The ID of the container-container relationship upon which this container instance-container instance relationship is based.
RelationshipView
dataclass
¶
An instance of a model relationship in a View.
Source code in buildzr/models/models.py
description
class-attribute
instance-attribute
¶
The description of this relationship (used in dynamic views only).
response
class-attribute
instance-attribute
¶
Signifies whether this relationship represents a return/response message (used in dynamic views only).
order
class-attribute
instance-attribute
¶
Gets the order of this relationship (used in dynamic views only; e.g. 1.0, 1.1, 2.0, etc).
vertices
class-attribute
instance-attribute
¶
The set of vertices used to render the relationship.
routing
class-attribute
instance-attribute
¶
The routing algorithm used when rendering this individual relationship.
position
class-attribute
instance-attribute
¶
The position of the annotation along the line; 0 (start) to 100 (end).
Styles
dataclass
¶
The styles associated with this set of views.
Source code in buildzr/models/models.py
Configuration
dataclass
¶
The configuration associated with a set of views.
Source code in buildzr/models/models.py
styles
class-attribute
instance-attribute
¶
The styles associated with this set of views.
lastSavedView
class-attribute
instance-attribute
¶
The key of the view that was saved most recently.
defaultView
class-attribute
instance-attribute
¶
The key of the view that should be shown by default.
themes
class-attribute
instance-attribute
¶
The URL(s) of the theme(s) to be used when rendering diagrams.
metadataSymbols
class-attribute
instance-attribute
¶
The type of symbols to use when rendering metadata.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
Documentation
dataclass
¶
A wrapper for documentation.
Source code in buildzr/models/models.py
WorkspaceConfiguration
dataclass
¶
The workspace configuration (for Structurizr cloud service and on-premises installation).
Source code in buildzr/models/models.py
Person
dataclass
¶
A person who uses a software system.
Source code in buildzr/models/models.py
id
class-attribute
instance-attribute
¶
The ID of this person in the model.
description
class-attribute
instance-attribute
¶
A short description of this person.
tags
class-attribute
instance-attribute
¶
A comma separated list of tags associated with this person.
url
class-attribute
instance-attribute
¶
The URL where more information about this element can be found.
location
class-attribute
instance-attribute
¶
The location of this person.
group
class-attribute
instance-attribute
¶
The name of the group in which this person should be included in.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
perspectives
class-attribute
instance-attribute
¶
The set of perspectives associated with this element.
relationships
class-attribute
instance-attribute
¶
The set of relationships from this person to other elements.
Component
dataclass
¶
A component (a grouping of related functionality behind an interface that runs inside a container).
Source code in buildzr/models/models.py
id
class-attribute
instance-attribute
¶
The ID of this component in the model.
description
class-attribute
instance-attribute
¶
A short description of this component.
technology
class-attribute
instance-attribute
¶
The technology associated with this component (e.g. Spring Bean).
tags
class-attribute
instance-attribute
¶
A comma separated list of tags associated with this component.
url
class-attribute
instance-attribute
¶
The URL where more information about this element can be found.
group
class-attribute
instance-attribute
¶
The name of the group in which this component should be included in.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
perspectives
class-attribute
instance-attribute
¶
The set of perspectives associated with this element.
relationships
class-attribute
instance-attribute
¶
The set of relationships from this component to other elements.
InfrastructureNode
dataclass
¶
An infrastructure node.
Source code in buildzr/models/models.py
id
class-attribute
instance-attribute
¶
The ID of this infrastructure node in the model.
name
class-attribute
instance-attribute
¶
The name of this infrastructure node.
description
class-attribute
instance-attribute
¶
A short description of this infrastructure node.
technology
class-attribute
instance-attribute
¶
The technology associated with this infrastructure node (e.g. “Route 53”).
environment
class-attribute
instance-attribute
¶
The deployment environment in which this infrastructure node resides (e.g. “Development”, “Live”, etc).
tags
class-attribute
instance-attribute
¶
A comma separated list of tags associated with this infrastructure node.
url
class-attribute
instance-attribute
¶
The URL where more information about this element can be found.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
perspectives
class-attribute
instance-attribute
¶
The set of perspectives associated with this element.
relationships
class-attribute
instance-attribute
¶
The set of relationships from this infrastructure node to other elements.
SoftwareSystemInstance
dataclass
¶
An instance of a software system, running on a deployment node.
Source code in buildzr/models/models.py
id
class-attribute
instance-attribute
¶
The ID of this software system instance in the model.
softwareSystemId
class-attribute
instance-attribute
¶
The ID of the software system this is an instance of.
instanceId
class-attribute
instance-attribute
¶
The number/index of this instance.
environment
class-attribute
instance-attribute
¶
The deployment environment in which this software system instance resides (e.g. “Development”, “Live”, etc).
tags
class-attribute
instance-attribute
¶
A comma separated list of tags associated with this software system instance.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
perspectives
class-attribute
instance-attribute
¶
The set of perspectives associated with this element.
relationships
class-attribute
instance-attribute
¶
The set of relationships from this software system instance to other elements.
healthChecks
class-attribute
instance-attribute
¶
The set of HTTP-based health checks for this software system instance.
ContainerInstance
dataclass
¶
An instance of a container, running on a deployment node.
Source code in buildzr/models/models.py
id
class-attribute
instance-attribute
¶
The ID of this container instance in the model.
containerId
class-attribute
instance-attribute
¶
The ID of the container this is an instance of.
instanceId
class-attribute
instance-attribute
¶
The number/index of this instance.
environment
class-attribute
instance-attribute
¶
The deployment environment in which this container instance resides (e.g. “Development”, “Live”, etc).
tags
class-attribute
instance-attribute
¶
A comma separated list of tags associated with this container instance.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
perspectives
class-attribute
instance-attribute
¶
The set of perspectives associated with this element.
relationships
class-attribute
instance-attribute
¶
The set of relationships from this container instance to other elements.
healthChecks
class-attribute
instance-attribute
¶
The set of HTTP-based health checks for this container instance.
SystemLandscapeView
dataclass
¶
A system landscape view.
Source code in buildzr/models/models.py
key
class-attribute
instance-attribute
¶
A unique identifier for this view.
order
class-attribute
instance-attribute
¶
An integer representing the creation order of this view.
title
class-attribute
instance-attribute
¶
The title of this view (optional).
description
class-attribute
instance-attribute
¶
The description of this view.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
paperSize
class-attribute
instance-attribute
¶
The paper size that should be used to render this view.
enterpriseBoundaryVisible
class-attribute
instance-attribute
¶
Specifies whether the enterprise boundary (to differentiate internal elements from external elements) should be visible on the resulting diagram.
elements
class-attribute
instance-attribute
¶
The set of elements in this views.
relationships
class-attribute
instance-attribute
¶
The set of relationships in this views.
animations
class-attribute
instance-attribute
¶
The set of animation steps (optional).
SystemContextView
dataclass
¶
A system context view.
Source code in buildzr/models/models.py
key
class-attribute
instance-attribute
¶
A unique identifier for this view.
order
class-attribute
instance-attribute
¶
An integer representing the creation order of this view.
title
class-attribute
instance-attribute
¶
The title of this view (optional).
description
class-attribute
instance-attribute
¶
The description of this view.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
softwareSystemId
class-attribute
instance-attribute
¶
The ID of the software system this view is associated with.
paperSize
class-attribute
instance-attribute
¶
The paper size that should be used to render this view.
enterpriseBoundaryVisible
class-attribute
instance-attribute
¶
Specifies whether the enterprise boundary (to differentiate internal elements from external elements”) should be visible on the resulting diagram.
elements
class-attribute
instance-attribute
¶
The set of elements in this view.
relationships
class-attribute
instance-attribute
¶
The set of relationships in this view.
animations
class-attribute
instance-attribute
¶
The set of animation steps (optional).
ContainerView
dataclass
¶
A container view.
Source code in buildzr/models/models.py
key
class-attribute
instance-attribute
¶
A unique identifier for this view.
order
class-attribute
instance-attribute
¶
An integer representing the creation order of this view.
title
class-attribute
instance-attribute
¶
The title of this view (optional).
description
class-attribute
instance-attribute
¶
The description of this view.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
softwareSystemId
class-attribute
instance-attribute
¶
The ID of the software system this view is associated with.
paperSize
class-attribute
instance-attribute
¶
The paper size that should be used to render this view.
elements
class-attribute
instance-attribute
¶
The set of elements in this views.
relationships
class-attribute
instance-attribute
¶
The set of relationships in this views.
animations
class-attribute
instance-attribute
¶
The set of animation steps (optional).
externalSoftwareSystemBoundariesVisible
class-attribute
instance-attribute
¶
Specifies whether software system boundaries should be visible for “external” containers (those outside the software system in scope).
ComponentView
dataclass
¶
A component view.
Source code in buildzr/models/models.py
key
class-attribute
instance-attribute
¶
A unique identifier for this view.
order
class-attribute
instance-attribute
¶
An integer representing the creation order of this view.
title
class-attribute
instance-attribute
¶
The title of this view (optional).
description
class-attribute
instance-attribute
¶
The description of this view.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
containerId
class-attribute
instance-attribute
¶
The ID of the container this view is associated with.
paperSize
class-attribute
instance-attribute
¶
The paper size that should be used to render this view.
elements
class-attribute
instance-attribute
¶
The set of elements in this views.
relationships
class-attribute
instance-attribute
¶
The set of relationships in this views.
animations
class-attribute
instance-attribute
¶
The set of animation steps (optional).
externalContainerBoundariesVisible
class-attribute
instance-attribute
¶
Specifies whether container boundaries should be visible for “external” components (those outside the container in scope).
DynamicView
dataclass
¶
A dynamic view.
Source code in buildzr/models/models.py
key
class-attribute
instance-attribute
¶
A unique identifier for this view.
order
class-attribute
instance-attribute
¶
An integer representing the creation order of this view.
title
class-attribute
instance-attribute
¶
The title of this view (optional).
description
class-attribute
instance-attribute
¶
The description of this view.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
elementId
class-attribute
instance-attribute
¶
The ID of the element this view is associated with (optional).
paperSize
class-attribute
instance-attribute
¶
The paper size that should be used to render this view.
elements
class-attribute
instance-attribute
¶
The set of elements in this views.
relationships
class-attribute
instance-attribute
¶
The set of relationships in this views.
externalBoundariesVisible
class-attribute
instance-attribute
¶
Specifies software system/container boundaries should be visible for “external” containers/components (those outside the element in scope)
DeploymentView
dataclass
¶
A deployment view.
Source code in buildzr/models/models.py
key
class-attribute
instance-attribute
¶
A unique identifier for this view.
order
class-attribute
instance-attribute
¶
An integer representing the creation order of this view.
title
class-attribute
instance-attribute
¶
The title of this view (optional).
description
class-attribute
instance-attribute
¶
The description of this view.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
softwareSystemId
class-attribute
instance-attribute
¶
The ID of the software system this view is associated with (optional).
environment
class-attribute
instance-attribute
¶
The name of the environment that this deployment view is for (e.g. “Development”, “Live”, etc).
paperSize
class-attribute
instance-attribute
¶
The paper size that should be used to render this view.
elements
class-attribute
instance-attribute
¶
The set of elements in this views.
relationships
class-attribute
instance-attribute
¶
The set of relationships in this views.
animations
class-attribute
instance-attribute
¶
The set of animation steps (optional).
Container
dataclass
¶
A container (something that can execute code or host data).
Source code in buildzr/models/models.py
id
class-attribute
instance-attribute
¶
The ID of this container in the model.
description
class-attribute
instance-attribute
¶
A short description of this container.
technology
class-attribute
instance-attribute
¶
The technology associated with this container (e.g. Apache Tomcat).
tags
class-attribute
instance-attribute
¶
A comma separated list of tags associated with this container.
url
class-attribute
instance-attribute
¶
The URL where more information about this element can be found.
components
class-attribute
instance-attribute
¶
The set of components within this container.
group
class-attribute
instance-attribute
¶
The name of the group in which this container should be included in.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
perspectives
class-attribute
instance-attribute
¶
The set of perspectives associated with this element.
relationships
class-attribute
instance-attribute
¶
The set of relationships from this container to other elements.
DeploymentNode
dataclass
¶
A deployment node.
Source code in buildzr/models/models.py
1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 | |
id
class-attribute
instance-attribute
¶
The ID of this deployment node in the model.
name
class-attribute
instance-attribute
¶
The name of this deployment node.
description
class-attribute
instance-attribute
¶
A short description of this deployment node.
technology
class-attribute
instance-attribute
¶
The technology associated with this deployment node (e.g. Apache Tomcat).
environment
class-attribute
instance-attribute
¶
The deployment environment in which this deployment node resides (e.g. “Development”, “Live”, etc).
instances
class-attribute
instance-attribute
¶
The number of instances; either a number (e.g. 1, 2, etc) or a range (e.g. 0..N, 0..*, 1..3, etc).
tags
class-attribute
instance-attribute
¶
A comma separated list of tags associated with this deployment node.
url
class-attribute
instance-attribute
¶
The URL where more information about this element can be found.
children
class-attribute
instance-attribute
¶
The set of child/nested deployment nodes.
softwareSystemInstances
class-attribute
instance-attribute
¶
The set of software systems instances running in this deployment node..
containerInstances
class-attribute
instance-attribute
¶
The set of container instances running in this deployment node..
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
perspectives
class-attribute
instance-attribute
¶
The set of perspectives associated with this element.
relationships
class-attribute
instance-attribute
¶
The set of relationships from this deployment node to other elements.
Views
dataclass
¶
The set of views onto a software architecture model.
Source code in buildzr/models/models.py
systemLandscapeViews
class-attribute
instance-attribute
¶
The set of system landscape views.
systemContextViews
class-attribute
instance-attribute
¶
The set of system context views.
containerViews
class-attribute
instance-attribute
¶
The set of container views.
componentViews
class-attribute
instance-attribute
¶
The set of component views.
dynamicViews
class-attribute
instance-attribute
¶
The set of dynamic views.
deploymentViews
class-attribute
instance-attribute
¶
The set of deployment views.
filteredViews
class-attribute
instance-attribute
¶
The set of filtered views.
imageViews
class-attribute
instance-attribute
¶
The set of image views.
SoftwareSystem
dataclass
¶
A software system.
Source code in buildzr/models/models.py
id
class-attribute
instance-attribute
¶
The ID of this software system in the model.
name
class-attribute
instance-attribute
¶
The name of this software system.
description
class-attribute
instance-attribute
¶
A short description of this software system.
location
class-attribute
instance-attribute
¶
The location of this software system.
tags
class-attribute
instance-attribute
¶
A comma separated list of tags associated with this software system.
url
class-attribute
instance-attribute
¶
The URL where more information about this element can be found.
containers
class-attribute
instance-attribute
¶
The set of containers within this software system.
group
class-attribute
instance-attribute
¶
The name of the group in which this software system should be included in.
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
perspectives
class-attribute
instance-attribute
¶
The set of perspectives associated with this element.
relationships
class-attribute
instance-attribute
¶
The set of relationships from this software system to other elements.
Model
dataclass
¶
A software architecture model.
Source code in buildzr/models/models.py
Workspace
dataclass
¶
Represents a Structurizr workspace, which is a wrapper for a software architecture model, views, and documentation.
Source code in buildzr/models/models.py
description
class-attribute
instance-attribute
¶
A short description of the workspace.
version
class-attribute
instance-attribute
¶
A version number for the workspace.
thumbnail
class-attribute
instance-attribute
¶
The thumbnail associated with the workspace; a Base64 encoded PNG file as a data URI (data:image/png;base64).
lastModifiedDate
class-attribute
instance-attribute
¶
The last modified date, in ISO 8601 format (e.g. “2018-09-08T12:40:03Z”).
lastModifiedUser
class-attribute
instance-attribute
¶
A string identifying the user who last modified the workspace (e.g. an e-mail address or username).
lastModifiedAgent
class-attribute
instance-attribute
¶
A string identifying the agent that was last used to modify the workspace (e.g. “structurizr-java/1.2.0”).
properties
class-attribute
instance-attribute
¶
A set of arbitrary name-value properties.
Overview¶
The buildzr.models module contains Pydantic models generated from the Structurizr JSON schema using datamodel-code-generator.
When to Use¶
Most users should use the higher-level DSL API (buildzr.dsl) rather than working directly with these models. However, these models are useful when:
- Direct JSON manipulation - Converting between Python objects and JSON
- Custom extensions - Building custom functionality on top of buildzr
- Integration - Integrating with other Structurizr tools
- Validation - Validating Structurizr JSON structures
Key Model Classes¶
Workspace Model¶
The root model representing a complete Structurizr workspace.
from buildzr.models import Workspace, Model, ViewSet
workspace = Workspace(
name="My Workspace",
model=Model(),
views=ViewSet()
)
Model Elements¶
Core model element types:
Person- Human users/actorsSoftwareSystem- Software systemsContainer- Applications/data storesComponent- Components within containers
Deployment Model Elements¶
Deployment-related model types:
DeploymentNode- Infrastructure nodes (servers, cloud instances, etc.)InfrastructureNode- Supporting infrastructure (load balancers, message queues, etc.)ContainerInstance- Deployed instance of a containerSoftwareSystemInstance- Deployed instance of a software system
Relationships¶
from buildzr.models import Relationship
relationship = Relationship(
sourceId="1",
destinationId="2",
description="Uses",
technology="HTTPS"
)
Views¶
View models for different diagram types:
SystemLandscapeViewSystemContextViewContainerViewComponentViewDeploymentView
Working with Models¶
Exporting to JSON¶
workspace_dict = workspace.dict(exclude_none=True, by_alias=True)
with open('output.json', 'w') as f:
json.dump(workspace_dict, f, indent=2)
Type Hints¶
All models include full type hints for IDE support:
from buildzr.models import Workspace, Model
def process_workspace(ws: Workspace) -> Model:
return ws.model
Schema Compliance¶
These models are auto-generated to stay in sync with the official Structurizr JSON schema, ensuring compatibility with all Structurizr tools.
Complete Example with Deployment¶
Here’s a more comprehensive example that includes deployment models:
import json
from buildzr.models import (
Workspace,
Model,
ViewSet,
Person,
SoftwareSystem,
Container,
DeploymentNode,
ContainerInstance,
InfrastructureNode,
Relationship,
SystemContextView,
DeploymentView,
)
# Create a workspace
workspace = Workspace(
name="Complete Example",
description="Example with deployment models",
model=Model(
people=[
Person(
id="1",
name="User",
description="System user"
)
],
softwareSystems=[
SoftwareSystem(
id="2",
name="Web Application",
containers=[
Container(
id="3",
name="API",
technology="Python/FastAPI"
),
Container(
id="4",
name="Database",
technology="PostgreSQL"
)
]
)
],
relationships=[
Relationship(
sourceId="1",
destinationId="2",
description="Uses"
),
Relationship(
sourceId="3",
destinationId="4",
description="Reads from and writes to",
technology="SQL"
)
]
),
views=ViewSet(
systemContextViews=[
SystemContextView(
key="context",
softwareSystemId="2",
description="System Context"
)
],
deploymentViews=[
DeploymentView(
key="deployment",
softwareSystemId="2",
environment="Production",
description="Production Deployment"
)
]
)
)
# Add deployment model
deployment_node_aws = DeploymentNode(
id="5",
name="AWS",
technology="Cloud Provider",
children=[
DeploymentNode(
id="6",
name="ECS Cluster",
technology="Container Service",
containerInstances=[
ContainerInstance(
id="7",
containerId="3",
instanceId=1
)
]
),
DeploymentNode(
id="8",
name="RDS",
technology="Managed Database",
containerInstances=[
ContainerInstance(
id="9",
containerId="4",
instanceId=1
)
]
)
],
infrastructureNodes=[
InfrastructureNode(
id="10",
name="Load Balancer",
technology="AWS ALB"
)
]
)
# Add deployment environment to model
if not workspace.model.deploymentNodes:
workspace.model.deploymentNodes = []
workspace.model.deploymentNodes.append(deployment_node_aws)
# Export to JSON
workspace_dict = workspace.dict(exclude_none=True, by_alias=True)
with open('complete_workspace.json', 'w') as f:
json.dump(workspace_dict, f, indent=2)
print("Workspace created with deployment models!")
DSL vs Models
While you can use the low-level models directly as shown above, most users should prefer the higher-level DSL API from buildzr.dsl, which provides a more intuitive and Pythonic interface.
Model IDs
When working directly with models, you need to manually manage element IDs and references. The DSL API handles this automatically.
See Also¶
- DSL API Reference - High-level DSL API (recommended)
- Structurizr JSON Schema - Official schema
- User Guide - Usage guide