From 7a613f07a5ce3fb689a2970db697d7d8ecac366c Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Fri, 7 Jul 2023 01:28:05 +0200 Subject: [PATCH] wip --- bundle/schema/openapi.go | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/bundle/schema/openapi.go b/bundle/schema/openapi.go index 6c2944aab..8724a0838 100644 --- a/bundle/schema/openapi.go +++ b/bundle/schema/openapi.go @@ -162,7 +162,7 @@ func (reader *OpenapiReader) jobsDocs() (*Docs, error) { // TODO: add description for id if needed. // Tracked in https://github.com/databricks/cli/issues/242 jobsDocs := &Docs{ - Description: "List of job definations", + Description: "List of Databricks jobs", AdditionalProperties: jobDocs, } return jobsDocs, nil @@ -177,12 +177,25 @@ func (reader *OpenapiReader) pipelinesDocs() (*Docs, error) { // TODO: Two fields in resources.Pipeline have the json tag id. Clarify the // semantics and then add a description if needed. (https://github.com/databricks/cli/issues/242) pipelinesDocs := &Docs{ - Description: "List of pipeline definations", + Description: "List of DLT pipelines", AdditionalProperties: pipelineDocs, } return pipelinesDocs, nil } +func (reader *OpenapiReader) experimentsDocs() (*Docs, error) { + experimentSpecSchema, err := reader.readResolvedSchema(SchemaPathPrefix + "ml.Experiment") + if err != nil { + return nil, err + } + experimentDocs := schemaToDocs(experimentSpecSchema) + experimentsDocs := &Docs{ + Description: "List of MLflow experiments", + AdditionalProperties: experimentDocs, + } + return experimentsDocs, nil +} + func (reader *OpenapiReader) ResourcesDocs() (*Docs, error) { jobsDocs, err := reader.jobsDocs() if err != nil { @@ -192,12 +205,17 @@ func (reader *OpenapiReader) ResourcesDocs() (*Docs, error) { if err != nil { return nil, err } + experimentsDocs, err := reader.experimentsDocs() + if err != nil { + return nil, err + } return &Docs{ - Description: "Specification of databricks resources to instantiate", + Description: "Collection of Databricks resources to deploy.", Properties: map[string]*Docs{ - "jobs": jobsDocs, - "pipelines": pipelinesDocs, + "jobs": jobsDocs, + "pipelines": pipelinesDocs, + "experiments": experimentsDocs, }, }, nil }