Skip to content

(SCHEMA) Update schemas for v3.1.0 release #890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
414 changes: 414 additions & 0 deletions schemas/src/config/document.yaml

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions schemas/src/definitions/extensionType.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema
$schema: https://json-schema.org/draft/2020-12/schema
$id: <HOST>/<PREFIX>/<VERSION>/definitions/extensionType.yaml

title: DSC extension fully qualified type name
description: |
The namespaced name of the DSC extension, using the syntax:

owner[.group][.area]/name

For example:

- Microsoft.DSC/Docs
- Microsoft.Windows.Appx/Discover

type: string
pattern: ^\w+(\.\w+){0,2}\/\w+$

# VS Code only
markdownDescription: |
***
[_Online Documentation_][01]
***

The namespaced name of the DSC extension, using the syntax:

```yaml
owner[.group][.area]/name
```

For example:

- `Microsoft.DSC/Docs`
- `Microsoft.Windows.Appx/Discover`

[01]: <DOCS_BASE_URL>/reference/schemas/definitions/extensiontype?<DOCS_VERSION_PIN>
patternErrorMessage: |
Invalid type name. Valid extension type names always define an owner and a name separated by a
slash, like `Microsoft/Example`. Type names may optionally include a group and area to namespace
the extension under the owner, like `Microsoft.Windows.Appx/Discover`.
10 changes: 10 additions & 0 deletions schemas/src/definitions/resourceKind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enum:
- adapter
- group
- importer
- exporter

# VS Code only

Expand Down Expand Up @@ -56,3 +57,12 @@ markdownEnumDescriptions:
Indicates that the manifest is for a resource that resolves an external source to DSC
resource instances. DSC processes the resolved instances as nested instances for the importer
resource.
- | # exporter
<!-- force a line break -->

Indicates that the manifest is for a resource that only implements the **Export** operation
to use for inventory and fact-gathering scenarios. For exporter resources, DSC expects the
resource to return one or more resource definitions to recursively export, rather than the
actual state of instances.

For more information about the expected output, see [Export resource operation stdout][02].
86 changes: 86 additions & 0 deletions schemas/src/extensions/manifest.discover.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema
$schema: https://json-schema.org/draft/2020-12/schema
$id: <HOST>/<PREFIX>/<VERSION>/extension/manifest.discover.yaml

title: Get Method
description: >-
Defines how DSC must call the DSC extension to discover the paths to resource manifests.
markdownDescription: | # VS Code only
***
[_Online Documentation_][00]
***

Defines how DSC must call the DSC extension to discover the paths to resource manifests. An
extension that defines this field in its manifest has the `discover` capability.

By default, DSC only discovers resource manifests in the `PATH` environment variable. If the
`DSC_RESOURCE_PATH` environment variable is defined, DSC searches those paths for resource
manifests instead.

If initial discovery finds any extension manifests that have the `discover` capability, DSC uses
those extensions to recursively discover resources that aren't available in `PATH` or
`DSC_RESOURCE_PATH`.

For more information about the output DSC expects the extension to emit for this command, see
[Discover extension operation stdout][01].

[00]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/discover?<DOCS_VERSION_PIN>
[00]: <DOCS_BASE_URL>/reference/schemas/extension/stdout/discover?<DOCS_VERSION_PIN>

type: object
required:
- executable
properties:
executable:
$ref: /<PREFIX>/<VERSION>/definitions/commandExecutable.yaml
markdownDescription: |
***
[_Online Documentation_][01]
***

Defines the name of the command to run. The value must be the name of a command discoverable
in the system's `PATH` environment variable or the full path to the command. A file extension
is only required when the command isn't recognizable by the operating system as an
executable.

[01]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/discover?<DOCS_VERSION_PIN>#executable
args:
$ref: /<PREFIX>/<VERSION>/definitions/commandArgs.yaml
markdownDescription: |
***
[_Online Documentation_][01]
***

Defines an array of strings to pass as arguments to the command. DSC passes the arguments to
the command in the order they're specified.

For example, the given the following definition:

```json
{
"executable": "myextension",
"args": ["discover", "--all"],
}
```

DSC invokes the command for the resource as:

```bash
myextension discover --all
```

[01]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/discover?<DOCS_VERSION_PIN>#args

defaultSnippets: # VS Code only
- label: ' Define without arguments'
markdownDescription: |
Define the `discover` command for the extension when no arguments are required.
body:
executable: ${2:executable_name}
- label: ' Define with arguments'
markdownDescription: |-
Define the `discover` command for the extension when at least one argument is required.
body:
executable: ${2:executable_name}
args:
- ${3:--first-argument}
Loading
Loading