@@ -13,8 +13,22 @@ Retrieves the current state of resource instances in a configuration document.
13
13
14
14
## Syntax
15
15
16
+ ### Configuration document from stdin
17
+
18
+ ``` sh
19
+ < document-string> | dsc config get [Options]
20
+ ```
21
+
22
+ ### Configuration document from option string
23
+
24
+ ``` sh
25
+ dsc config get [Options] --document < document-string>
26
+ ```
27
+
28
+ ### Configuration document from file
29
+
16
30
``` sh
17
- dsc config get [Options]
31
+ dsc config get [Options] --path < document-filepath >
18
32
```
19
33
20
34
## Description
@@ -23,7 +37,8 @@ The `get` subcommand returns the current state of the resource instances in a co
23
37
document. When this command runs, DSC validates the configuration document before invoking the get
24
38
operation for each resource instance defined in the document.
25
39
26
- The configuration document must be passed to this command as JSON or YAML over stdin.
40
+ The configuration document must be passed to this command as JSON or YAML over stdin, as a string
41
+ with the ** document** option, or from a file with the ** path** option.
27
42
28
43
## Examples
29
44
@@ -60,24 +75,55 @@ cat ./example.dsc.config.yaml | dsc config get
60
75
61
76
### Example 2 - Passing a file to read as the configuration document
62
77
63
- The command uses the [ --input-file ] [ 01 ] global option to retrieve the resource instances defined in
64
- the ` example.dsc.config.yaml ` file.
78
+ The command uses the ** path ** option to retrieve the resource instances defined in the
79
+ ` example.dsc.config.yaml ` file.
65
80
66
81
``` sh
67
- dsc --input-file ./example.dsc.config.yaml config get
82
+ dsc config get --path ./example.dsc.config.yaml
68
83
```
69
84
70
85
### Example 3 - Passing a configuration document as a variable
71
86
72
- The command uses the [ --input ] [ 02 ] global option to retrieve the resource instances defined in a
87
+ The command uses the ** document ** option to retrieve the resource instances defined in a
73
88
configuration document stored in the ` $desired ` variable.
74
89
75
90
``` sh
76
- dsc --input $desired config get
91
+ dsc config get --document $desired
77
92
```
78
93
79
94
## Options
80
95
96
+ ### -d, --document
97
+
98
+ Specifies the configuration document to retrieve actual state for. The document must be a string
99
+ containing a JSON or YAML object. DSC validates the document against the configuration document
100
+ schema. If the validation fails, DSC raises an error.
101
+
102
+ This option can't be used with configuration document over stdin or the ` --path ` option. Choose
103
+ whether to pass the configuration document to the command over stdin, from a file with the ` --path `
104
+ option, or with the ` --document ` option.
105
+
106
+ ``` yaml
107
+ Type : String
108
+ Mandatory : false
109
+ ` ` `
110
+
111
+ ### -p, --path
112
+
113
+ Defines the path to a configuration document to retrieve actual state for instead of piping the
114
+ document from stdin or passing it as a string with the ` --document` option. The specified file must
115
+ contain a configuration document as a JSON or YAML object. DSC validates the document against the
116
+ configuration document schema. If the validation fails, or if the specified file doesn't exist, DSC
117
+ raises an error.
118
+
119
+ This option is mutually exclusive with the `--document` option. When you use this option, DSC
120
+ ignores any input from stdin.
121
+
122
+ ` ` ` yaml
123
+ Type: String
124
+ Mandatory: false
125
+ ` ` `
126
+
81
127
# ## -f, --format
82
128
83
129
The `--format` option controls the console output format for the command. If the command output is
@@ -104,8 +150,6 @@ Mandatory: false
104
150
105
151
This command returns JSON output that includes whether the operation or any resources raised any
106
152
errors, the collection of messages emitted during the operation, and the get operation results for
107
- every instance. For more information, see [dsc config get result schema][03 ].
153
+ every instance. For more information, see [dsc config get result schema][01 ].
108
154
109
- [01]: ../dsc.md#-p---input-file
110
- [02]: ../dsc.md#-i---input
111
- [03]: ../../schemas/outputs/config/get.md
155
+ [01] : ../../schemas/outputs/config/get.md
0 commit comments