Skip to main content

实体

实体是一种输入类型,用于在触发操作时引用软件目录中的现有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"
}
}

结构表

FieldDescriptionNotes
"format": "entity"Used to specify that this is an entity inputRequired
"blueprint": "myBlueprint"Used to specify the identifier of the target blueprint that entities will be queried fromRequired. Must specify an existing blueprint identifier

应用程序接口定义

{
"myEntityInput": {
"title": "My entity input",
"icon": "My icon",
"description": "My entity input",
"type": "string",
"format": "entity",
"blueprint": "myBlueprint"
}
}

Check out Port's API reference to learn more.

Terraform 定义

resource "port_action" "myAction" {
# ...action properties
user_properties = {
string_props = {
"myEntityInput" = {
title = "My entity input"
description = "My entity input"
format = "entity"
blueprint = "myBlueprint"
}
}
}
}