Skip to content

Commit 0f5bb6a

Browse files
(SCHEMA) Add extension manifest to schema source
1 parent 14b066c commit 0f5bb6a

File tree

4 files changed

+682
-0
lines changed

4 files changed

+682
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema
2+
$schema: https://json-schema.org/draft/2020-12/schema
3+
$id: <HOST>/<PREFIX>/<VERSION>/definitions/extensionType.yaml
4+
5+
title: DSC extension fully qualified type name
6+
description: |
7+
The namespaced name of the DSC extension, using the syntax:
8+
9+
owner[.group][.area]/name
10+
11+
For example:
12+
13+
- Microsoft.DSC/Docs
14+
- Microsoft.Windows.Appx/Discover
15+
16+
type: string
17+
pattern: ^\w+(\.\w+){0,2}\/\w+$
18+
19+
# VS Code only
20+
markdownDescription: |
21+
***
22+
[_Online Documentation_][01]
23+
***
24+
25+
The namespaced name of the DSC extension, using the syntax:
26+
27+
```yaml
28+
owner[.group][.area]/name
29+
```
30+
31+
For example:
32+
33+
- `Microsoft.DSC/Docs`
34+
- `Microsoft.Windows.Appx/Discover`
35+
36+
[01]: <DOCS_BASE_URL>/reference/schemas/definitions/extensiontype?<DOCS_VERSION_PIN>
37+
patternErrorMessage: |
38+
Invalid type name. Valid extension type names always define an owner and a name separated by a
39+
slash, like `Microsoft/Example`. Type names may optionally include a group and area to namespace
40+
the extension under the owner, like `Microsoft.Windows.Appx/Discover`.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema
2+
$schema: https://json-schema.org/draft/2020-12/schema
3+
$id: <HOST>/<PREFIX>/<VERSION>/extension/manifest.discover.yaml
4+
5+
title: Get Method
6+
description: >-
7+
Defines how DSC must call the DSC extension to discover the paths to resource manifests.
8+
markdownDescription: | # VS Code only
9+
***
10+
[_Online Documentation_][00]
11+
***
12+
13+
Defines how DSC must call the DSC extension to discover the paths to resource manifests. An
14+
extension that defines this field in its manifest has the `discover` capability.
15+
16+
By default, DSC only discovers resource manifests in the `PATH` environment variable. If the
17+
`DSC_RESOURCE_PATH` environment variable is defined, DSC searches those paths for resource
18+
manifests instead.
19+
20+
If initial discovery finds any extension manifests that have the `discover` capability, DSC uses
21+
those extensions to recursively discover resources that aren't available in `PATH` or
22+
`DSC_RESOURCE_PATH`.
23+
24+
For more information about the output DSC expects the extension to emit for this command, see
25+
[Discover extension operation stdout][01].
26+
27+
[00]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/discover?<DOCS_VERSION_PIN>
28+
[00]: <DOCS_BASE_URL>/reference/schemas/extension/stdout/discover?<DOCS_VERSION_PIN>
29+
30+
type: object
31+
required:
32+
- executable
33+
properties:
34+
executable:
35+
$ref: /<PREFIX>/<VERSION>/definitions/commandExecutable.yaml
36+
markdownDescription: |
37+
***
38+
[_Online Documentation_][01]
39+
***
40+
41+
Defines the name of the command to run. The value must be the name of a command discoverable
42+
in the system's `PATH` environment variable or the full path to the command. A file extension
43+
is only required when the command isn't recognizable by the operating system as an
44+
executable.
45+
46+
[01]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/discover?<DOCS_VERSION_PIN>#executable
47+
args:
48+
$ref: /<PREFIX>/<VERSION>/definitions/commandArgs.yaml
49+
markdownDescription: |
50+
***
51+
[_Online Documentation_][01]
52+
***
53+
54+
Defines an array of strings to pass as arguments to the command. DSC passes the arguments to
55+
the command in the order they're specified.
56+
57+
For example, the given the following definition:
58+
59+
```json
60+
{
61+
"executable": "myextension",
62+
"args": ["discover", "--all"],
63+
}
64+
```
65+
66+
DSC invokes the command for the resource as:
67+
68+
```bash
69+
myextension discover --all
70+
```
71+
72+
[01]: <DOCS_BASE_URL>/reference/schemas/extension/manifest/discover?<DOCS_VERSION_PIN>#args
73+
74+
defaultSnippets: # VS Code only
75+
- label: ' Define without arguments'
76+
markdownDescription: |
77+
Define the `discover` command for the extension when no arguments are required.
78+
body:
79+
executable: ${2:executable_name}
80+
- label: ' Define with arguments'
81+
markdownDescription: |-
82+
Define the `discover` command for the extension when at least one argument is required.
83+
body:
84+
executable: ${2:executable_name}
85+
args:
86+
- ${3:--first-argument}

0 commit comments

Comments
 (0)