实体
实体是一种输入类型,用于在触发操作时引用软件目录中的现有entities 。
💡 常见实体 Usage
例如,实体输入类型可被用来引用软件目录中的任何现有实体:
- 云区域;
- 集群;
- 配置;
- 等等。
在live demo 自助中心页面,我们可以看到scaffold new service 操作,其 Domain
输入是实体输入。
实体输入结构
实体由唯一的 "entity"_format_和随附的 "blueprint "键表示,如下节所示:
{
"myEntityInput": {
"title": "My entity input",
"icon": "My icon",
"description": "My entity input",
"type": "string",
"format": "entity",
"blueprint": "myBlueprint"
}
}
结构表
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 |
应用程序接口定义
- 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 定义
- 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"
}
}
}
}
}