Entity
Entity is an input type used to reference existing entities from the software catalog when triggering actions.
💡 Common entity usage​
The entity input type can be used to reference any existing entity from the software catalog, for example:
- Cloud regions
- Clusters
- Configurations
In the live demo self-service hub page, we can see the scaffold new service action whose Domain
input is an entity input. 🎬
Entity input structure​
The entity is represented by the unique entity
format and the blueprint
key that accompanies it, as shown in the following section:
{
"myEntityInput": {
"title": "My entity input",
"icon": "My icon",
"description": "My entity input",
"type": "string",
"format": "entity",
"blueprint": "myBlueprint"
}
}
Structure table​
Field | Description | Notes |
---|---|---|
"format": "entity" | Used to specify that this is an entity input | Required |
"blueprint": "myBlueprint" | Used to specify the identifier of the target blueprint that entities will be queried from | Required. Must specify an existing blueprint identifier |
API definition​
- Basic
- Array
{
"myEntityInput": {
"title": "My entity input",
"icon": "My icon",
"description": "My entity input",
"type": "string",
"format": "entity",
"blueprint": "myBlueprint"
}
}
{
"EntityArrayInput": {
"title": "My entity array input",
"icon": "My icon",
"description": "My entity array input",
"type": "array",
"items": {
"type": "string",
"format": "entity",
"blueprint": "myBlueprint"
}
}
}
Check out Port's API reference to learn more.
Terraform definition​
- Basic
- Array
resource "port_action" "myAction" {
# ...action properties
user_properties = {
string_props = {
"myEntityInput" = {
title = "My entity input"
description = "My entity input"
format = "entity"
blueprint = "myBlueprint"
}
}
}
}
resource "port_action" "myAction" {
# ...action properties
user_properties = {
array_props = {
"EntityArrayInput" = {
title = "My entity array input"
description = "My entity array input"
string_items = {
format = "entity"
}
}
}
}
}