description | ms.date | ms.topic | title |
---|---|---|---|
Command line reference for the 'dsc schema' command |
06/24/2024 |
reference |
dsc schema |
Gets the JSON schema for a DSC type.
dsc schema [Options] --type <TYPE>
The schema
command returns the JSON schema for a specific DSC type. These schemas can be used to
validate the return data from the application or to generate compatible type definitions for an
integrating tool.
The application uses these schemas to validate data internally when it's received or represent the output for one of the application's commands.
dsc schema --type get-result
$schema: http://json-schema.org/draft-07/schema#
title: GetResult
anyOf:
- $ref: '#/definitions/ResourceGetResponse'
- type: array
items:
$ref: '#/definitions/ResourceGetResult'
definitions:
ResourceGetResponse:
type: object
required:
- actualState
properties:
actualState:
description: The state of the resource as it was returned by the Get method.
additionalProperties: false
ResourceGetResult:
type: object
required:
- name
- result
- type
properties:
metadata:
anyOf:
- $ref: '#/definitions/Metadata'
- type: 'null'
name:
type: string
type:
type: string
result:
$ref: '#/definitions/GetResult'
additionalProperties: false
Metadata:
type: object
properties:
Microsoft.DSC:
anyOf:
- $ref: '#/definitions/MicrosoftDscMetadata'
- type: 'null'
MicrosoftDscMetadata:
type: object
properties:
version:
description: Version of DSC
type:
- string
- 'null'
operation:
description: The operation being performed
anyOf:
- $ref: '#/definitions/Operation'
- type: 'null'
executionType:
description: The type of execution
anyOf:
- $ref: '#/definitions/ExecutionKind'
- type: 'null'
startDatetime:
description: The start time of the configuration operation
type:
- string
- 'null'
endDatetime:
description: The end time of the configuration operation
type:
- string
- 'null'
duration:
description: The duration of the configuration operation
type:
- string
- 'null'
securityContext:
description: The security context of the configuration operation, can be specified to be required
anyOf:
- $ref: '#/definitions/SecurityContextKind'
- type: 'null'
context:
description: Identifies if the operation is part of a configuration
anyOf:
- $ref: '#/definitions/ContextKind'
- type: 'null'
Operation:
type: string
enum:
- Get
- Set
- Test
- Export
ExecutionKind:
type: string
enum:
- Actual
- WhatIf
SecurityContextKind:
type: string
enum:
- Current
- Elevated
- Restricted
ContextKind:
type: string
enum:
- Configuration
- Resource
GetResult:
anyOf:
- $ref: '#/definitions/ResourceGetResponse'
- type: array
items:
$ref: '#/definitions/ResourceGetResult'
This option is mandatory for the schema
command. The value for this option determines which
schema the application returns:
dsc-resource
(reference documentation) - Represents a DSC Resource as returned from thedsc resource list
command.resource-manifest
(reference documentation) - Validates a command-based DSC Resource's manifest. If the manifest is invalid, DSC raises an error.get-result
(reference documentation) - Represents the output from thedsc resource get
command.set-result
(reference documentation) - Represents the output from thedsc resource set
command.test-result
(reference documentation) - Represents the output from thedsc resource test
command.configuration
(reference documentation) - Validates a DSC Configuration document. If the document is invalid, DSC raises an error.configuration-get-result
(reference documentation) - Represents the output from thedsc config get
command.configuration-set-result
(reference documentation) - Represents the output from thedsc config set
command.configuration-test-result
(reference documentation) - Represents the output from thedsc config test
command.
Type: String
Mandatory: true
ValidValues: [
dsc-resource,
resource-manifest,
get-result,
set-result,
test-result,
configuration,
configuration-get-result,
configuration-set-result,
configuration-test-result
]
The --format
option controls the console output format for the command. If the command output is
redirected or captured as a variable, the output is always JSON.
Type: String
Mandatory: false
DefaultValue: yaml
ValidValues: [json, pretty-json, yaml]
Displays the help for the current command or subcommand. When you specify this option, the application ignores all options and arguments after this one.
Type: Boolean
Mandatory: false