mirror of https://github.com/databricks/cli.git
Update inline JSON schema documentation (#557)
## Changes Add docs for experiments and models to the json schema. Update the schema to the latest openapi spec. ## Tests Manually
This commit is contained in:
parent
b6665f4b30
commit
057f328879
File diff suppressed because it is too large
Load Diff
|
@ -162,7 +162,7 @@ func (reader *OpenapiReader) jobsDocs() (*Docs, error) {
|
||||||
// TODO: add description for id if needed.
|
// TODO: add description for id if needed.
|
||||||
// Tracked in https://github.com/databricks/cli/issues/242
|
// Tracked in https://github.com/databricks/cli/issues/242
|
||||||
jobsDocs := &Docs{
|
jobsDocs := &Docs{
|
||||||
Description: "List of job definations",
|
Description: "List of Databricks jobs",
|
||||||
AdditionalProperties: jobDocs,
|
AdditionalProperties: jobDocs,
|
||||||
}
|
}
|
||||||
return jobsDocs, nil
|
return jobsDocs, nil
|
||||||
|
@ -177,12 +177,38 @@ func (reader *OpenapiReader) pipelinesDocs() (*Docs, error) {
|
||||||
// TODO: Two fields in resources.Pipeline have the json tag id. Clarify the
|
// 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)
|
// semantics and then add a description if needed. (https://github.com/databricks/cli/issues/242)
|
||||||
pipelinesDocs := &Docs{
|
pipelinesDocs := &Docs{
|
||||||
Description: "List of pipeline definations",
|
Description: "List of DLT pipelines",
|
||||||
AdditionalProperties: pipelineDocs,
|
AdditionalProperties: pipelineDocs,
|
||||||
}
|
}
|
||||||
return pipelinesDocs, nil
|
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) modelsDocs() (*Docs, error) {
|
||||||
|
modelSpecSchema, err := reader.readResolvedSchema(SchemaPathPrefix + "ml.Model")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
modelDocs := schemaToDocs(modelSpecSchema)
|
||||||
|
modelsDocs := &Docs{
|
||||||
|
Description: "List of MLflow models",
|
||||||
|
AdditionalProperties: modelDocs,
|
||||||
|
}
|
||||||
|
return modelsDocs, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (reader *OpenapiReader) ResourcesDocs() (*Docs, error) {
|
func (reader *OpenapiReader) ResourcesDocs() (*Docs, error) {
|
||||||
jobsDocs, err := reader.jobsDocs()
|
jobsDocs, err := reader.jobsDocs()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -192,12 +218,22 @@ func (reader *OpenapiReader) ResourcesDocs() (*Docs, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
experimentsDocs, err := reader.experimentsDocs()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
modelsDocs, err := reader.modelsDocs()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
return &Docs{
|
return &Docs{
|
||||||
Description: "Specification of databricks resources to instantiate",
|
Description: "Collection of Databricks resources to deploy.",
|
||||||
Properties: map[string]*Docs{
|
Properties: map[string]*Docs{
|
||||||
"jobs": jobsDocs,
|
"jobs": jobsDocs,
|
||||||
"pipelines": pipelinesDocs,
|
"pipelines": pipelinesDocs,
|
||||||
|
"experiments": experimentsDocs,
|
||||||
|
"models": modelsDocs,
|
||||||
},
|
},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue