Skip to main content

Yaml

Yaml 是一种数据类型,被用于来保存 YAML 中的对象定义。

💡 常见的 yaml Usage

yaml 属性类型可被用来存储任何基于 key/value 的数据,例如:

  • 配置;
  • Helm 图表;
  • 字典/哈希图
  • 配置清单;
  • values.yml
  • 等。

在这个live demo 示例中,我们可以看到 Helm Chart yaml 属性。 🎬

应用程序接口定义

{
"myYAMLProp": {
"title": "My yaml",
"icon": "My icon",
"description": "My yaml property",
"type": "string",
"format": "yaml"
}
}

Check out Port's API reference to learn more.

Terraform 定义

resource "port_blueprint" "myBlueprint" {
# ...blueprint properties
properties = {
string_props = {
"myYamlProp" = {
title = "My yaml"
required = false
format = "yaml"
}
}
}
}

Pulumi 的定义

"""A Python Pulumi program"""

import pulumi
from port_pulumi import Blueprint,BlueprintPropertiesArgs,BlueprintPropertyArgs

blueprint = Blueprint(
"myBlueprint",
identifier="myBlueprint",
title="My Blueprint",
properties=BlueprintPropertiesArgs(
string_props={
"myYamlProp": BlueprintPropertyArgs(
title="My yaml",
required=False,
format="yaml",
)
}
),
relations={}
)