-
Notifications
You must be signed in to change notification settings - Fork 48
(DOCS) Add reference docs for expected resource operations stdout #1016
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
Open
michaeltlombardi
wants to merge
4
commits into
PowerShell:main
Choose a base branch
from
michaeltlombardi:docs/main/output-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2b3ce80
(DOCS) Fix docs for resource kind
michaeltlombardi a321e86
(DOCS) Add resource capabilities reference doc
michaeltlombardi be13fcd
(DOCS) Update reference for kind and capabilities
michaeltlombardi 2aae198
(DOCS) Reference for expected resource operations stdout
michaeltlombardi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
docs/reference/schemas/definitions/resourceCapabilities.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
description: JSON schema reference for resource capabilities | ||
ms.date: 07/03/2025 | ||
ms.topic: reference | ||
title: DSC Resource capabilities schema reference | ||
--- | ||
|
||
# DSC Resource capabilities schema reference | ||
|
||
## Synopsis | ||
|
||
Defines the operations you can invoke for a resource and how the resource behaves when invoked. | ||
|
||
## Metadata | ||
|
||
```yaml | ||
SchemaDialect: https://json-schema.org/draft/2020-12/schema | ||
SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/definitions/resourceKind.json | ||
Type: array | ||
Required: true | ||
ItemsMustBeUnique: true | ||
ItemsType: string | ||
ItemsValidValues: [ | ||
get, | ||
set, | ||
setHandlesExist, | ||
whatIf, | ||
test, | ||
delete, | ||
export, | ||
resolve | ||
] | ||
``` | ||
|
||
## Description | ||
|
||
DSC resources always have at least one capability. Resource capabilities define the operations you | ||
can invoke for a resource and how the resource behaves when invoked. | ||
|
||
DSC resources may have the following capabilities: | ||
|
||
- `get` - The resource can retrieve the current state of an instance. | ||
- `set` - The resource can enforce the desired state for an instance. | ||
- `setHandlesExist` - The resource handles deleting an instance during a **Set** operation. | ||
- `whatIf` - The resource can report how it would change state for an instance during a **Set** operation. | ||
- `test` - The resource implements the **Test** operation and doesn't rely on synthetic testing. | ||
- `delete` - The resource can remove an instance. | ||
- `export` - The resource can enumerate every instance. | ||
- `resolve` - The resource can resolve nested instances from an external source. | ||
|
||
For more information about resource capabilities, see [DSC resource capabilities][01]. For more | ||
information about the operations you can invoke for a resource, see [DSC resource operations][02]. | ||
|
||
[01]: ../../../concepts/resources/capabilities.md | ||
[02]: ../../../concepts/resources/operations.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
description: JSON schema reference for the expected stdout from the delete resource operation | ||
ms.date: 02/28/2025 | ||
ms.topic: reference | ||
title: DSC resource delete operation stdout schema reference | ||
--- | ||
|
||
# DSC resource delete operation stdout schema reference | ||
|
||
## Synopsis | ||
|
||
DSC doesn't expect the **Delete** operation for a resource to return any JSON to stdout. | ||
|
||
## Metadata | ||
|
||
```yaml | ||
SchemaDialect: https://json-schema.org/draft/2020-12/schema | ||
SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/resource/stdout/delete.json | ||
Type: 'null' | ||
``` | ||
|
||
## Description | ||
|
||
DSC resources that implement the **Delete** operation shouldn't emit any data to stdout. DSC | ||
doesn't expect any output for the **Delete** operation and ignores any data emitted to stdout when | ||
invoking the operation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
description: JSON schema reference for the expected stdout from the export resource operation | ||
ms.date: 07/29/2025 | ||
ms.topic: reference | ||
title: DSC resource export operation stdout schema reference | ||
--- | ||
|
||
# DSC resource export operation stdout schema reference | ||
|
||
## Synopsis | ||
|
||
Represents the actual state of a resource instance in DSC. DSC expects every JSON Line emitted to | ||
stdout for the **Export** operation to adhere to this schema. | ||
|
||
## Metadata | ||
|
||
```yaml | ||
SchemaDialect: https://json-schema.org/draft/2020-12/schema | ||
SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/resource/stdout/export.json | ||
Type: object | ||
``` | ||
|
||
## Description | ||
|
||
DSC expects a resource implementing the **Export** operation to return a series of JSON Lines. | ||
|
||
The data that DSC expects depends on whether the resource kind is defined as `exporter`: | ||
|
||
- When the resource kind is `exporter`, DSC expects the resource to return JSON Lines representing | ||
DSC resource instance definitions to recursively export. | ||
- When the resource kind isn't `exporter`, DSC expects the resource to return JSON Lines | ||
representing the actual state of every instance of the resource on the system. | ||
|
||
## Typical resource expected output | ||
|
||
DSC expects a typical resource implementing the **Export** operation to return a series of JSON | ||
Lines. | ||
|
||
Each JSON Line represents the actual state of a resource instance in DSC. DSC expects every JSON | ||
Line emitted to stdout for the **Export** operation to adhere to this schema. | ||
michaeltlombardi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
The output must be a JSON object. The object must be a valid representation of an instance of the | ||
resource. | ||
|
||
Command resources define their instance schema with the [schema.command][01] or | ||
[schema.embedded][02] fields in their resource manifest. If a command resource returns JSON that is | ||
invalid against the resource instance schema, DSC raises an error. | ||
|
||
Adapted resource instances are validated by their adapter when the adapter invokes them. | ||
|
||
## Exporter resource expected output | ||
|
||
DSC expects an exporter resource (one with the [kind][03] field in its manifest set to `exporter`) | ||
to return a series of JSON Lines. | ||
|
||
Each JSON Line represents a DSC resource instance definition to recursively invoke the **Export** | ||
operation for. DSC expects every JSON Line emitted to stdout for the **Export** operation to adhere | ||
to this schema. | ||
|
||
The output must be a JSON object adhering to [DSC resource instance][04] schema, rather than the | ||
instance schema for a specific resource. DSC expects the object to define at least the [name][05] | ||
and [type][06] fields. If the object defines the [properties][07] field, DSC passes those | ||
properties to the resource when recursively exporting it so that the resource may filter the | ||
exported instance results. | ||
|
||
<!-- Reference link definitions --> | ||
[01]: ../manifest/schema/property.md | ||
[02]: ../manifest/schema/embedded.md | ||
[03]: ../manifest/root.md#kind | ||
[04]: ../../config/resource.md | ||
[05]: ../../config/resource.md#name | ||
[06]: ../../config/resource.md#type | ||
[07]: ../../config/resource.md#properties-1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
description: JSON schema reference for the expected stdout from the get resource operation | ||
ms.date: 07/29/2025 | ||
ms.topic: reference | ||
title: DSC resource get operation stdout schema reference | ||
--- | ||
|
||
# DSC resource get operation stdout schema reference | ||
|
||
## Synopsis | ||
|
||
Represents the actual state of a resource instance in DSC. DSC expects the JSON Line emitted to | ||
michaeltlombardi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
stdout for the **Get** operation to adhere to this schema. | ||
|
||
## Metadata | ||
|
||
```yaml | ||
SchemaDialect: https://json-schema.org/draft/2020-12/schema | ||
SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.1.0/resource/stdout/get.json | ||
Type: object | ||
``` | ||
|
||
## Description | ||
|
||
Represents the actual state of a resource instance in DSC. DSC expects the JSON Line emitted to | ||
stdout for the **Get** operation to adhere to this schema. | ||
|
||
The output must be a JSON object. The object must be a valid representation of an instance of the | ||
resource. | ||
|
||
Command resources define their instance schema with the [schema.command][01] or | ||
[schema.embedded][02] fields in their resource manifest. If a command resource returns JSON that is | ||
invalid against the resource instance schema, DSC raises an error. | ||
|
||
Adapted resource instances are validated by their adapter when the adapter invokes them. | ||
|
||
<!-- Reference link definitions --> | ||
[01]: ../manifest/schema/property.md | ||
[02]: ../manifest/schema/embedded.md |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.