Skip to main content

Relate Blueprints


Relations define connections between blueprints, consequently connecting the entities based on these blueprints.
This provides logical context to the software catalog.

Common relations​

Relations can be used to represent the logical connections between assets in your software catalog, for example:

  • The packages that a microservice uses.
  • The run history of a CI job.
  • The Kubernetes clusters that exist in a cloud account.

In this live demo example, we can see the DevPortal Builder page with all of the blueprints and their relations. 🎬

Relation schema structure​

The basic structure of a relation object:

{
"myRelation": {
"title": "My title",
"target": "My target blueprint",
"required": true,
"many": false
}
}
info

A relation exists under the relations key in the Blueprint JSON schema

Structure table​

FieldDescriptionNotes
identifierUnique identifierThe identifier is used for API calls, programmatic access and distinguishing between different relations.

The identifier is the key of the relation schema object, in the schema structure above, the identifier is myRelation
titleRelation name that will be shown in the UIHuman-readable name for the relation
targetTarget blueprint identifierThe target blueprint has to exist when defining the relation
requiredBoolean flag to define whether the target must be provided when creating a new entity of the blueprint
manyBoolean flag to define whether multiple target entities can be mapped to the RelationFor more information refer to many relation

Types of relations​

👤 Single​

A single type relation is used to map a single target entity to the source.

💡 Common Single Relations​

  • Map a Deployment to the Running Service that it deployed.
  • Map a package version to the package.
  • Map a K8s cluster to the cloud account it is provisioned in.

In this live demo example, we can see a specific package version and its related core packages. 🎬

Single Relation Structure​

A single type relation is distinguished by the many: false configuration:

{
"myRelation": {
"title": "My title",
"target": "myTargetBlueprint",
"required": false,
"many": false
}
}

Check out Port's API reference to learn more.

👥 Many​

A many type relation is used to map multiple target entities to the source.

💡 Common Many Relations​

  • Map dependencies between services.
  • Map the packages used by a service.
  • Map the cloud resources used by a service.
  • Map the services deployed in a developer environment.

In this live demo example, we can see a specific developer environment and the running services it uses. 🎬

Many Relation Structure​

A many type relation is distinguished by the many: true configuration:

{
"myRelation": {
"title": "My title",
"target": "myTargetBlueprint",
"required": false,
"many": true
}
}

Check out Port's API reference to learn more.

note

A Relation can't be configured with both many and required set to true

Configure relations in Port​

Relations are part of the structure of a blueprint.

{
"identifier": "myIdentifier",
"title": "My title",
"description": "My description",
"icon": "My icon",
"calculationProperties": {},
"schema": {
"properties": {},
"required": []
},
"relations": {
"myRelation": {
"title": "My title",
"target": "My target blueprint",
"required": true,
"many": false
}
}
}

Check out Port's API reference to learn more.