Skip to main content

设置蓝图

定义蓝图模式,开始构建软件目录。

什么是蓝图?

蓝图(Blueprint)是 Port 中的通用构建模块,表示可在 Port 中管理的资产,如 "微服务"(Microservice)、"环境"(Environments)、"包"(Packages)、"集群"(Clusters)、"数据库"(Databases)等。

蓝图完全可以定制,支持用户选择的任意数量的属性,所有属性都可以随心所欲地修改。

💡 通用蓝图

例如,蓝图可被用于来表示软件目录中的任何资产:

  • 微服务;
  • 软件包;
  • 软件包版本;
  • CI 工作;
  • k8s 集群;
  • 云账户;
  • 云环境;
  • 开发人员环境;
  • 服务部署;
  • Pods
  • 虚拟机;
  • 等等。

live demo 示例中,我们可以看到包含所有蓝图的 DevPortal 生成器页面。

蓝图结构

每个蓝图由Json schema 表示,如下节所示:

{
"identifier": "myIdentifier",
"title": "My title",
"description": "My description",
"icon": "My icon",
"calculationProperties": {},
"schema": {
"properties": {
"myProp1": {
"type": "my_type",
"title": "My title"
},
"myProp2": {
"type": "my_special_type",
"title": "My special title"
}
},
"required": []
},
"relations": {}
}

结构表

FieldDescriptionNotes
identifierUnique identifierRequired. The identifier is used for API calls, programmatic access and distinguishing between different blueprints
titleNameRequired. Human-readable name for the blueprint
descriptionDescriptionThe value is visible as a tooltip to users when hovering over the info icon in the UI
iconIcon for the blueprint and entities of the blueprint.See the full icon list below
calculationPropertiesContains the properties defined using calculation propertiesRequired
mirrorPropertiesContains the properties defined using mirror properties
schemaAn object containing two nested fields: properties and required.Required. See the schema structure here
可用房源properties 页面列出了所有可用房源

模式对象

"schema": {
"properties": {},
"required": []
}
Schema fieldDescription
propertiesSee the properties section for more details.
requiredA list of the required properties, out of the properties object list.
These are mandatory fields to fill in the UI form.

在 Port 中配置蓝图

{
"identifier": "myIdentifier",
"title": "My title",
"description": "My description",
"icon": "My icon",
"calculationProperties": {},
"schema": {
"properties": {},
"required": []
},
"relations": {}
}

Check out Port's API reference to learn more.

完整图标列表

API, Airflow, AmazonEKS, Ansible, ApiDoc, Aqua, Argo, ArgoRollouts, Aws, Azure, BitBucket, Bucket, Buddy, CPU, CPlusPlus, CSharp, Clickup, Cloud, Cluster, Codefresh, Confluence, Coralogix, Crossplane, Datadog, Day2Operation, DeployedAt, Deployment, DevopsTool, EC2, EU, Environment, Falcosidekick, Fluxcd, GKE, GPU, Git, GitLab, GitVersion, Github, GithubActions, Go, Google, GoogleCloud, GoogleCloudPlatform, GoogleComputeEngine, Grafana, Graphql, HashiCorp, Infinity, Istio, Jenkins, Jira, Kafka, Kiali, Kotlin, Lambda, Launchdarkly, Link, Lock, LucidCharts, Matlab, Microservice, MongoDb, Moon, NewRelic, Node, NodeJS, Notion, Okta, Package, Pearl, PostgreSQL, Prometheus, Pulumi, Python, R, React, RestApi, Ruby, S3, SDK, SQL, Scala, Sentry, Server, Service, Slack, Swagger, Swift, TS, Terraform, TwoUsers, Youtrack, Zipkin, checkmarx, css3, html5, java, js, kibana, logz, pagerduty, php, port, sonarqube, spinnaker