Skip to content

Commit 61f880e

Browse files
authored
Merge pull request #19 from aliyun/feature/json_schema_update_20240229
add json schema docs and json schema updates
2 parents d511aa9 + d0d0bff commit 61f880e

File tree

102 files changed

+3886
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+3886
-290
lines changed

schema/artifact.schema.json

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
{
2+
"$id": "https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json",
3+
"title": "Artifact",
4+
"description": "Artifact 的类型可以是 NodeOutput、Table、Variable,都可以作为工作流节点的输入或者输出使用。",
5+
"type": "object",
6+
"properties": {
7+
"artifactType": {
8+
"type": "string",
9+
"enum": [
10+
"Table",
11+
"Variable",
12+
"NodeOutput"
13+
],
14+
"meta:enum": {
15+
"Table": "",
16+
"Variable": "变量",
17+
"NodeOutput": "节点输出"
18+
}
19+
}
20+
},
21+
"required": [
22+
"artifactType"
23+
],
24+
"oneOf": [
25+
{
26+
"properties": {
27+
"artifactType": {
28+
"const": "Table"
29+
}
30+
},
31+
"$ref": "#/table"
32+
},
33+
{
34+
"properties": {
35+
"artifactType": {
36+
"const": "Variable"
37+
}
38+
},
39+
"$ref": "#/variable"
40+
},
41+
{
42+
"properties": {
43+
"artifactType": {
44+
"const": "NodeOutput"
45+
}
46+
},
47+
"$ref": "#/nodeOutput"
48+
}
49+
],
50+
"table": {
51+
"title": "Artifact.Table",
52+
"description": "节点使用的上游产出表",
53+
"type": "object",
54+
"properties": {
55+
"guid": {
56+
"title": "Guid",
57+
"description": "产出表唯一标识符",
58+
"type": "string"
59+
}
60+
},
61+
"required": [
62+
"guid"
63+
]
64+
},
65+
"variable": {
66+
"title": "Artifact.Variable",
67+
"description": "Variable定义了工作流的变量, Variable可以被在工作流节点中引用",
68+
"type": "object",
69+
"properties": {
70+
"id": {
71+
"description": "唯一标识",
72+
"type": "string"
73+
},
74+
"name": {
75+
"description": "变量名",
76+
"type": "string"
77+
},
78+
"scope": {
79+
"description": "变量作用域",
80+
"type": "string",
81+
"enum": [
82+
"NodeParameter",
83+
"NodeContext",
84+
"Workflow",
85+
"Workspace",
86+
"Tenant"
87+
],
88+
"meta:enum": {
89+
"NodeParameter": "只有节点内使用的参数",
90+
"NodeContext": "节点的上下文中的参数,可以被下游节点使用",
91+
"Workflow": "工作流级别的参数,可以被工作流所有节点使用",
92+
"Workspace": "工作空间级别的参数,可以被工作空间所有节点使用",
93+
"Tenant": "租户级别参数,可以被租户的所有节点使用"
94+
}
95+
},
96+
"type": {
97+
"description": "变量类型",
98+
"type": "string",
99+
"enum": [
100+
"System",
101+
"Constant"
102+
],
103+
"meta:enum": {
104+
"System": "系统变量,例如: $[yyyymmdd]",
105+
"Constant": "常量"
106+
}
107+
},
108+
"value": {
109+
"description": "变量值",
110+
"type": "string",
111+
"examples": [
112+
"$[yyyymmdd]",
113+
"$[yyyymmdd-1]",
114+
"$[hh24-1/24]",
115+
"$[hh24miss-1/24/60]",
116+
"$[add_months(yyyymm,-1)]",
117+
"$[add_months(yyyymmdd,-12)]"
118+
]
119+
}
120+
},
121+
"required": [
122+
"id",
123+
"name",
124+
"scope",
125+
"type",
126+
"value"
127+
]
128+
},
129+
"nodeOutput": {
130+
"title": "Artifact.NodeOutput",
131+
"description": "节点使用的上游节点的预定义输出",
132+
"type": "object",
133+
"properties": {
134+
"output": {
135+
"title": "Output",
136+
"description": "节点调度输出标识",
137+
"type": "string"
138+
}
139+
},
140+
"required": [
141+
"output"
142+
]
143+
}
144+
}

schema/docs/README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# README
2+
3+
## Top-level Schemas
4+
5+
* [Artifact](./artifact.md "Artifact 的类型可以是 NodeOutput、Table、Variable,都可以作为工作流节点的输入或者输出使用。")`https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json`
6+
7+
* [FileResource](./fileresource.md "定义了文件资源, 如: jar, python, text file, archive files等")`https://dataworks.data.aliyun.com/schemas/1.1.0/fileResource.schema.json`
8+
9+
* [Flow](./flow.md "DataWorks 通用的工作流描述规范")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json`
10+
11+
* [Function](./function.md "定义工作流节点使用的UDF")`https://dataworks.data.aliyun.com/schemas/1.1.0/script.schema.json`
12+
13+
* [Node](./node.md "工作流节点的定义描述")`https://dataworks.data.aliyun.com/schemas/1.1.0/node.schema.json`
14+
15+
* [RuntimeResource](./runtimeresource.md "节点的运行时资源定义或引用")`https://dataworks.data.aliyun.com/schemas/1.1.0/runtimeResource.schema.json`
16+
17+
* [Script](./script.md "节点所需的脚本定义或者引用")`https://dataworks.data.aliyun.com/schemas/1.1.0/script.schema.json`
18+
19+
* [Trigger](./trigger.md "定义了工作流的触发器")`https://dataworks.data.aliyun.com/schemas/1.1.0/trigger.schema.json`
20+
21+
## Other Schemas
22+
23+
### Objects
24+
25+
* [Artifact.NodeOutput](./artifact-artifactnodeoutput.md "节点使用的上游节点的预定义输出")`https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/nodeOutput`
26+
27+
* [Artifact.Table](./artifact-artifacttable.md "节点使用的上游产出表")`https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/table`
28+
29+
* [Artifact.Variable](./artifact-artifactvariable.md "Variable定义了工作流的变量, Variable可以被在工作流节点中引用")`https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/variable`
30+
31+
* [Flow.Metedata](./flow-properties-flowmetedata.md "定义工作流的扩展元信息")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/metadata`
32+
33+
* [Flow.WorkflowSpec](./flow-properties-flowworkflowspec.md "Workflow 的 Spec 定义")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec`
34+
35+
* [Flow.WorkflowSpec.Edge](./flow-properties-flowworkflowspec-properties-flowworkflowspecedges-flowworkflowspecedge.md)`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec/properties/flow/items`
36+
37+
* [Flow.WorkflowSpec.Edge.NodeDepend](./flow-properties-flowworkflowspec-properties-flowworkflowspecedges-flowworkflowspecedge-properties-flowworkflowspecedgenodedepends-flowworkflowspecedgenodedepend.md)`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec/properties/flow/items/properties/depends/items`
38+
39+
* [Node.InputArtifact](./node-properties-nodeinputartifact.md "节点的输入")`https://dataworks.data.aliyun.com/schemas/1.1.0/node.schema.json#/properties/inputs`
40+
41+
* [Node.OutputArtifact](./node-properties-nodeoutputartifact.md "输出定义了工作流节点的产出信息")`https://dataworks.data.aliyun.com/schemas/1.1.0/node.schema.json#/properties/outputs`
42+
43+
* [Script.Runtime](./script-properties-scriptruntime.md "脚本语言")`https://dataworks.data.aliyun.com/schemas/1.1.0/script.schema.json#/properties/runtime`
44+
45+
### Arrays
46+
47+
* [Flow.WorkflowSpec.Artifacts](./flow-properties-flowworkflowspec-properties-flowworkflowspecartifacts.md "定义工作流的变量")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec/properties/artifacts`
48+
49+
* [Flow.WorkflowSpec.Edge.NodeDepends](./flow-properties-flowworkflowspec-properties-flowworkflowspecedges-flowworkflowspecedge-properties-flowworkflowspecedgenodedepends.md "节点的唯一标识符,全局唯一,用于标识工作流中的节点")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec/properties/flow/items/properties/depends`
50+
51+
* [Flow.WorkflowSpec.Edges](./flow-properties-flowworkflowspec-properties-flowworkflowspecedges.md "工作流节点之间的依赖关系")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec/properties/flow`
52+
53+
* [Flow.WorkflowSpec.FileResources](./flow-properties-flowworkflowspec-properties-flowworkflowspecfileresources.md "文件资源列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec/properties/fileResources`
54+
55+
* [Flow.WorkflowSpec.Functions](./flow-properties-flowworkflowspec-properties-flowworkflowspecfunctions.md "函数定义列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec/properties/functions`
56+
57+
* [Flow.WorkflowSpec.Nodes](./flow-properties-flowworkflowspec-properties-flowworkflowspecnodes.md "任务节点列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec/properties/nodes`
58+
59+
* [Flow.WorkflowSpec.RuntimeResources](./flow-properties-flowworkflowspec-properties-flowworkflowspecruntimeresources.md "运行时资源定义列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec/properties/runtimeResources`
60+
61+
* [Flow.WorkflowSpec.Scripts](./flow-properties-flowworkflowspec-properties-flowworkflowspecscripts.md "定义工作流的变量")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec/properties/scripts`
62+
63+
* [Flow.WorkflowSpec.Triggers](./flow-then-properties-spec-properties-flowworkflowspectriggers.md "周期调度定义列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/then/properties/spec/properties/triggers`
64+
65+
* [Flow.WorkflowSpec.Variables](./flow-properties-flowworkflowspec-properties-flowworkflowspecvariables.md "定义工作流的变量")`https://dataworks.data.aliyun.com/schemas/1.1.0/flow.schema.json#/properties/spec/properties/variables`
66+
67+
* [Node.FileResources](./node-properties-nodefileresources.md "节点所需的文件资源定义或者引用")`https://dataworks.data.aliyun.com/schemas/1.1.0/node.schema.json#/properties/fileResources`
68+
69+
* [Node.Functions](./node-properties-nodefunctions.md "节点所需的函数定义或者引用")`https://dataworks.data.aliyun.com/schemas/1.1.0/node.schema.json#/properties/functions`
70+
71+
* [Node.InputArtifact.NodeOutputs](./node-properties-nodeinputartifact-properties-nodeinputartifactnodeoutputs.md "节点使用的上游节点的预定义输出列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/node.schema.json#/properties/inputs/properties/nodeOutputs`
72+
73+
* [Node.InputArtifact.Tables](./node-properties-nodeinputartifact-properties-nodeinputartifacttables.md "节点使用的上游产出表列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/node.schema.json#/properties/inputs/properties/tables`
74+
75+
* [Node.InputArtifact.Variables](./node-properties-nodeinputartifact-properties-nodeinputartifactvariables.md "节点依赖的变量Variable列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/node.schema.json#/properties/inputs/properties/variables`
76+
77+
* [Node.OutputArtifact.NodeOutputs](./node-properties-nodeoutputartifact-properties-nodeoutputartifactnodeoutputs.md "节点使用的上游节点的预定义输出列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/node.schema.json#/properties/outputs/properties/nodeOutputs`
78+
79+
* [Node.OutputArtifact.Tables](./node-properties-nodeoutputartifact-properties-nodeoutputartifacttables.md "节点使用的上游产出表列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/node.schema.json#/properties/outputs/properties/tables`
80+
81+
* [Node.OutputArtifact.Variables](./node-properties-nodeoutputartifact-properties-nodeoutputartifactvariables.md "节点依赖的变量Variable列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/node.schema.json#/properties/outputs/properties/variables`
82+
83+
* [Script.Parameters](./script-properties-scriptparameters.md "脚本参数列表")`https://dataworks.data.aliyun.com/schemas/1.1.0/script.schema.json#/properties/parameters`
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Output Schema
2+
3+
```txt
4+
https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/nodeOutput/properties/output
5+
```
6+
7+
节点调度输出标识
8+
9+
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
10+
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------ |
11+
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [artifact.schema.json\*](../../out/artifact.schema.json "open original schema") |
12+
13+
## output Type
14+
15+
`string` ([Output](artifact-artifactnodeoutput-properties-output.md))
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Artifact.NodeOutput Schema
2+
3+
```txt
4+
https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/nodeOutput
5+
```
6+
7+
节点使用的上游节点的预定义输出
8+
9+
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
10+
| :------------------ | :--------- | :------------- | :----------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------ |
11+
| Can be instantiated | No | Unknown status | No | Forbidden | Allowed | none | [artifact.schema.json\*](../../out/artifact.schema.json "open original schema") |
12+
13+
## nodeOutput Type
14+
15+
`object` ([Artifact.NodeOutput](artifact-artifactnodeoutput.md))
16+
17+
# nodeOutput Properties
18+
19+
| Property | Type | Required | Nullable | Defined by |
20+
| :---------------- | :------- | :------- | :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21+
| [output](#output) | `string` | Required | cannot be null | [Artifact](artifact-artifactnodeoutput-properties-output.md "https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/nodeOutput/properties/output") |
22+
23+
## output
24+
25+
节点调度输出标识
26+
27+
`output`
28+
29+
* is required
30+
31+
* Type: `string` ([Output](artifact-artifactnodeoutput-properties-output.md))
32+
33+
* cannot be null
34+
35+
* defined in: [Artifact](artifact-artifactnodeoutput-properties-output.md "https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/nodeOutput/properties/output")
36+
37+
### output Type
38+
39+
`string` ([Output](artifact-artifactnodeoutput-properties-output.md))
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Guid Schema
2+
3+
```txt
4+
https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/table/properties/guid
5+
```
6+
7+
产出表唯一标识符
8+
9+
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
10+
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------ |
11+
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [artifact.schema.json\*](../../out/artifact.schema.json "open original schema") |
12+
13+
## guid Type
14+
15+
`string` ([Guid](artifact-artifacttable-properties-guid.md))
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Artifact.Table Schema
2+
3+
```txt
4+
https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/table
5+
```
6+
7+
节点使用的上游产出表
8+
9+
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
10+
| :------------------ | :--------- | :------------- | :----------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------ |
11+
| Can be instantiated | No | Unknown status | No | Forbidden | Allowed | none | [artifact.schema.json\*](../../out/artifact.schema.json "open original schema") |
12+
13+
## table Type
14+
15+
`object` ([Artifact.Table](artifact-artifacttable.md))
16+
17+
# table Properties
18+
19+
| Property | Type | Required | Nullable | Defined by |
20+
| :------------ | :------- | :------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- |
21+
| [guid](#guid) | `string` | Required | cannot be null | [Artifact](artifact-artifacttable-properties-guid.md "https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/table/properties/guid") |
22+
23+
## guid
24+
25+
产出表唯一标识符
26+
27+
`guid`
28+
29+
* is required
30+
31+
* Type: `string` ([Guid](artifact-artifacttable-properties-guid.md))
32+
33+
* cannot be null
34+
35+
* defined in: [Artifact](artifact-artifacttable-properties-guid.md "https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/table/properties/guid")
36+
37+
### guid Type
38+
39+
`string` ([Guid](artifact-artifacttable-properties-guid.md))
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Untitled string in Artifact Schema
2+
3+
```txt
4+
https://dataworks.data.aliyun.com/schemas/1.1.0/artifact.schema.json#/variable/properties/id
5+
```
6+
7+
唯一标识
8+
9+
| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
10+
| :------------------ | :--------- | :------------- | :---------------------- | :---------------- | :-------------------- | :------------------ | :------------------------------------------------------------------------------ |
11+
| Can be instantiated | No | Unknown status | Unknown identifiability | Forbidden | Allowed | none | [artifact.schema.json\*](../../out/artifact.schema.json "open original schema") |
12+
13+
## id Type
14+
15+
`string`

0 commit comments

Comments
 (0)