Skip to content

Commit 0be26bd

Browse files
(DOCS) Update reference for kind and capabilities
This change updates the `dsc resource list` output reference and the manifest root reference to reflect the updates to `kind` and `capabilities`.
1 parent 4c8e08b commit 0be26bd

File tree

2 files changed

+27
-88
lines changed

2 files changed

+27
-88
lines changed

docs/reference/schemas/outputs/resource/list.md

Lines changed: 20 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -79,70 +79,22 @@ Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z
7979

8080
### capabilities
8181

82-
Defines the operations and behaviors the resource is implemented to support. This property is an
83-
array of capabilities. Resources always have the `Get` capability, but the other capabilities are
84-
optional and depend on the resource.
85-
86-
The following list describes the available capabilities for a resource:
87-
88-
- <a id="capability-get" ></a> `get` - The resource supports retrieving the current state of an
89-
instance. All DSC Resources must have this capability. A resource has this capability when it
90-
defines the mandatory [get][07] property in its resource manifest.
91-
- <a id="capability-set" ></a> `set` - The resource supports enforcing the desired state of an
92-
instance. A resource has this capability when it defines the [set][08] property in its resource
93-
manifest. Resources without this capability can't be used with the [dsc resource set][09] or
94-
[dsc config set][10] commands unless they're in a Microsoft.DSC/Assertion group as a nested
95-
instance.
96-
- <a id="capability-sethandlesexist" ></a> `setHandlesExist` - The resource supports the
97-
[_exist property][11] directly. A resource has this capability when it defines the
98-
[handlesExist][12] property as `true` in the definition of the [set][08] command property in its
99-
resource manifest.
100-
101-
When a resource has this capability, the `_exist` property is part of the resource's instance
102-
schema and the resource handles deleting instances of the resource in its `set` command.
103-
104-
When a resource doesn't have this capability, when DSC finds an instance of the resource with
105-
`_exist` set to `false`, it handles calling the [delete][13] operation for the resource.
106-
107-
If the resource doesn't have this capability or the `delete` capability, DSC raises an error when
108-
an instance defines `_exist` as `false`.
109-
- <a id="capability-whatif" ></a> `whatIf` - The resource supports returning explicit information
110-
about how it will modify state when a user calls [dsc config set][10] with the [--what-if][14]
111-
option. A resource has this capability when it defines the [What-if operation][15] in its
112-
resource manifest.
113-
114-
When a resource has this capability, DSC calls the defined command with its arguments when a
115-
user executes the `dsc config set` command with the `--what-if` option.
116-
117-
When a resource doesn't have this capability, DSC synthesizes how the resource will change and
118-
instance by converting the `Test` result for the instance into a `Set` result. The synthetic
119-
operation can't indicate potential issues or changes that can't be determined by comparing the
120-
result of the `Test` operation against the resource's desired state. For example, the credentials
121-
used to test a resource might be valid for that operation, but not have permissions to actually
122-
modify the system state. Only a resource with this capability can fully report whether and how
123-
the resource will change system state.
124-
- <a id="capability-test" ></a> `test` - The resource supports validating the desired state of an
125-
instance against the current state of the instance. A resource has this capability when it
126-
defines the [test][16] property in its resource manifest.
127-
128-
If a resource doesn't have the `test` capability, DSC uses a synthetic test for instances of the
129-
resource. The synthetic test compares each property for the desired state of an instance against
130-
the actual state. The synthetic test uses strict, case-sensitive equivalence. If the desired
131-
state for a property and the actual state aren't the same, DSC marks the property as out of the
132-
desired state.
133-
- <a id="capability-delete" ></a> `delete` - The resource supports removing an instance. A resource
134-
has this capability when it defines the [delete][13] property in its resource manifest. This
135-
capability isn't mutually exclusive with the `setHandlesExist` property. A resource can handle
136-
the `_exist` property in set operations and be called directly with [dsc resource delete][17] to
137-
remove an instance.
138-
- <a id="capability-export" ></a> `export` - The resource supports enumerating every instance of
139-
the resource. A resource has this capability when it defines the [export][18] property in its
140-
resource manifest. Only resources with this capability are usable with the
141-
[dsc resource export][19] and [dsc config export][20] commands.
142-
- <a id="capability-resolve" ></a> `resolve` - The resource supports resolving nested resource
143-
instances from an external source. A resource has this capability when it defines the
144-
[resolve][21] property in its resource manifest. This functionality is primarily used by
145-
[importer resources][22].
82+
DSC resources always have at least one capability. Resource capabilities define the operations you
83+
can invoke for a resource and how the resource behaves when invoked.
84+
85+
DSC resources may have the following capabilities:
86+
87+
- `get` - The resource can retrieve the current state of an instance.
88+
- `set` - The resource can enforce the desired state for an instance.
89+
- `setHandlesExist` - The resource handles deleting an instance during a **Set** operation.
90+
- `whatIf` - The resource can report how it would change state for an instance during a **Set** operation.
91+
- `test` - The resource implements the **Test** operation and doesn't rely on synthetic testing.
92+
- `delete` - The resource can remove an instance.
93+
- `export` - The resource can enumerate every instance.
94+
- `resolve` - The resource can resolve nested instances from an external source.
95+
96+
For more information about resource capabilities, see [DSC resource capabilities][07]. For more
97+
information about the operations you can invoke for a resource, see [DSC resource operations][08].
14698

14799
```yaml
148100
Type: array
@@ -239,7 +191,7 @@ Required: true
239191

240192
Represents the values defined in the resource's manifest. This value is `null` for resources that
241193
aren't command-based. For more information on the value for this property, see
242-
[Command-based DSC Resource manifest schema reference][23].
194+
[Command-based DSC Resource manifest schema reference][09].
243195

244196
```yaml
245197
Type: [object, 'null']
@@ -253,20 +205,6 @@ Required: true
253205
[04]: ../../definitions/resourceKind.md#group-resources
254206
[05]: ../../resource/manifest/root.md#kind
255207
[06]: ../../definitions/resourceKind.md
256-
[07]: ../../resource/manifest/get.md
257-
[08]: ../../resource/manifest/set.md
258-
[09]: ../../../cli/resource/set.md
259-
[10]: ../../../cli/config/set.md
260-
[11]: ../../resource/properties/exist.md
261-
[12]: ../../resource/manifest/set.md#handlesexist
262-
[13]: ../../resource/manifest/delete.md
263-
[14]: ../../../cli/config/set.md#-w---what-if
264-
[15]: ../../resource/manifest/whatif.md
265-
[16]: ../../resource/manifest/test.md
266-
[17]: ../../../cli/resource/delete.md
267-
[18]: ../../resource/manifest/export.md
268-
[19]: ../../../cli/resource/export.md
269-
[20]: ../../../cli/config/export.md
270-
[21]: ../../resource/manifest/resolve.md
271-
[22]: ../../definitions/resourceKind.md#importer-resources
272-
[23]: ../../resource/manifest/root.md
208+
[07]: ../../../../concepts/resources/capabilities.md
209+
[08]: ../../../../concepts/resources/operations.md
210+
[09]: ../../resource/manifest/root.md

docs/reference/schemas/resource/manifest/root.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,23 +166,24 @@ Required: false
166166

167167
### kind
168168

169-
The `kind` property defines how DSC should handle the resource. DSC supports three kinds of
170-
command-based DSC Resources: `Resource`, `Group`, and `Adapter`.
169+
The `kind` property defines how DSC should handle the resource. DSC supports several kinds
170+
ofcommand-based DSC Resources: `resource`, `group`, `adapter`, `importer`, and `exporter`.
171171

172172
When `kind` isn't defined in the resource manifest, DSC infers the value for the property. If the
173173
`adapter` property is defined in the resource manifest, DSC infers the value of `kind` as
174-
`Adapter`. If the `adapter` property isn't defined, DSC infers the value of `kind` as `Resource`.
175-
DSC can't infer whether a manifest is for a group resource.
174+
`adapter`. If the `adapter` property isn't defined, DSC infers the value of `kind` as `resource`.
175+
DSC can't infer whether a manifest is for a `group` or `importer` resource.
176176

177177
When defining a group resource, always explicitly define the `kind` property in the manifest as
178-
`Group`.
178+
`group`. When defining an importer resource, always explicitly define the `kind` property in the
179+
manifest as `importer`.
179180

180181
For more information, see [DSC Resource kind schema reference][02].
181182

182183
```yaml
183184
Type: string
184185
Required: false
185-
ValidValues: [Resource, Adapter, Group]
186+
ValidValues: [resource, adapter, group, importer, exporter]
186187
```
187188

188189
### tags

0 commit comments

Comments
 (0)