Skip to main content

Check out Port for yourselfย 

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 Jira issue and its related services. ๐ŸŽฌ

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.