document
A document resource stores a markdown or HTML report or note in the metastore. Use it to persist and share analysis write-ups about operations, spaces, or a whole project.
Creating a document¶
Create a document from a YAML configuration:
ado create document -f document.yaml
Example markdown configuration (contentType defaults to markdown if omitted):
metadata:
name: Example operation report
description: Summary report for an operation
contentType: markdown
content: |
# Operation report
This is an example document resource.
relatedResources:
- id: operation-test-12345678
role: parent
Example HTML configuration:
metadata:
name: Example HTML report
description: Summary report stored as HTML
contentType: html
content: |
<html><body><h1>Operation report</h1><p>Example HTML body.</p></body></html>
relatedResources:
- id: operation-test-12345678
role: parent
content— body of the document (required).contentType—markdown(default) orhtml.relatedResources— optional list of related ado resources. Each entry has:id— resource identifierroleparent: the report is about this resourcechild: the document outlines the motivation for creating the resource
metadata— optional name, description, and labels.
Validate without persisting:
ado create document -f document.yaml --dry-run
Generate a starter template:
ado template document
Reading a document¶
List or fetch documents:
ado get document
ado get document document-abc12345 -o yaml
ado get document document-abc12345 -o config
Filter by related resource or metadata name (paths are under config.):
ado get document -q 'config.relatedResources.id=operation-test-12345678'
ado get document -q 'config.metadata.name=Example operation report'
Describe a document:
ado describe document document-abc12345
ado describe document document-abc12345 > report.md
Markdown is rendered with rich; HTML is printed as the HTML source. Rich handles terminal vs redirected output.
Deleting a document¶
ado delete document document-abc12345
Editing metadata¶
ado edit document document-abc12345