This is an automated email from the ASF dual-hosted git repository.
fanng pushed a commit to branch branch-0.9
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/branch-0.9 by this push:
new 052c118beb [#6974] openapi(lineage): add Lineage openapi (#7045)
052c118beb is described below
commit 052c118bebb20503969d63ec4887957daeb03fc8
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Apr 23 10:40:05 2025 +0800
[#6974] openapi(lineage): add Lineage openapi (#7045)
### What changes were proposed in this pull request?
add Lineage openapi
### Why are the changes needed?
Fix: #6974
### Does this PR introduce _any_ user-facing change?
no
### How was this patch tested?
just document
Co-authored-by: FANNG <[email protected]>
---
docs/open-api/lineage.yaml | 278 +++++++++++++++++++++++++++++++++++++++++++++
docs/open-api/openapi.yaml | 3 +
2 files changed, 281 insertions(+)
diff --git a/docs/open-api/lineage.yaml b/docs/open-api/lineage.yaml
new file mode 100644
index 0000000000..232dca3be5
--- /dev/null
+++ b/docs/open-api/lineage.yaml
@@ -0,0 +1,278 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+---
+
+paths:
+ /lineage:
+ post:
+ summary: Post runEvent
+ description: Updates a run state for a job.
+ operationId: postRunEvent
+ tags:
+ - OpenLineage
+ requestBody:
+ content:
+ application/json:
+ schema:
+ oneOf:
+ - $ref: '#/components/schemas/RunEvent'
+ - $ref: '#/components/schemas/DatasetEvent'
+ - $ref: '#/components/schemas/JobEvent'
+ responses:
+ "200":
+ description: OK
+ "429":
+ description: Too Many Requests
+ "5xx":
+ $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"
+
+components:
+ schemas:
+ BaseEvent:
+ type: object
+ properties:
+ eventTime:
+ description: the time the event occurred at
+ type: string
+ format: date-time
+ producer:
+ description: URI identifying the producer of this metadata. For
example this could be a git url with a given tag or sha
+ type: string
+ format: uri
+ example:
https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client
+ schemaURL:
+ description: The JSON Pointer (https://tools.ietf.org/html/rfc6901)
URL to the corresponding version of the schema definition for this RunEvent
+ type: string
+ format: uri
+ example: https://openlineage.io/spec/0-0-1/OpenLineage.json
+ required:
+ - eventTime
+ - producer
+ - schemaURL
+ BaseFacet:
+ description: all fields of the base facet are prefixed with `_` to avoid
name conflicts in facets.
+ type: object
+ properties:
+ _producer:
+ description: URI identifying the producer of this metadata. For
example this could be a git url with a given tag or sha
+ type: string
+ format: uri
+ example:
https://github.com/OpenLineage/OpenLineage/blob/v1-0-0/client
+ _schemaURL:
+ description: The JSON Pointer (https://tools.ietf.org/html/rfc6901)
URL to the corresponding version of the schema definition for this facet
+ type: string
+ format: uri
+ example:
https://openlineage.io/spec/1-0-2/OpenLineage.json#/$defs/BaseFacet
+ additionalProperties: true
+ required:
+ - _producer
+ - _schemaURL
+ RunFacet:
+ description: A Run Facet
+ type: object
+ allOf:
+ - $ref: '#/components/schemas/BaseFacet'
+ Run:
+ type: object
+ properties:
+ runId:
+ description: The globally unique ID of the run associated with the
job.
+ type: string
+ format: uuid
+ facets:
+ description: The run facets.
+ type: object
+ anyOf:
+ - type: object
+ additionalProperties:
+ $ref: '#/components/schemas/RunFacet'
+ required:
+ - runId
+ JobFacet:
+ description: A Job Facet
+ type: object
+ allOf:
+ - $ref: '#/components/schemas/BaseFacet'
+ - type: object
+ properties:
+ _deleted:
+ description: set to true to delete a facet
+ type: boolean
+ Job:
+ type: object
+ properties:
+ namespace:
+ description: The namespace containing that job
+ type: string
+ example: my-scheduler-namespace
+ name:
+ description: The unique name for that job within that namespace
+ type: string
+ example: myjob.mytask
+ facets:
+ description: The job facets.
+ type: object
+ anyOf:
+ - type: object
+ additionalProperties:
+ $ref: '#/components/schemas/JobFacet'
+ required:
+ - namespace
+ - name
+ DatasetFacet:
+ description: A Dataset Facet
+ type: object
+ allOf:
+ - $ref: '#/components/schemas/BaseFacet'
+ - type: object
+ properties:
+ _deleted:
+ description: set to true to delete a facet
+ type: boolean
+ Dataset:
+ type: object
+ properties:
+ namespace:
+ description: The namespace containing that dataset
+ type: string
+ example: my-datasource-namespace
+ name:
+ description: The unique name for that dataset within that namespace
+ type: string
+ example: instance.schema.table
+ facets:
+ description: The facets for this dataset
+ type: object
+ anyOf:
+ - type: object
+ additionalProperties:
+ $ref: '#/components/schemas/DatasetFacet'
+ required:
+ - namespace
+ - name
+ InputDatasetFacet:
+ description: An Input Dataset Facet
+ type: object
+ allOf:
+ - $ref: '#/components/schemas/BaseFacet'
+ InputDataset:
+ description: An input dataset
+ type: object
+ allOf:
+ - $ref: '#/components/schemas/Dataset'
+ - type: object
+ properties:
+ inputFacets:
+ description: The input facets for this dataset.
+ type: object
+ anyOf:
+ - type: object
+ additionalProperties:
+ $ref: '#/components/schemas/InputDatasetFacet'
+ OutputDatasetFacet:
+ description: An Output Dataset Facet
+ type: object
+ allOf:
+ - $ref: '#/components/schemas/BaseFacet'
+ OutputDataset:
+ description: An output dataset
+ type: object
+ allOf:
+ - $ref: '#/components/schemas/Dataset'
+ - type: object
+ properties:
+ outputFacets:
+ description: The output facets for this dataset
+ type: object
+ anyOf:
+ - type: object
+ additionalProperties:
+ $ref: '#/components/schemas/OutputDatasetFacet'
+ RunEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseEvent'
+ - type: object
+ properties:
+ eventType:
+ description: the current transition of the run state. It is
required to issue 1 START event and 1 of [ COMPLETE, ABORT, FAIL ] event per
run. Additional events with OTHER eventType can be added to the same run. For
example to send additional metadata after the run is complete
+ type: string
+ enum:
+ - START
+ - RUNNING
+ - COMPLETE
+ - ABORT
+ - FAIL
+ - OTHER
+ example: START|RUNNING|COMPLETE|ABORT|FAIL|OTHER
+ run:
+ $ref: '#/components/schemas/Run'
+ job:
+ $ref: '#/components/schemas/Job'
+ inputs:
+ description: The set of **input** datasets.
+ type: array
+ items:
+ $ref: '#/components/schemas/InputDataset'
+ outputs:
+ description: The set of **output** datasets.
+ type: array
+ items:
+ $ref: '#/components/schemas/OutputDataset'
+ required:
+ - run
+ - job
+ StaticDataset:
+ description: A Dataset sent within static metadata events
+ type: object
+ allOf:
+ - $ref: '#/components/schemas/Dataset'
+ DatasetEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseEvent'
+ - type: object
+ properties:
+ dataset:
+ $ref: '#/components/schemas/StaticDataset'
+ required:
+ - dataset
+ not:
+ required:
+ - job
+ - run
+ JobEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseEvent'
+ - type: object
+ properties:
+ job:
+ $ref: '#/components/schemas/Job'
+ inputs:
+ description: The set of **input** datasets.
+ type: array
+ items:
+ $ref: '#/components/schemas/InputDataset'
+ outputs:
+ description: The set of **output** datasets.
+ type: array
+ items:
+ $ref: '#/components/schemas/OutputDataset'
+ required:
+ - job
+ not:
+ required:
+ - run
\ No newline at end of file
diff --git a/docs/open-api/openapi.yaml b/docs/open-api/openapi.yaml
index 4405f13013..47406c4b4d 100644
--- a/docs/open-api/openapi.yaml
+++ b/docs/open-api/openapi.yaml
@@ -170,6 +170,9 @@ paths:
/metalakes/{metalake}/permissions/roles/{role}/{metadataObjectType}/{metadataObjectFullName}/revoke:
$ref:
"./permissions.yaml#/paths/~1metalakes~1%7Bmetalake%7D~1permissions~1roles~1%7Brole%7D~1%7BmetadataObjectType%7D~1%7BmetadataObjectFullName%7D~1revoke"
+ /lineage:
+ $ref: "./lineage.yaml#/paths/~1lineage"
+
components:
schemas: