Generating OpenAPI Schema
NAME DATA AGE
schema-ingress 1 46m
schema-scaler 1 50m
schema-webservice 1 2m26s
schema-webservice-v1 1 40s
schema-worker 1 1m45s
schema-worker-v1 1 55s
schema-worker-v2 1 20s
For the sack of convenience, we also specify a unified label for the which stores the parameter information of the same Definition. And we can list the ConfigMap which stores the parameter of the same Definition by specifying the label like definition.oam.dev/name=definitionName
, where the definitionName
is the specific name of your component or trait.
schema-worker 1 1m50s
schema-worker-v1 1 1m
schema-worker-v2 1 25s
For example, we can use the following command to get the JSON schema of webservice
.
apiVersion: v1
kind: ConfigMap
metadata:
name: schema-webservice
namespace: vela-system
openapi-v3-json-schema: '{"properties":{"cmd":{"description":"Commands to run in
of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core)","title":"cpu","type":"string"},"env":{"description":"Define
arguments by using environment variables","items":{"properties":{"name":{"description":"Environment
variable name","title":"name","type":"string"},"value":{"description":"The value
of the environment variable","title":"value","type":"string"},"valueFrom":{"description":"Specifies
a source the value of this var should come from","properties":{"secretKeyRef":{"description":"Selects
a key of a secret in the pod''s namespace","properties":{"key":{"description":"The
key of the secret to select from. Must be a valid secret key","title":"key","type":"string"},"name":{"description":"The
name of the secret in the pod''s namespace to select from","title":"name","type":"string"}},"required":["name","key"],"title":"secretKeyRef","type":"object"}},"required":["secretKeyRef"],"title":"valueFrom","type":"object"}},"required":["name"],"type":"object"},"title":"env","type":"array"},"image":{"description":"Which
image would you like to use for your service","title":"image","type":"string"},"port":{"default":80,"description":"Which
port do you want customer traffic sent to","title":"port","type":"integer"}},"required":["image","port"],"type":"object"}'
- For Terraform based definition: the
variable
is the keyword in TF template.
Next
Refer to UX of Definition