From 2046ea716ee1b683270b28061183faad4db9a535 Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Tue, 18 Feb 2025 16:29:17 -0600 Subject: [PATCH 01/11] (GH-642) Ensure camelCase for items in `dsc_lib` Prior to this change, the structs and enums in `dsc_lib` didn't consistently use camelCase - most property names and enum values use camelCase, but not all - and this inconsistency isn't predictable for end users, who need to consult the JSON Schemas to be sure. This change updates the definitions to rename the fields and values when serializing and deserializing, which also updates their JSON Schema. A future change is required to update the canonical schemas in the repository to match these updates. --- configurations/windows/windows_baseline.dsc.yaml | 2 +- dsc/assertion.dsc.resource.json | 2 +- dsc/examples/groups.dsc.yaml | 2 +- dsc/examples/require_admin.yaml | 2 +- dsc/examples/require_nonadmin.yaml | 2 +- dsc/examples/winps_script.dsc.yaml | 2 +- dsc/group.dsc.resource.json | 2 +- dsc/include.dsc.resource.json | 2 +- dsc/tests/dsc_args.tests.ps1 | 14 ++++++++++++-- dsc/tests/dsc_config_get.tests.ps1 | 4 ++-- dsc/tests/dsc_config_set.tests.ps1 | 4 ++-- dsc/tests/dsc_export.tests.ps1 | 2 +- dsc/tests/dsc_resource_list.tests.ps1 | 10 +++++----- dsc/tests/dsc_whatif.tests.ps1 | 8 ++++---- dsc_lib/src/configure/config_doc.rs | 4 ++++ dsc_lib/src/configure/config_progress.rs | 1 + dsc_lib/src/configure/config_result.rs | 1 + dsc_lib/src/dscresources/dscresource.rs | 1 + dsc_lib/src/dscresources/resource_manifest.rs | 1 + .../Tests/PSTestModule/1.0.0/PSTestModule.psd1 | 2 +- .../TestAdapter/testadapter.dsc.resource.json | 2 +- .../Tests/TestAdapter/testadapter.resource.ps1 | 6 +++--- .../0.0.1/TestClassResource.psd1 | 4 ++-- powershell-adapter/powershell.dsc.resource.json | 2 +- .../psDscAdapter/powershell.resource.ps1 | 16 ++++++++-------- .../windowspowershell.dsc.resource.json | 2 +- .../testGroup.dsc.resource.json | 2 +- .../test_group_resource/tests/provider.tests.ps1 | 2 +- wmi-adapter/wmi.dsc.resource.json | 2 +- wmi-adapter/wmi.resource.ps1 | 8 ++++---- 30 files changed, 66 insertions(+), 48 deletions(-) diff --git a/configurations/windows/windows_baseline.dsc.yaml b/configurations/windows/windows_baseline.dsc.yaml index e2e9c0ca..614515c0 100644 --- a/configurations/windows/windows_baseline.dsc.yaml +++ b/configurations/windows/windows_baseline.dsc.yaml @@ -2,7 +2,7 @@ $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json metadata: Microsoft.DSC: - securityContext: Elevated + securityContext: elevated resources: - name: Validate the OS is Windows type: Microsoft.DSC/Assertion diff --git a/dsc/assertion.dsc.resource.json b/dsc/assertion.dsc.resource.json index 2427a8d0..6f9e3c43 100644 --- a/dsc/assertion.dsc.resource.json +++ b/dsc/assertion.dsc.resource.json @@ -3,7 +3,7 @@ "type": "Microsoft.DSC/Assertion", "version": "0.1.0", "description": "`test` will be invoked for all resources in the supplied configuration.", - "kind": "Group", + "kind": "group", "get": { "executable": "dsc", "args": [ diff --git a/dsc/examples/groups.dsc.yaml b/dsc/examples/groups.dsc.yaml index 199923eb..cabe3498 100644 --- a/dsc/examples/groups.dsc.yaml +++ b/dsc/examples/groups.dsc.yaml @@ -2,7 +2,7 @@ $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json metadata: Microsoft.DSC: - requiredSecurityContext: Current # this is the default and just used as an example indicating this config works for admins and non-admins + requiredSecurityContext: current # this is the default and just used as an example indicating this config works for admins and non-admins resources: - name: Last Group type: Microsoft.DSC/Group diff --git a/dsc/examples/require_admin.yaml b/dsc/examples/require_admin.yaml index 6927a4d7..7cda6ecb 100644 --- a/dsc/examples/require_admin.yaml +++ b/dsc/examples/require_admin.yaml @@ -4,7 +4,7 @@ $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json metadata: Microsoft.DSC: - securityContext: Elevated + securityContext: elevated resources: - name: os type: Microsoft/OSInfo diff --git a/dsc/examples/require_nonadmin.yaml b/dsc/examples/require_nonadmin.yaml index 5bb9a5f5..750a1c2b 100644 --- a/dsc/examples/require_nonadmin.yaml +++ b/dsc/examples/require_nonadmin.yaml @@ -3,7 +3,7 @@ $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json metadata: Microsoft.DSC: - securityContext: Restricted + securityContext: restricted resources: - name: os type: Microsoft/OSInfo diff --git a/dsc/examples/winps_script.dsc.yaml b/dsc/examples/winps_script.dsc.yaml index b9c5b5f3..8dbb61ac 100644 --- a/dsc/examples/winps_script.dsc.yaml +++ b/dsc/examples/winps_script.dsc.yaml @@ -1,7 +1,7 @@ $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json metadata: Microsoft.DSC: - securityContext: Elevated + securityContext: elevated resources: - type: Microsoft.Windows/WindowsPowerShell name: Run WinPS script diff --git a/dsc/group.dsc.resource.json b/dsc/group.dsc.resource.json index 08a920ce..28eb02be 100644 --- a/dsc/group.dsc.resource.json +++ b/dsc/group.dsc.resource.json @@ -3,7 +3,7 @@ "type": "Microsoft.DSC/Group", "version": "0.1.0", "description": "All resources in the supplied configuration is treated as a group.", - "kind": "Group", + "kind": "group", "get": { "executable": "dsc", "args": [ diff --git a/dsc/include.dsc.resource.json b/dsc/include.dsc.resource.json index e25e8e1b..f036d6f0 100644 --- a/dsc/include.dsc.resource.json +++ b/dsc/include.dsc.resource.json @@ -3,7 +3,7 @@ "type": "Microsoft.DSC/Include", "version": "0.1.0", "description": "Allows including a configuration file with optional parameter file.", - "kind": "Importer", + "kind": "importer", "get": { "executable": "dsc", "args": [ diff --git a/dsc/tests/dsc_args.tests.ps1 b/dsc/tests/dsc_args.tests.ps1 index b7a097ee..74ec4ce9 100644 --- a/dsc/tests/dsc_args.tests.ps1 +++ b/dsc/tests/dsc_args.tests.ps1 @@ -91,6 +91,16 @@ actualState: $out.Trim() | Should -BeExactly $expected } + It 'YAML output includes object separator' { + $out = dsc resource list -o yaml | Out-String + foreach ($obj in $out.Split('---')) { + $resource = $obj | y2j | ConvertFrom-Json + $resource | Should -Not -BeNullOrEmpty + $resource.Type | Should -BeLike '*/*' + $resource.Kind | Should -BeIn ('resource', 'group', 'importer', 'adapter') + } + } + It 'can generate PowerShell completer' { $out = dsc completer powershell | Out-String Invoke-Expression $out @@ -232,7 +242,7 @@ resources: $a = dsc resource list '*' -a Test* -o json | ConvertFrom-Json foreach ($r in $a) { $r.requireAdapter.StartsWith("Test") | Should -Be $true - $r.kind | Should -Be "Resource" + $r.kind | Should -Be "resource" } } @@ -243,7 +253,7 @@ resources: $r = $a[0] $r.requireAdapter | Should -Not -BeNullOrEmpty $r.requireAdapter.StartsWith("Test") | Should -Be $true - $r.kind | Should -Be "Resource" + $r.kind | Should -Be "resource" } It 'passing filepath to document arg should error' { diff --git a/dsc/tests/dsc_config_get.tests.ps1 b/dsc/tests/dsc_config_get.tests.ps1 index 07c1b7d7..cba1e386 100644 --- a/dsc/tests/dsc_config_get.tests.ps1 +++ b/dsc/tests/dsc_config_get.tests.ps1 @@ -47,8 +47,8 @@ Describe 'dsc config get tests' { $result.results[0].type | Should -BeExactly 'Microsoft.DSC.Debug/Echo' $result.results[0].result.actualState.output | Should -Be 'hello' $result.metadata.'Microsoft.DSC'.version | Should -BeLike '3.*' - $result.metadata.'Microsoft.DSC'.operation | Should -BeExactly 'Get' - $result.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'Actual' + $result.metadata.'Microsoft.DSC'.operation | Should -BeExactly 'get' + $result.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'actual' $result.metadata.'Microsoft.DSC'.startDatetime | Should -Not -BeNullOrEmpty $result.metadata.'Microsoft.DSC'.endDatetime | Should -Not -BeNullOrEmpty $result.metadata.'Microsoft.DSC'.duration | Should -Not -BeNullOrEmpty diff --git a/dsc/tests/dsc_config_set.tests.ps1 b/dsc/tests/dsc_config_set.tests.ps1 index 7347cd71..6283bd36 100644 --- a/dsc/tests/dsc_config_set.tests.ps1 +++ b/dsc/tests/dsc_config_set.tests.ps1 @@ -29,8 +29,8 @@ Describe 'dsc config set tests' { $out.results[1].result.afterState.deleteCalled | Should -BeTrue $out.results[1].result.afterState._exist | Should -BeFalse $out.metadata.'Microsoft.DSC'.version | Should -BeLike '3.*' - $out.metadata.'Microsoft.DSC'.operation | Should -BeExactly 'Set' - $out.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'Actual' + $out.metadata.'Microsoft.DSC'.operation | Should -BeExactly 'set' + $out.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'actual' $out.metadata.'Microsoft.DSC'.startDatetime | Should -Not -BeNullOrEmpty $out.metadata.'Microsoft.DSC'.endDatetime | Should -Not -BeNullOrEmpty $out.metadata.'Microsoft.DSC'.duration | Should -Not -BeNullOrEmpty diff --git a/dsc/tests/dsc_export.tests.ps1 b/dsc/tests/dsc_export.tests.ps1 index 179b104a..9eddc623 100644 --- a/dsc/tests/dsc_export.tests.ps1 +++ b/dsc/tests/dsc_export.tests.ps1 @@ -39,7 +39,7 @@ Describe 'resource export tests' { $config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json' $config_with_process_list.'resources' | Should -Not -BeNullOrEmpty $config_with_process_list.resources.count | Should -BeGreaterThan 1 - $config_with_process_list.metadata.'Microsoft.DSC'.operation | Should -BeExactly 'Export' + $config_with_process_list.metadata.'Microsoft.DSC'.operation | Should -BeExactly 'export' # contentVersion on export is always 1.0.0 $config_with_process_list.contentVersion | Should -BeExactly '1.0.0' } diff --git a/dsc/tests/dsc_resource_list.tests.ps1 b/dsc/tests/dsc_resource_list.tests.ps1 index 4e2e00c0..df9be7a4 100644 --- a/dsc/tests/dsc_resource_list.tests.ps1 +++ b/dsc/tests/dsc_resource_list.tests.ps1 @@ -10,9 +10,9 @@ Describe 'Tests for listing resources' { $resources.type | Should -Contain 'Microsoft.DSC/Assertion' $resources.type | Should -Contain 'Microsoft.DSC/Group' $resources.type | Should -Contain 'Microsoft/OSInfo' - ($resources | Where-Object { $_.type -eq 'Microsoft.DSC/Group' }).Kind | Should -BeExactly 'Group' - ($resources | Where-Object { $_.type -eq 'Microsoft/OSInfo' }).Kind | Should -BeExactly 'Resource' - ($resources | Where-Object { $_.type -eq 'Microsoft.DSC/PowerShell' }).Kind | Should -BeExactly 'Adapter' + ($resources | Where-Object { $_.type -eq 'Microsoft.DSC/Group' }).Kind | Should -BeExactly 'group' + ($resources | Where-Object { $_.type -eq 'Microsoft/OSInfo' }).Kind | Should -BeExactly 'resource' + ($resources | Where-Object { $_.type -eq 'Microsoft.DSC/PowerShell' }).Kind | Should -BeExactly 'adapter' } It 'dsc resource list --tags "" and --description " work' -TestCases @( @@ -79,8 +79,8 @@ Describe 'Tests for listing resources' { $resource = dsc resource list Microsoft/OSInfo | ConvertFrom-Json $LASTEXITCODE | Should -Be 0 $resource.capabilities.Count | Should -Be 2 - $resource.capabilities | Should -Contain 'Get' - $resource.capabilities | Should -Contain 'Export' + $resource.capabilities | Should -Contain 'get' + $resource.capabilities | Should -Contain 'export' } It 'Invalid adapter returns an error' { diff --git a/dsc/tests/dsc_whatif.tests.ps1 b/dsc/tests/dsc_whatif.tests.ps1 index dd13ab4d..b969f49a 100644 --- a/dsc/tests/dsc_whatif.tests.ps1 +++ b/dsc/tests/dsc_whatif.tests.ps1 @@ -16,7 +16,7 @@ Describe 'whatif tests' { "@ $what_if_result = $config_yaml | dsc config set -w -f - | ConvertFrom-Json $set_result = $config_yaml | dsc config set -f - | ConvertFrom-Json - $what_if_result.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'WhatIf' + $what_if_result.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'whatIf' $what_if_result.results.result.beforeState.output | Should -Be $set_result.results.result.beforeState.output $what_if_result.results.result.afterState.output | Should -Be $set_result.results.result.afterState.output $what_if_result.results.result.changedProperties | Should -Be $set_result.results.result.changedProperties @@ -37,7 +37,7 @@ Describe 'whatif tests' { "@ $what_if_result = dsc config set -w -i $config_yaml | ConvertFrom-Json $set_result = dsc config set -i $config_yaml | ConvertFrom-Json - $what_if_result.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'WhatIf' + $what_if_result.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'whatIf' $what_if_result.results.result.beforeState._exist | Should -Be $set_result.results.result.beforeState._exist $what_if_result.results.result.beforeState.keyPath | Should -Be $set_result.results.result.beforeState.keyPath $what_if_result.results.result.afterState.KeyPath | Should -Be $set_result.results.result.afterState.keyPath @@ -80,7 +80,7 @@ Describe 'whatif tests' { executionType: Actual "@ $result = $config_yaml | dsc config set -f - | ConvertFrom-Json - $result.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'Actual' + $result.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'actual' $result.results.result.afterState.executionType | Should -BeExactly 'Actual' $result.results.result.changedProperties | Should -Be $null $result.hadErrors | Should -BeFalse @@ -98,7 +98,7 @@ Describe 'whatif tests' { executionType: Actual "@ $result = $config_yaml | dsc config set -w -f - | ConvertFrom-Json - $result.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'WhatIf' + $result.metadata.'Microsoft.DSC'.executionType | Should -BeExactly 'whatIf' $result.results.result.afterState.executionType | Should -BeExactly 'WhatIf' $result.results.result.changedProperties | Should -BeExactly 'executionType' $result.hadErrors | Should -BeFalse diff --git a/dsc_lib/src/configure/config_doc.rs b/dsc_lib/src/configure/config_doc.rs index 19d27d54..336dc545 100644 --- a/dsc_lib/src/configure/config_doc.rs +++ b/dsc_lib/src/configure/config_doc.rs @@ -7,12 +7,14 @@ use serde_json::{Map, Value}; use std::{collections::HashMap, hash::Hash}; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub enum ContextKind { Configuration, Resource, } #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub enum SecurityContextKind { Current, Elevated, @@ -20,6 +22,7 @@ pub enum SecurityContextKind { } #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub enum Operation { Get, Set, @@ -28,6 +31,7 @@ pub enum Operation { } #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub enum ExecutionKind { Actual, WhatIf, diff --git a/dsc_lib/src/configure/config_progress.rs b/dsc_lib/src/configure/config_progress.rs index 59b36d6d..42ef494d 100644 --- a/dsc_lib/src/configure/config_progress.rs +++ b/dsc_lib/src/configure/config_progress.rs @@ -12,6 +12,7 @@ pub struct ConfigurationResourceStartedEvent { } #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub enum ConfigurationResourceCompletionStatus { Success, Failure, diff --git a/dsc_lib/src/configure/config_result.rs b/dsc_lib/src/configure/config_result.rs index cced4b0d..6f2be74b 100644 --- a/dsc_lib/src/configure/config_result.rs +++ b/dsc_lib/src/configure/config_result.rs @@ -7,6 +7,7 @@ use crate::dscresources::invoke_result::{GetResult, SetResult, TestResult}; use crate::configure::config_doc::{Configuration, Metadata}; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub enum MessageLevel { Error, Warning, diff --git a/dsc_lib/src/dscresources/dscresource.rs b/dsc_lib/src/dscresources/dscresource.rs index 868a9098..b8d0e65b 100644 --- a/dsc_lib/src/dscresources/dscresource.rs +++ b/dsc_lib/src/dscresources/dscresource.rs @@ -45,6 +45,7 @@ pub struct DscResource { } #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub enum Capability { /// The resource supports retriving configuration. Get, diff --git a/dsc_lib/src/dscresources/resource_manifest.rs b/dsc_lib/src/dscresources/resource_manifest.rs index 26b1d7d3..04a652c4 100644 --- a/dsc_lib/src/dscresources/resource_manifest.rs +++ b/dsc_lib/src/dscresources/resource_manifest.rs @@ -10,6 +10,7 @@ use std::collections::HashMap; use crate::dscerror::DscError; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] pub enum Kind { Adapter, Group, diff --git a/powershell-adapter/Tests/PSTestModule/1.0.0/PSTestModule.psd1 b/powershell-adapter/Tests/PSTestModule/1.0.0/PSTestModule.psd1 index 7cb6fdf0..40fc82cc 100644 --- a/powershell-adapter/Tests/PSTestModule/1.0.0/PSTestModule.psd1 +++ b/powershell-adapter/Tests/PSTestModule/1.0.0/PSTestModule.psd1 @@ -21,7 +21,7 @@ 'PSEdition_Core', 'Linux', 'Mac') - DscCapabilities = @('Get', 'Test') + DscCapabilities = @('get', 'test') } } } diff --git a/powershell-adapter/Tests/TestAdapter/testadapter.dsc.resource.json b/powershell-adapter/Tests/TestAdapter/testadapter.dsc.resource.json index 407dbd01..4a66ad0b 100644 --- a/powershell-adapter/Tests/TestAdapter/testadapter.dsc.resource.json +++ b/powershell-adapter/Tests/TestAdapter/testadapter.dsc.resource.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", "type": "Test/TestAdapter", "version": "0.1.0", - "kind": "Adapter", + "kind": "adapter", "description": "Resource adapter for testing.", "tags": [ "PowerShell" diff --git a/powershell-adapter/Tests/TestAdapter/testadapter.resource.ps1 b/powershell-adapter/Tests/TestAdapter/testadapter.resource.ps1 index 6db84584..a518dadc 100644 --- a/powershell-adapter/Tests/TestAdapter/testadapter.resource.ps1 +++ b/powershell-adapter/Tests/TestAdapter/testadapter.resource.ps1 @@ -36,12 +36,12 @@ switch ($Operation) { 'List' { @{ type = "Test/TestCase" - kind = 'Resource' + kind = 'resource' version = '1' - capabilities = @('Get', 'Set', 'Test', 'Export') + capabilities = @('get', 'set', 'test', 'export') path = $PSScriptRoot directory = Split-Path $PSScriptRoot - implementedAs = 'Adapter' + implementedAs = 'adapter' author = 'Test' properties = @('TestCaseId', 'Input', 'Result') requireAdapter = 'Test/TestAdapter' diff --git a/powershell-adapter/Tests/TestClassResource/0.0.1/TestClassResource.psd1 b/powershell-adapter/Tests/TestClassResource/0.0.1/TestClassResource.psd1 index 8f52bda1..c852f0a1 100644 --- a/powershell-adapter/Tests/TestClassResource/0.0.1/TestClassResource.psd1 +++ b/powershell-adapter/Tests/TestClassResource/0.0.1/TestClassResource.psd1 @@ -40,8 +40,8 @@ DscResourcesToExport = @('TestClassResource', 'NoExport') PrivateData = @{ PSData = @{ DscCapabilities = @( - 'Get' - 'Test' + 'get' + 'test' ) } } diff --git a/powershell-adapter/powershell.dsc.resource.json b/powershell-adapter/powershell.dsc.resource.json index 659efcfa..041bdf22 100644 --- a/powershell-adapter/powershell.dsc.resource.json +++ b/powershell-adapter/powershell.dsc.resource.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", "type": "Microsoft.DSC/PowerShell", "version": "0.1.0", - "kind": "Adapter", + "kind": "adapter", "description": "Resource adapter to classic DSC Powershell resources.", "tags": [ "PowerShell" diff --git a/powershell-adapter/psDscAdapter/powershell.resource.ps1 b/powershell-adapter/psDscAdapter/powershell.resource.ps1 index d0cd3ce7..b2694770 100644 --- a/powershell-adapter/psDscAdapter/powershell.resource.ps1 +++ b/powershell-adapter/psDscAdapter/powershell.resource.ps1 @@ -18,7 +18,7 @@ function Write-DscTrace { [string]$Message ) - $trace = @{$Operation = $Message } | ConvertTo-Json -Compress + $trace = @{$Operation.ToLower() = $Message } | ConvertTo-Json -Compress $host.ui.WriteErrorLine($trace) } @@ -47,7 +47,7 @@ if ($Operation -eq 'ClearCache') { if ('Validate' -ne $Operation) { # write $jsonInput to STDERR for debugging - $trace = @{'Debug' = 'jsonInput=' + $jsonInput } | ConvertTo-Json -Compress + $trace = @{'debug' = 'jsonInput=' + $jsonInput } | ConvertTo-Json -Compress $host.ui.WriteErrorLine($trace) # load private functions of psDscAdapter stub module @@ -92,7 +92,7 @@ switch ($Operation) { $capabilities = $module.PrivateData.PSData.DscCapabilities } else { - $capabilities = @('Get', 'Set', 'Test') + $capabilities = @('get', 'set', 'test') } } @@ -119,7 +119,7 @@ switch ($Operation) { # OUTPUT dsc is expecting the following properties [resourceOutput]@{ type = $dscResource.Type - kind = 'Resource' + kind = 'resource' version = [string]$DscResourceInfo.version capabilities = $capabilities path = $DscResourceInfo.Path @@ -135,7 +135,7 @@ switch ($Operation) { { @('Get','Set','Test','Export') -contains $_ } { $desiredState = $psDscAdapter.invoke( { param($jsonInput) Get-DscResourceObject -jsonInput $jsonInput }, $jsonInput ) if ($null -eq $desiredState) { - $trace = @{'Debug' = 'ERROR: Failed to create configuration object from provided input JSON.' } | ConvertTo-Json -Compress + $trace = @{'debug' = 'ERROR: Failed to create configuration object from provided input JSON.' } | ConvertTo-Json -Compress $host.ui.WriteErrorLine($trace) exit 1 } @@ -143,7 +143,7 @@ switch ($Operation) { # only need to cache the resources that are used $dscResourceModules = $desiredState | ForEach-Object { $_.Type.Split('/')[0] } if ($null -eq $dscResourceModules) { - $trace = @{'Debug' = 'ERROR: Could not get list of DSC resource types from provided JSON.' } | ConvertTo-Json -Compress + $trace = @{'debug' = 'ERROR: Could not get list of DSC resource types from provided JSON.' } | ConvertTo-Json -Compress $host.ui.WriteErrorLine($trace) exit 1 } @@ -166,7 +166,7 @@ switch ($Operation) { # process the INPUT (desiredState) for each resource as dscresourceInfo and return the OUTPUT as actualState $actualState = $psDscAdapter.invoke( { param($op, $ds, $dscResourceCache) Invoke-DscOperation -Operation $op -DesiredState $ds -dscResourceCache $dscResourceCache }, $Operation, $ds, $dscResourceCache) if ($null -eq $actualState) { - $trace = @{'Debug' = 'ERROR: Incomplete GET for resource ' + $ds.Name } | ConvertTo-Json -Compress + $trace = @{'debug' = 'ERROR: Incomplete GET for resource ' + $ds.Name } | ConvertTo-Json -Compress $host.ui.WriteErrorLine($trace) exit 1 } @@ -175,7 +175,7 @@ switch ($Operation) { # OUTPUT json to stderr for debug, and to stdout $result = @{ result = $result } | ConvertTo-Json -Depth 10 -Compress - $trace = @{'Debug' = 'jsonOutput=' + $result } | ConvertTo-Json -Compress + $trace = @{'debug' = 'jsonOutput=' + $result } | ConvertTo-Json -Compress $host.ui.WriteErrorLine($trace) return $result } diff --git a/powershell-adapter/windowspowershell.dsc.resource.json b/powershell-adapter/windowspowershell.dsc.resource.json index 87e41e2c..ed1dddb3 100644 --- a/powershell-adapter/windowspowershell.dsc.resource.json +++ b/powershell-adapter/windowspowershell.dsc.resource.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", "type": "Microsoft.Windows/WindowsPowerShell", "version": "0.1.0", - "kind": "Adapter", + "kind": "adapter", "description": "Resource adapter to classic DSC Powershell resources in Windows PowerShell.", "tags": [ "PowerShell" diff --git a/tools/test_group_resource/testGroup.dsc.resource.json b/tools/test_group_resource/testGroup.dsc.resource.json index 91944e5d..5436d13f 100644 --- a/tools/test_group_resource/testGroup.dsc.resource.json +++ b/tools/test_group_resource/testGroup.dsc.resource.json @@ -1,7 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", "type": "Test/TestGroup", - "kind": "Adapter", + "kind": "adapter", "version": "0.1.0", "get": { "executable": "test_group_resource", diff --git a/tools/test_group_resource/tests/provider.tests.ps1 b/tools/test_group_resource/tests/provider.tests.ps1 index 06dbffab..bd2285cb 100644 --- a/tools/test_group_resource/tests/provider.tests.ps1 +++ b/tools/test_group_resource/tests/provider.tests.ps1 @@ -24,7 +24,7 @@ Describe 'Resource adapter tests' { { "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", "type": "Test/InvalidTestGroup", - "kind": "Adapter", + "kind": "adapter", "version": "0.1.0", "get": { "executable": "test_group_resource", diff --git a/wmi-adapter/wmi.dsc.resource.json b/wmi-adapter/wmi.dsc.resource.json index 5b63c7d3..b07b16d1 100644 --- a/wmi-adapter/wmi.dsc.resource.json +++ b/wmi-adapter/wmi.dsc.resource.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", "type": "Microsoft.Windows/WMI", "version": "0.1.0", - "kind": "Adapter", + "kind": "adapter", "description": "Resource adapter to WMI resources.", "tags": [ "PowerShell" diff --git a/wmi-adapter/wmi.resource.ps1 b/wmi-adapter/wmi.resource.ps1 index 81154734..183661d3 100644 --- a/wmi-adapter/wmi.resource.ps1 +++ b/wmi-adapter/wmi.resource.ps1 @@ -26,14 +26,14 @@ function Write-Trace { ) $trace = [pscustomobject]@{ - $level = $message + $level.ToLower() = $message } | ConvertTo-Json -Compress $host.ui.WriteErrorLine($trace) } function IsConfiguration($obj) { - if ($null -ne $obj.metadata -and $null -ne $obj.metadata.'Microsoft.DSC' -and $obj.metadata.'Microsoft.DSC'.context -eq 'Configuration') { + if ($null -ne $obj.metadata -and $null -ne $obj.metadata.'Microsoft.DSC' -and $obj.metadata.'Microsoft.DSC'.context -eq 'configuration') { return $true } @@ -65,9 +65,9 @@ if ($Operation -eq 'List') $z = [pscustomobject]@{ type = $fullResourceTypeName; - kind = 'Resource'; + kind = 'resource'; version = $version_string; - capabilities = @('Get'); + capabilities = @('get'); path = ""; directory = ""; implementedAs = ""; From 675ee0f84b13a34f86b6fc7da351579f9d16f0e8 Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Wed, 19 Feb 2025 14:46:07 -0600 Subject: [PATCH 02/11] (MAINT) Fix bug in schema build script This change fixes a bug in the schema build script that caused the build to mangle the generated output by failing to correctly replace `.yaml` references to `.json`. --- schemas/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/build.ps1 b/schemas/build.ps1 index b063e967..66a55f6c 100644 --- a/schemas/build.ps1 +++ b/schemas/build.ps1 @@ -646,7 +646,7 @@ process { $SchemaContent = $SchemaContent -replace '', $Config.version $SchemaContent = $SchemaContent -replace '', $Config.docs_base_url $SchemaContent = $SchemaContent -replace '', $Config.docs_version_pin - $SchemaContent = $SchemaContent -replace '(?m)\.yaml$"?,?', '.json' + $SchemaContent = $SchemaContent -replace '(?m)\.yaml"?,?\s*$', '.json' $SchemaPath = $_.FullName -replace 'src', $Config.version $SchemaFolder = Split-Path -Parent $SchemaPath if (-not (Test-Path -Path ($SchemaFolder))) { From 3c2e32420c8ac664e89590976b14591ed38bc7d1 Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Wed, 19 Feb 2025 14:47:23 -0600 Subject: [PATCH 03/11] (GH-642) Update schema source definitions This change updates the YAML source definition files for the JSON Schemas to use the correct casing. It also adds the missing `context` property for the `Microsoft.DSC` metadata field. --- schemas/src/definitions/message.yaml | 6 ++--- .../src/metadata/Microsoft.DSC/context.yaml | 19 +++++++++++++++ .../metadata/Microsoft.DSC/executionType.yaml | 4 ++-- .../src/metadata/Microsoft.DSC/operation.yaml | 8 +++---- .../Microsoft.DSC/securityContext.yaml | 14 +++++------ .../metadata/configurationDocumentResult.yaml | 3 +++ schemas/src/outputs/resource/list.yaml | 24 +++++++++---------- schemas/src/resource/manifest.yaml | 8 ++++--- 8 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 schemas/src/metadata/Microsoft.DSC/context.yaml diff --git a/schemas/src/definitions/message.yaml b/schemas/src/definitions/message.yaml index 249bbc26..722c5e0a 100644 --- a/schemas/src/definitions/message.yaml +++ b/schemas/src/definitions/message.yaml @@ -33,6 +33,6 @@ properties: Indicates the severity of the message. type: string enum: - - Error - - Warning - - Information + - error + - warning + - information diff --git a/schemas/src/metadata/Microsoft.DSC/context.yaml b/schemas/src/metadata/Microsoft.DSC/context.yaml new file mode 100644 index 00000000..7cea9e28 --- /dev/null +++ b/schemas/src/metadata/Microsoft.DSC/context.yaml @@ -0,0 +1,19 @@ +# yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema +$schema: https://json-schema.org/draft/2020-12/schema +$id: ///metadata/Microsoft.DSC/context.yaml +# Documentation +title: Operation context +description: >- + Defines whether the operation was for a configuration or a resource. If the value for this + metadata property is `configuration`, DSC was run through the `dsc config` command. If the value + is `resource`, DSC was run with the `dsc resource` command. + +markdownDescription: |- + Defines whether the operation was for a configuration or a resource. If the value for this + metadata property is `configuration`, DSC was run through the `dsc config` command. If the value + is `resource`, DSC was run with the `dsc resource` command. +# Definition +type: string +enum: + - resource + - configuration diff --git a/schemas/src/metadata/Microsoft.DSC/executionType.yaml b/schemas/src/metadata/Microsoft.DSC/executionType.yaml index 6b5deb00..7ec19280 100644 --- a/schemas/src/metadata/Microsoft.DSC/executionType.yaml +++ b/schemas/src/metadata/Microsoft.DSC/executionType.yaml @@ -14,5 +14,5 @@ markdownDescription: |- # Definition type: string enum: - - Actual - - WhatIf + - actual + - whatIf diff --git a/schemas/src/metadata/Microsoft.DSC/operation.yaml b/schemas/src/metadata/Microsoft.DSC/operation.yaml index 3efa329f..23eed58e 100644 --- a/schemas/src/metadata/Microsoft.DSC/operation.yaml +++ b/schemas/src/metadata/Microsoft.DSC/operation.yaml @@ -12,7 +12,7 @@ markdownDescription: |- # Definition type: string enum: - - Get - - Set - - Test - - Export + - get + - set + - test + - export diff --git a/schemas/src/metadata/Microsoft.DSC/securityContext.yaml b/schemas/src/metadata/Microsoft.DSC/securityContext.yaml index 16c05e3c..9c1ef5af 100644 --- a/schemas/src/metadata/Microsoft.DSC/securityContext.yaml +++ b/schemas/src/metadata/Microsoft.DSC/securityContext.yaml @@ -5,17 +5,17 @@ $id: ///metadata/Microsoft.DSC/securityContext.yaml title: Security context description: >- Defines the security context that DSC was run under. If the value for this metadata property is - `Elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator - privileges (on Windows). If the value is `Restricted`, DSC was run as a normal user or account in + `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator + privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session. markdownDescription: |- Defines the security context that DSC was run under. If the value for this metadata property is - `Elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator - privileges (on Windows). If the value is `Restricted`, DSC was run as a normal user or account in + `elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator + privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session. # Definition type: string enum: - - Current - - Elevated - - Restricted + - current + - elevated + - restricted diff --git a/schemas/src/metadata/configurationDocumentResult.yaml b/schemas/src/metadata/configurationDocumentResult.yaml index c21b31bb..d4de48df 100644 --- a/schemas/src/metadata/configurationDocumentResult.yaml +++ b/schemas/src/metadata/configurationDocumentResult.yaml @@ -30,6 +30,7 @@ properties: - endDatetime - duration - securityContext + - context properties: version: $ref: ///metadata/Microsoft.DSC/version.yaml @@ -45,3 +46,5 @@ properties: $ref: ///metadata/Microsoft.DSC/duration.yaml securityContext: $ref: ///metadata/Microsoft.DSC/securityContext.yaml + context: + $ref: ///metadata/Microsoft.DSC/context.yaml diff --git a/schemas/src/outputs/resource/list.yaml b/schemas/src/outputs/resource/list.yaml index 0eda2c42..90838aaf 100644 --- a/schemas/src/outputs/resource/list.yaml +++ b/schemas/src/outputs/resource/list.yaml @@ -24,21 +24,21 @@ properties: title: Resource capabilities description: >- Defines the list of DSC operations the resource is compatible with. If the resource doesn't - list a given operation, like `Set` or `Export`, the resource can't be used for those - operations. The exception to this is `Test` - DSC uses synthetic testing for resources that - don't have the `Test` capability. + list a given operation, like `set` or `export`, the resource can't be used for those + operations. The exception to this is `test` - DSC uses synthetic testing for resources that + don't have the `test` capability. type: array items: type: string enum: - - Get - - Set - - SetHandlesExist - - WhatIf - - Test - - Delete - - Export - - Resolve + - get + - set + - setHandlesExist + - whatIf + - test + - delete + - export + - resolve description: title: Resource Description description: >- @@ -69,7 +69,7 @@ properties: implementations built into DSC. type: string enum: - - Command + - command # Need to understand how this works to document it more usefully - title: Custom implementation diff --git a/schemas/src/resource/manifest.yaml b/schemas/src/resource/manifest.yaml index 81e265ed..1139f6ad 100644 --- a/schemas/src/resource/manifest.yaml +++ b/schemas/src/resource/manifest.yaml @@ -60,6 +60,7 @@ defaultSnippets: body: ${escape_dollar:$}schema: ///bundled/resource/manifest.yaml type: '${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\.]dsc[\.]resource/$1/}}' + kind: group version: '${3:0.1.0}' description: ${4:Synopsis for the resource's purpose} get: @@ -100,6 +101,7 @@ defaultSnippets: body: ${escape_dollar:$}schema: ///bundled/resource/manifest.yaml type: '${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\.]dsc[\.]resource/$1/}}' + kind: adapter version: '${3:0.1.0}' description: ${4:Synopsis for the resource's purpose} get: @@ -145,7 +147,7 @@ defaultSnippets: body: ${escape_dollar:$}schema: ///bundled/resource/manifest.yaml type: '${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\.]dsc[\.]resource/$1/}}' - kind: Import + kind: importer version: '${3:0.1.0}' description: ${4:Synopsis for the resource's purpose} resolve: @@ -519,13 +521,13 @@ properties: allOf: # Adapter resources must define the adapter command - if: - properties: { kind: { const: Adapter } } + properties: { kind: { const: adapter } } required: [kind] then: required: [adapter] # Importer resources must define resolve, all others must define get - if: - properties: { kind: { const: Import } } + properties: { kind: { const: importer } } required: [kind] then: required: [resolve] From d86b7e4a3ff163d2d1227de63fde4952f025cb59 Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Wed, 19 Feb 2025 14:53:53 -0600 Subject: [PATCH 04/11] (GH-642) Generate schemas from source for v3.0 This change generates the canonical schemas for in new folders: `v3`, `v3.0`, and `v3.0.0`, instead of the previous date-based folder `2024/04`. The changing of the casing is _not_ backwards compatible, and requires a new location to avoid breaking prior schemas. This change generates the schemas into three folders to accomodate the changes requested in #138 for moving from date-based to semantic versioning for the schemas. Going forward, schema generation should: - Export to a folder for the current release with the full semantic version, like `v3.0.1` or `v3.1.0`. - Export to a folder for the current `major.minor` schema, like `v3.0` or `v3.1` - Build to a folder for the current major version of the release, like `v3`. Under this design, you can: - Get the exact version of the schema that a release shipped with by specifying the schema URI as `v..` - Get the latest schema for your minor version as `v.` - Get the latest schema for your major version as `v` Breaking changes to the schema have the potential to break integrating software, configuration documents, and resource manifests. They therefore constitute a breaking change in the application and require incrementing the major version segment of the semantic version. This change will be followed by an update to the allowed schema versions in the code itself, which should only recognize the updated schema at this time, not previous schemas. --- schemas/schemas.config.yaml | 2 +- schemas/v3.0.0/bundled/config/document.json | 398 ++++ .../bundled/config/document.vscode.json | 617 +++++ .../v3.0.0/bundled/outputs/config/get.json | 333 +++ .../bundled/outputs/config/get.vscode.json | 368 +++ .../v3.0.0/bundled/outputs/config/set.json | 349 +++ .../bundled/outputs/config/set.vscode.json | 384 +++ .../v3.0.0/bundled/outputs/config/test.json | 355 +++ .../bundled/outputs/config/test.vscode.json | 390 ++++ .../v3.0.0/bundled/outputs/resource/get.json | 130 ++ .../bundled/outputs/resource/get.vscode.json | 156 ++ .../v3.0.0/bundled/outputs/resource/list.json | 1238 ++++++++++ .../bundled/outputs/resource/list.vscode.json | 2068 +++++++++++++++++ .../bundled/outputs/resource/schema.json | 8 + .../outputs/resource/schema.vscode.json | 8 + .../v3.0.0/bundled/outputs/resource/set.json | 146 ++ .../bundled/outputs/resource/set.vscode.json | 172 ++ .../v3.0.0/bundled/outputs/resource/test.json | 152 ++ .../bundled/outputs/resource/test.vscode.json | 178 ++ schemas/v3.0.0/bundled/outputs/schema.json | 8 + .../v3.0.0/bundled/outputs/schema.vscode.json | 8 + schemas/v3.0.0/bundled/resource/manifest.json | 1126 +++++++++ .../bundled/resource/manifest.vscode.json | 1956 ++++++++++++++++ schemas/v3.0.0/config/document.json | 55 + schemas/v3.0.0/config/document.metadata.json | 22 + schemas/v3.0.0/config/document.parameter.json | 228 ++ schemas/v3.0.0/config/document.resource.json | 34 + schemas/v3.0.0/definitions/commandArgs.json | 38 + .../v3.0.0/definitions/commandExecutable.json | 7 + schemas/v3.0.0/definitions/hadErrors.json | 7 + schemas/v3.0.0/definitions/inputKind.json | 11 + schemas/v3.0.0/definitions/instanceName.json | 9 + schemas/v3.0.0/definitions/message.json | 39 + schemas/v3.0.0/definitions/messages.json | 10 + .../definitions/parameters/dataTypes.json | 16 + .../parameters/validValueTypes.json | 12 + schemas/v3.0.0/definitions/resourceKind.json | 13 + schemas/v3.0.0/definitions/resourceType.json | 8 + schemas/v3.0.0/definitions/returnKind.json | 12 + schemas/v3.0.0/definitions/semver.json | 9 + .../metadata/Microsoft.DSC/context.json | 11 + .../metadata/Microsoft.DSC/duration.json | 8 + .../metadata/Microsoft.DSC/endDatetime.json | 8 + .../metadata/Microsoft.DSC/executionType.json | 11 + .../metadata/Microsoft.DSC/operation.json | 13 + .../Microsoft.DSC/securityContext.json | 12 + .../metadata/Microsoft.DSC/startDatetime.json | 8 + .../metadata/Microsoft.DSC/version.json | 7 + .../metadata/configurationDocumentResult.json | 53 + .../metadata/resourceInstanceResult.json | 25 + schemas/v3.0.0/outputs/config/get.json | 32 + schemas/v3.0.0/outputs/config/set.json | 32 + schemas/v3.0.0/outputs/config/test.json | 32 + schemas/v3.0.0/outputs/resource/get.full.json | 27 + schemas/v3.0.0/outputs/resource/get.json | 17 + .../v3.0.0/outputs/resource/get.simple.json | 17 + schemas/v3.0.0/outputs/resource/list.json | 112 + schemas/v3.0.0/outputs/resource/schema.json | 7 + schemas/v3.0.0/outputs/resource/set.full.json | 27 + schemas/v3.0.0/outputs/resource/set.json | 17 + .../v3.0.0/outputs/resource/set.simple.json | 33 + .../v3.0.0/outputs/resource/test.full.json | 27 + schemas/v3.0.0/outputs/resource/test.json | 17 + .../v3.0.0/outputs/resource/test.simple.json | 39 + schemas/v3.0.0/outputs/schema.json | 7 + schemas/v3.0.0/resource/manifest.adapter.json | 58 + schemas/v3.0.0/resource/manifest.delete.json | 67 + schemas/v3.0.0/resource/manifest.export.json | 67 + schemas/v3.0.0/resource/manifest.get.json | 67 + schemas/v3.0.0/resource/manifest.json | 155 ++ schemas/v3.0.0/resource/manifest.resolve.json | 67 + schemas/v3.0.0/resource/manifest.schema.json | 195 ++ schemas/v3.0.0/resource/manifest.set.json | 83 + schemas/v3.0.0/resource/manifest.test.json | 72 + .../v3.0.0/resource/manifest.validate.json | 67 + schemas/v3.0.0/resource/manifest.whatIf.json | 83 + schemas/v3.0.0/resource/properties/exist.json | 12 + .../resource/properties/inDesiredState.json | 11 + schemas/v3.0.0/resource/properties/purge.json | 11 + .../resource/properties/rebootRequested.json | 11 + schemas/v3.0/bundled/config/document.json | 398 ++++ .../v3.0/bundled/config/document.vscode.json | 617 +++++ schemas/v3.0/bundled/outputs/config/get.json | 333 +++ .../bundled/outputs/config/get.vscode.json | 368 +++ schemas/v3.0/bundled/outputs/config/set.json | 349 +++ .../bundled/outputs/config/set.vscode.json | 384 +++ schemas/v3.0/bundled/outputs/config/test.json | 355 +++ .../bundled/outputs/config/test.vscode.json | 390 ++++ .../v3.0/bundled/outputs/resource/get.json | 130 ++ .../bundled/outputs/resource/get.vscode.json | 156 ++ .../v3.0/bundled/outputs/resource/list.json | 1238 ++++++++++ .../bundled/outputs/resource/list.vscode.json | 2068 +++++++++++++++++ .../v3.0/bundled/outputs/resource/schema.json | 8 + .../outputs/resource/schema.vscode.json | 8 + .../v3.0/bundled/outputs/resource/set.json | 146 ++ .../bundled/outputs/resource/set.vscode.json | 172 ++ .../v3.0/bundled/outputs/resource/test.json | 152 ++ .../bundled/outputs/resource/test.vscode.json | 178 ++ schemas/v3.0/bundled/outputs/schema.json | 8 + .../v3.0/bundled/outputs/schema.vscode.json | 8 + schemas/v3.0/bundled/resource/manifest.json | 1126 +++++++++ .../bundled/resource/manifest.vscode.json | 1956 ++++++++++++++++ schemas/v3.0/config/document.json | 55 + schemas/v3.0/config/document.metadata.json | 22 + schemas/v3.0/config/document.parameter.json | 228 ++ schemas/v3.0/config/document.resource.json | 34 + schemas/v3.0/definitions/commandArgs.json | 38 + .../v3.0/definitions/commandExecutable.json | 7 + schemas/v3.0/definitions/hadErrors.json | 7 + schemas/v3.0/definitions/inputKind.json | 11 + schemas/v3.0/definitions/instanceName.json | 9 + schemas/v3.0/definitions/message.json | 39 + schemas/v3.0/definitions/messages.json | 10 + .../definitions/parameters/dataTypes.json | 16 + .../parameters/validValueTypes.json | 12 + schemas/v3.0/definitions/resourceKind.json | 13 + schemas/v3.0/definitions/resourceType.json | 8 + schemas/v3.0/definitions/returnKind.json | 12 + schemas/v3.0/definitions/semver.json | 9 + .../v3.0/metadata/Microsoft.DSC/context.json | 11 + .../v3.0/metadata/Microsoft.DSC/duration.json | 8 + .../metadata/Microsoft.DSC/endDatetime.json | 8 + .../metadata/Microsoft.DSC/executionType.json | 11 + .../metadata/Microsoft.DSC/operation.json | 13 + .../Microsoft.DSC/securityContext.json | 12 + .../metadata/Microsoft.DSC/startDatetime.json | 8 + .../v3.0/metadata/Microsoft.DSC/version.json | 7 + .../metadata/configurationDocumentResult.json | 53 + .../v3.0/metadata/resourceInstanceResult.json | 25 + schemas/v3.0/outputs/config/get.json | 32 + schemas/v3.0/outputs/config/set.json | 32 + schemas/v3.0/outputs/config/test.json | 32 + schemas/v3.0/outputs/resource/get.full.json | 27 + schemas/v3.0/outputs/resource/get.json | 17 + schemas/v3.0/outputs/resource/get.simple.json | 17 + schemas/v3.0/outputs/resource/list.json | 112 + schemas/v3.0/outputs/resource/schema.json | 7 + schemas/v3.0/outputs/resource/set.full.json | 27 + schemas/v3.0/outputs/resource/set.json | 17 + schemas/v3.0/outputs/resource/set.simple.json | 33 + schemas/v3.0/outputs/resource/test.full.json | 27 + schemas/v3.0/outputs/resource/test.json | 17 + .../v3.0/outputs/resource/test.simple.json | 39 + schemas/v3.0/outputs/schema.json | 7 + schemas/v3.0/resource/manifest.adapter.json | 58 + schemas/v3.0/resource/manifest.delete.json | 67 + schemas/v3.0/resource/manifest.export.json | 67 + schemas/v3.0/resource/manifest.get.json | 67 + schemas/v3.0/resource/manifest.json | 155 ++ schemas/v3.0/resource/manifest.resolve.json | 67 + schemas/v3.0/resource/manifest.schema.json | 195 ++ schemas/v3.0/resource/manifest.set.json | 83 + schemas/v3.0/resource/manifest.test.json | 72 + schemas/v3.0/resource/manifest.validate.json | 67 + schemas/v3.0/resource/manifest.whatIf.json | 83 + schemas/v3.0/resource/properties/exist.json | 12 + .../resource/properties/inDesiredState.json | 11 + schemas/v3.0/resource/properties/purge.json | 11 + .../resource/properties/rebootRequested.json | 11 + schemas/v3/bundled/config/document.json | 398 ++++ .../v3/bundled/config/document.vscode.json | 617 +++++ schemas/v3/bundled/outputs/config/get.json | 333 +++ .../v3/bundled/outputs/config/get.vscode.json | 368 +++ schemas/v3/bundled/outputs/config/set.json | 349 +++ .../v3/bundled/outputs/config/set.vscode.json | 384 +++ schemas/v3/bundled/outputs/config/test.json | 355 +++ .../bundled/outputs/config/test.vscode.json | 390 ++++ schemas/v3/bundled/outputs/resource/get.json | 130 ++ .../bundled/outputs/resource/get.vscode.json | 156 ++ schemas/v3/bundled/outputs/resource/list.json | 1238 ++++++++++ .../bundled/outputs/resource/list.vscode.json | 2068 +++++++++++++++++ .../v3/bundled/outputs/resource/schema.json | 8 + .../outputs/resource/schema.vscode.json | 8 + schemas/v3/bundled/outputs/resource/set.json | 146 ++ .../bundled/outputs/resource/set.vscode.json | 172 ++ schemas/v3/bundled/outputs/resource/test.json | 152 ++ .../bundled/outputs/resource/test.vscode.json | 178 ++ schemas/v3/bundled/outputs/schema.json | 8 + schemas/v3/bundled/outputs/schema.vscode.json | 8 + schemas/v3/bundled/resource/manifest.json | 1126 +++++++++ .../v3/bundled/resource/manifest.vscode.json | 1956 ++++++++++++++++ schemas/v3/config/document.json | 55 + schemas/v3/config/document.metadata.json | 22 + schemas/v3/config/document.parameter.json | 228 ++ schemas/v3/config/document.resource.json | 34 + schemas/v3/definitions/commandArgs.json | 38 + schemas/v3/definitions/commandExecutable.json | 7 + schemas/v3/definitions/hadErrors.json | 7 + schemas/v3/definitions/inputKind.json | 11 + schemas/v3/definitions/instanceName.json | 9 + schemas/v3/definitions/message.json | 39 + schemas/v3/definitions/messages.json | 10 + .../v3/definitions/parameters/dataTypes.json | 16 + .../parameters/validValueTypes.json | 12 + schemas/v3/definitions/resourceKind.json | 13 + schemas/v3/definitions/resourceType.json | 8 + schemas/v3/definitions/returnKind.json | 12 + schemas/v3/definitions/semver.json | 9 + .../v3/metadata/Microsoft.DSC/context.json | 11 + .../v3/metadata/Microsoft.DSC/duration.json | 8 + .../metadata/Microsoft.DSC/endDatetime.json | 8 + .../metadata/Microsoft.DSC/executionType.json | 11 + .../v3/metadata/Microsoft.DSC/operation.json | 13 + .../Microsoft.DSC/securityContext.json | 12 + .../metadata/Microsoft.DSC/startDatetime.json | 8 + .../v3/metadata/Microsoft.DSC/version.json | 7 + .../metadata/configurationDocumentResult.json | 53 + .../v3/metadata/resourceInstanceResult.json | 25 + schemas/v3/outputs/config/get.json | 32 + schemas/v3/outputs/config/set.json | 32 + schemas/v3/outputs/config/test.json | 32 + schemas/v3/outputs/resource/get.full.json | 27 + schemas/v3/outputs/resource/get.json | 17 + schemas/v3/outputs/resource/get.simple.json | 17 + schemas/v3/outputs/resource/list.json | 112 + schemas/v3/outputs/resource/schema.json | 7 + schemas/v3/outputs/resource/set.full.json | 27 + schemas/v3/outputs/resource/set.json | 17 + schemas/v3/outputs/resource/set.simple.json | 33 + schemas/v3/outputs/resource/test.full.json | 27 + schemas/v3/outputs/resource/test.json | 17 + schemas/v3/outputs/resource/test.simple.json | 39 + schemas/v3/outputs/schema.json | 7 + schemas/v3/resource/manifest.adapter.json | 58 + schemas/v3/resource/manifest.delete.json | 67 + schemas/v3/resource/manifest.export.json | 67 + schemas/v3/resource/manifest.get.json | 67 + schemas/v3/resource/manifest.json | 155 ++ schemas/v3/resource/manifest.resolve.json | 67 + schemas/v3/resource/manifest.schema.json | 195 ++ schemas/v3/resource/manifest.set.json | 83 + schemas/v3/resource/manifest.test.json | 72 + schemas/v3/resource/manifest.validate.json | 67 + schemas/v3/resource/manifest.whatIf.json | 83 + schemas/v3/resource/properties/exist.json | 12 + .../resource/properties/inDesiredState.json | 11 + schemas/v3/resource/properties/purge.json | 11 + .../resource/properties/rebootRequested.json | 11 + 238 files changed, 38110 insertions(+), 1 deletion(-) create mode 100644 schemas/v3.0.0/bundled/config/document.json create mode 100644 schemas/v3.0.0/bundled/config/document.vscode.json create mode 100644 schemas/v3.0.0/bundled/outputs/config/get.json create mode 100644 schemas/v3.0.0/bundled/outputs/config/get.vscode.json create mode 100644 schemas/v3.0.0/bundled/outputs/config/set.json create mode 100644 schemas/v3.0.0/bundled/outputs/config/set.vscode.json create mode 100644 schemas/v3.0.0/bundled/outputs/config/test.json create mode 100644 schemas/v3.0.0/bundled/outputs/config/test.vscode.json create mode 100644 schemas/v3.0.0/bundled/outputs/resource/get.json create mode 100644 schemas/v3.0.0/bundled/outputs/resource/get.vscode.json create mode 100644 schemas/v3.0.0/bundled/outputs/resource/list.json create mode 100644 schemas/v3.0.0/bundled/outputs/resource/list.vscode.json create mode 100644 schemas/v3.0.0/bundled/outputs/resource/schema.json create mode 100644 schemas/v3.0.0/bundled/outputs/resource/schema.vscode.json create mode 100644 schemas/v3.0.0/bundled/outputs/resource/set.json create mode 100644 schemas/v3.0.0/bundled/outputs/resource/set.vscode.json create mode 100644 schemas/v3.0.0/bundled/outputs/resource/test.json create mode 100644 schemas/v3.0.0/bundled/outputs/resource/test.vscode.json create mode 100644 schemas/v3.0.0/bundled/outputs/schema.json create mode 100644 schemas/v3.0.0/bundled/outputs/schema.vscode.json create mode 100644 schemas/v3.0.0/bundled/resource/manifest.json create mode 100644 schemas/v3.0.0/bundled/resource/manifest.vscode.json create mode 100644 schemas/v3.0.0/config/document.json create mode 100644 schemas/v3.0.0/config/document.metadata.json create mode 100644 schemas/v3.0.0/config/document.parameter.json create mode 100644 schemas/v3.0.0/config/document.resource.json create mode 100644 schemas/v3.0.0/definitions/commandArgs.json create mode 100644 schemas/v3.0.0/definitions/commandExecutable.json create mode 100644 schemas/v3.0.0/definitions/hadErrors.json create mode 100644 schemas/v3.0.0/definitions/inputKind.json create mode 100644 schemas/v3.0.0/definitions/instanceName.json create mode 100644 schemas/v3.0.0/definitions/message.json create mode 100644 schemas/v3.0.0/definitions/messages.json create mode 100644 schemas/v3.0.0/definitions/parameters/dataTypes.json create mode 100644 schemas/v3.0.0/definitions/parameters/validValueTypes.json create mode 100644 schemas/v3.0.0/definitions/resourceKind.json create mode 100644 schemas/v3.0.0/definitions/resourceType.json create mode 100644 schemas/v3.0.0/definitions/returnKind.json create mode 100644 schemas/v3.0.0/definitions/semver.json create mode 100644 schemas/v3.0.0/metadata/Microsoft.DSC/context.json create mode 100644 schemas/v3.0.0/metadata/Microsoft.DSC/duration.json create mode 100644 schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json create mode 100644 schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json create mode 100644 schemas/v3.0.0/metadata/Microsoft.DSC/operation.json create mode 100644 schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json create mode 100644 schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json create mode 100644 schemas/v3.0.0/metadata/Microsoft.DSC/version.json create mode 100644 schemas/v3.0.0/metadata/configurationDocumentResult.json create mode 100644 schemas/v3.0.0/metadata/resourceInstanceResult.json create mode 100644 schemas/v3.0.0/outputs/config/get.json create mode 100644 schemas/v3.0.0/outputs/config/set.json create mode 100644 schemas/v3.0.0/outputs/config/test.json create mode 100644 schemas/v3.0.0/outputs/resource/get.full.json create mode 100644 schemas/v3.0.0/outputs/resource/get.json create mode 100644 schemas/v3.0.0/outputs/resource/get.simple.json create mode 100644 schemas/v3.0.0/outputs/resource/list.json create mode 100644 schemas/v3.0.0/outputs/resource/schema.json create mode 100644 schemas/v3.0.0/outputs/resource/set.full.json create mode 100644 schemas/v3.0.0/outputs/resource/set.json create mode 100644 schemas/v3.0.0/outputs/resource/set.simple.json create mode 100644 schemas/v3.0.0/outputs/resource/test.full.json create mode 100644 schemas/v3.0.0/outputs/resource/test.json create mode 100644 schemas/v3.0.0/outputs/resource/test.simple.json create mode 100644 schemas/v3.0.0/outputs/schema.json create mode 100644 schemas/v3.0.0/resource/manifest.adapter.json create mode 100644 schemas/v3.0.0/resource/manifest.delete.json create mode 100644 schemas/v3.0.0/resource/manifest.export.json create mode 100644 schemas/v3.0.0/resource/manifest.get.json create mode 100644 schemas/v3.0.0/resource/manifest.json create mode 100644 schemas/v3.0.0/resource/manifest.resolve.json create mode 100644 schemas/v3.0.0/resource/manifest.schema.json create mode 100644 schemas/v3.0.0/resource/manifest.set.json create mode 100644 schemas/v3.0.0/resource/manifest.test.json create mode 100644 schemas/v3.0.0/resource/manifest.validate.json create mode 100644 schemas/v3.0.0/resource/manifest.whatIf.json create mode 100644 schemas/v3.0.0/resource/properties/exist.json create mode 100644 schemas/v3.0.0/resource/properties/inDesiredState.json create mode 100644 schemas/v3.0.0/resource/properties/purge.json create mode 100644 schemas/v3.0.0/resource/properties/rebootRequested.json create mode 100644 schemas/v3.0/bundled/config/document.json create mode 100644 schemas/v3.0/bundled/config/document.vscode.json create mode 100644 schemas/v3.0/bundled/outputs/config/get.json create mode 100644 schemas/v3.0/bundled/outputs/config/get.vscode.json create mode 100644 schemas/v3.0/bundled/outputs/config/set.json create mode 100644 schemas/v3.0/bundled/outputs/config/set.vscode.json create mode 100644 schemas/v3.0/bundled/outputs/config/test.json create mode 100644 schemas/v3.0/bundled/outputs/config/test.vscode.json create mode 100644 schemas/v3.0/bundled/outputs/resource/get.json create mode 100644 schemas/v3.0/bundled/outputs/resource/get.vscode.json create mode 100644 schemas/v3.0/bundled/outputs/resource/list.json create mode 100644 schemas/v3.0/bundled/outputs/resource/list.vscode.json create mode 100644 schemas/v3.0/bundled/outputs/resource/schema.json create mode 100644 schemas/v3.0/bundled/outputs/resource/schema.vscode.json create mode 100644 schemas/v3.0/bundled/outputs/resource/set.json create mode 100644 schemas/v3.0/bundled/outputs/resource/set.vscode.json create mode 100644 schemas/v3.0/bundled/outputs/resource/test.json create mode 100644 schemas/v3.0/bundled/outputs/resource/test.vscode.json create mode 100644 schemas/v3.0/bundled/outputs/schema.json create mode 100644 schemas/v3.0/bundled/outputs/schema.vscode.json create mode 100644 schemas/v3.0/bundled/resource/manifest.json create mode 100644 schemas/v3.0/bundled/resource/manifest.vscode.json create mode 100644 schemas/v3.0/config/document.json create mode 100644 schemas/v3.0/config/document.metadata.json create mode 100644 schemas/v3.0/config/document.parameter.json create mode 100644 schemas/v3.0/config/document.resource.json create mode 100644 schemas/v3.0/definitions/commandArgs.json create mode 100644 schemas/v3.0/definitions/commandExecutable.json create mode 100644 schemas/v3.0/definitions/hadErrors.json create mode 100644 schemas/v3.0/definitions/inputKind.json create mode 100644 schemas/v3.0/definitions/instanceName.json create mode 100644 schemas/v3.0/definitions/message.json create mode 100644 schemas/v3.0/definitions/messages.json create mode 100644 schemas/v3.0/definitions/parameters/dataTypes.json create mode 100644 schemas/v3.0/definitions/parameters/validValueTypes.json create mode 100644 schemas/v3.0/definitions/resourceKind.json create mode 100644 schemas/v3.0/definitions/resourceType.json create mode 100644 schemas/v3.0/definitions/returnKind.json create mode 100644 schemas/v3.0/definitions/semver.json create mode 100644 schemas/v3.0/metadata/Microsoft.DSC/context.json create mode 100644 schemas/v3.0/metadata/Microsoft.DSC/duration.json create mode 100644 schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json create mode 100644 schemas/v3.0/metadata/Microsoft.DSC/executionType.json create mode 100644 schemas/v3.0/metadata/Microsoft.DSC/operation.json create mode 100644 schemas/v3.0/metadata/Microsoft.DSC/securityContext.json create mode 100644 schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json create mode 100644 schemas/v3.0/metadata/Microsoft.DSC/version.json create mode 100644 schemas/v3.0/metadata/configurationDocumentResult.json create mode 100644 schemas/v3.0/metadata/resourceInstanceResult.json create mode 100644 schemas/v3.0/outputs/config/get.json create mode 100644 schemas/v3.0/outputs/config/set.json create mode 100644 schemas/v3.0/outputs/config/test.json create mode 100644 schemas/v3.0/outputs/resource/get.full.json create mode 100644 schemas/v3.0/outputs/resource/get.json create mode 100644 schemas/v3.0/outputs/resource/get.simple.json create mode 100644 schemas/v3.0/outputs/resource/list.json create mode 100644 schemas/v3.0/outputs/resource/schema.json create mode 100644 schemas/v3.0/outputs/resource/set.full.json create mode 100644 schemas/v3.0/outputs/resource/set.json create mode 100644 schemas/v3.0/outputs/resource/set.simple.json create mode 100644 schemas/v3.0/outputs/resource/test.full.json create mode 100644 schemas/v3.0/outputs/resource/test.json create mode 100644 schemas/v3.0/outputs/resource/test.simple.json create mode 100644 schemas/v3.0/outputs/schema.json create mode 100644 schemas/v3.0/resource/manifest.adapter.json create mode 100644 schemas/v3.0/resource/manifest.delete.json create mode 100644 schemas/v3.0/resource/manifest.export.json create mode 100644 schemas/v3.0/resource/manifest.get.json create mode 100644 schemas/v3.0/resource/manifest.json create mode 100644 schemas/v3.0/resource/manifest.resolve.json create mode 100644 schemas/v3.0/resource/manifest.schema.json create mode 100644 schemas/v3.0/resource/manifest.set.json create mode 100644 schemas/v3.0/resource/manifest.test.json create mode 100644 schemas/v3.0/resource/manifest.validate.json create mode 100644 schemas/v3.0/resource/manifest.whatIf.json create mode 100644 schemas/v3.0/resource/properties/exist.json create mode 100644 schemas/v3.0/resource/properties/inDesiredState.json create mode 100644 schemas/v3.0/resource/properties/purge.json create mode 100644 schemas/v3.0/resource/properties/rebootRequested.json create mode 100644 schemas/v3/bundled/config/document.json create mode 100644 schemas/v3/bundled/config/document.vscode.json create mode 100644 schemas/v3/bundled/outputs/config/get.json create mode 100644 schemas/v3/bundled/outputs/config/get.vscode.json create mode 100644 schemas/v3/bundled/outputs/config/set.json create mode 100644 schemas/v3/bundled/outputs/config/set.vscode.json create mode 100644 schemas/v3/bundled/outputs/config/test.json create mode 100644 schemas/v3/bundled/outputs/config/test.vscode.json create mode 100644 schemas/v3/bundled/outputs/resource/get.json create mode 100644 schemas/v3/bundled/outputs/resource/get.vscode.json create mode 100644 schemas/v3/bundled/outputs/resource/list.json create mode 100644 schemas/v3/bundled/outputs/resource/list.vscode.json create mode 100644 schemas/v3/bundled/outputs/resource/schema.json create mode 100644 schemas/v3/bundled/outputs/resource/schema.vscode.json create mode 100644 schemas/v3/bundled/outputs/resource/set.json create mode 100644 schemas/v3/bundled/outputs/resource/set.vscode.json create mode 100644 schemas/v3/bundled/outputs/resource/test.json create mode 100644 schemas/v3/bundled/outputs/resource/test.vscode.json create mode 100644 schemas/v3/bundled/outputs/schema.json create mode 100644 schemas/v3/bundled/outputs/schema.vscode.json create mode 100644 schemas/v3/bundled/resource/manifest.json create mode 100644 schemas/v3/bundled/resource/manifest.vscode.json create mode 100644 schemas/v3/config/document.json create mode 100644 schemas/v3/config/document.metadata.json create mode 100644 schemas/v3/config/document.parameter.json create mode 100644 schemas/v3/config/document.resource.json create mode 100644 schemas/v3/definitions/commandArgs.json create mode 100644 schemas/v3/definitions/commandExecutable.json create mode 100644 schemas/v3/definitions/hadErrors.json create mode 100644 schemas/v3/definitions/inputKind.json create mode 100644 schemas/v3/definitions/instanceName.json create mode 100644 schemas/v3/definitions/message.json create mode 100644 schemas/v3/definitions/messages.json create mode 100644 schemas/v3/definitions/parameters/dataTypes.json create mode 100644 schemas/v3/definitions/parameters/validValueTypes.json create mode 100644 schemas/v3/definitions/resourceKind.json create mode 100644 schemas/v3/definitions/resourceType.json create mode 100644 schemas/v3/definitions/returnKind.json create mode 100644 schemas/v3/definitions/semver.json create mode 100644 schemas/v3/metadata/Microsoft.DSC/context.json create mode 100644 schemas/v3/metadata/Microsoft.DSC/duration.json create mode 100644 schemas/v3/metadata/Microsoft.DSC/endDatetime.json create mode 100644 schemas/v3/metadata/Microsoft.DSC/executionType.json create mode 100644 schemas/v3/metadata/Microsoft.DSC/operation.json create mode 100644 schemas/v3/metadata/Microsoft.DSC/securityContext.json create mode 100644 schemas/v3/metadata/Microsoft.DSC/startDatetime.json create mode 100644 schemas/v3/metadata/Microsoft.DSC/version.json create mode 100644 schemas/v3/metadata/configurationDocumentResult.json create mode 100644 schemas/v3/metadata/resourceInstanceResult.json create mode 100644 schemas/v3/outputs/config/get.json create mode 100644 schemas/v3/outputs/config/set.json create mode 100644 schemas/v3/outputs/config/test.json create mode 100644 schemas/v3/outputs/resource/get.full.json create mode 100644 schemas/v3/outputs/resource/get.json create mode 100644 schemas/v3/outputs/resource/get.simple.json create mode 100644 schemas/v3/outputs/resource/list.json create mode 100644 schemas/v3/outputs/resource/schema.json create mode 100644 schemas/v3/outputs/resource/set.full.json create mode 100644 schemas/v3/outputs/resource/set.json create mode 100644 schemas/v3/outputs/resource/set.simple.json create mode 100644 schemas/v3/outputs/resource/test.full.json create mode 100644 schemas/v3/outputs/resource/test.json create mode 100644 schemas/v3/outputs/resource/test.simple.json create mode 100644 schemas/v3/outputs/schema.json create mode 100644 schemas/v3/resource/manifest.adapter.json create mode 100644 schemas/v3/resource/manifest.delete.json create mode 100644 schemas/v3/resource/manifest.export.json create mode 100644 schemas/v3/resource/manifest.get.json create mode 100644 schemas/v3/resource/manifest.json create mode 100644 schemas/v3/resource/manifest.resolve.json create mode 100644 schemas/v3/resource/manifest.schema.json create mode 100644 schemas/v3/resource/manifest.set.json create mode 100644 schemas/v3/resource/manifest.test.json create mode 100644 schemas/v3/resource/manifest.validate.json create mode 100644 schemas/v3/resource/manifest.whatIf.json create mode 100644 schemas/v3/resource/properties/exist.json create mode 100644 schemas/v3/resource/properties/inDesiredState.json create mode 100644 schemas/v3/resource/properties/purge.json create mode 100644 schemas/v3/resource/properties/rebootRequested.json diff --git a/schemas/schemas.config.yaml b/schemas/schemas.config.yaml index f8d2a368..acc1081d 100644 --- a/schemas/schemas.config.yaml +++ b/schemas/schemas.config.yaml @@ -1,6 +1,6 @@ host: https://raw.githubusercontent.com prefix: PowerShell/DSC/main/schemas -version: 2024/04 +version: v3.0 docs_base_url: https://learn.microsoft.com/powershell/dsc docs_version_pin: view=dsc-3.0&preserve-view=true bundle_schemas: diff --git a/schemas/v3.0.0/bundled/config/document.json b/schemas/v3.0.0/bundled/config/document.json new file mode 100644 index 00000000..d079e24f --- /dev/null +++ b/schemas/v3.0.0/bundled/config/document.json @@ -0,0 +1,398 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json", + "title": "DSC Configuration Document schema", + "description": "Describes a valid DSC Configuration Document.", + "type": "object", + "required": [ + "$schema", + "resources" + ], + "properties": { + "$schema": { + "title": "Schema", + "description": "This property must be the canonical URL of the DSC Configuration Document schema that the document is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json" + ] + }, + "parameters": { + "title": "DSC Configuration document parameters", + "description": "Defines runtime options for the configuration. Users and integrating tools can override use the defined parameters to pass alternate values to the configuration.", + "type": "object", + "additionalProperties": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/config/document.parameter.json" + } + }, + "variables": { + "title": "Configuration variables", + "description": "Defines a set of reusable values for the configuration document. The names of this value's properties are the strings used to reference a variable's value.", + "type": "object" + }, + "resources": { + "title": "DSC Configuration document resources", + "description": "Defines a list of DSC Resource instances for the configuration to manage.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json" + } + }, + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/config/document.metadata.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.parameter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.parameter.json", + "title": "Parameter", + "description": "Defines a runtime option for a DSC Configuration Document.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/dataTypes.json" + }, + "defaultValue": { + "title": "Default value", + "description": "Defines the default value for the parameter.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/validValueTypes.json" + }, + "allowedValues": { + "title": "Allowed values", + "description": "Defines a list of valid values for the parameter. If the parameter is defined with any other values, it's invalid.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/validValueTypes.json" + } + }, + "description": { + "title": "Parameter description", + "description": "Defines a synopsis for the parameter explaining its purpose.", + "type": "string" + }, + "metadata": { + "title": "Parameter metadata", + "description": "Defines a set of key-value pairs for the parameter. This metadata isn't validated.", + "type": "object" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "minValue": { + "title": "Minimum value", + "description": "The minimum valid value for an integer type. If defined with the `maxValue` property, this value must be less than the value of `maxValue`.", + "type": "integer" + }, + "maxValue": { + "title": "Maximum value", + "description": "The maximum valid value for an integer type. If defined with the `minValue` property, this value must be greater than the value of `minValue`.", + "type": "integer" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + }, + { + "properties": { + "type": { + "const": "array" + } + } + } + ] + }, + "then": { + "properties": { + "minLength": { + "title": "Minimum length", + "description": "The minimum valid length for a `string`, `secureString`, or `array`. If defined with the `maxLength` property, this value must be less than the value of `maxLength`.", + "type": "integer", + "minimum": 0 + }, + "maxLength": { + "title": "Maximum length", + "description": "The maximum valid length for a `string`, `secureString`, or `array`. If defined with the `minLength` property, this value must be less than the value of `minLength`.", + "type": "integer", + "minimum": 0 + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "string" + }, + "allowedValues": { + "items": { + "type": "string" + } + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "object" + } + } + }, + { + "properties": { + "type": { + "const": "secureObject" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "object" + }, + "allowedValues": { + "items": { + "type": "object" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "integer" + }, + "allowedValues": { + "items": { + "type": "integer" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "array" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "bool" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "boolean" + }, + "allowedValues": { + "items": { + "type": "boolean" + } + } + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json", + "title": "DSC Resource instance", + "description": "Defines an instance of a DSC Resource in a configuration.", + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "dependsOn": { + "title": "Instance depends on", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", + "type": "array", + "items": { + "type": "string", + "uniqueItems": true, + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$" + } + }, + "properties": { + "title": "Managed instance properties", + "description": "Defines the properties of the DSC Resource this instance manages. This property's value must be an object. DSC validates the property's value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.metadata.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.metadata.json", + "title": "Configuration metadata", + "description": "Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` property, this metadata isn't validated. You can pass any data into this property of a configuration document.", + "type": "object", + "properties": { + "Microsoft.DSC": { + "type": "object", + "title": "DSC metadata", + "description": "The `Microsoft.DSC` metadata property contains directives and information that DSC itself uses when processing a configuration document. Unlike other metadata key-value pairs, DSC validates these properties.", + "unevaluatedProperties": false, + "properties": { + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "default": "Current", + "description": "This property defines the security context a configuration requires. If you invoke a DSC operation against the configuration document in a security context that conflicts with this metadata, DSC raises an error when it validates the configuration document.\nThe default security context is `Current`." + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/dataTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/dataTypes.json", + "title": "Data Types", + "description": "Defines the data type for the parameter value.", + "type": "string", + "enum": [ + "string", + "secureString", + "int", + "bool", + "object", + "secureObject", + "array" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/validValueTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/validValueTypes.json", + "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", + "type": [ + "string", + "integer", + "object", + "array", + "boolean" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + } + } +} diff --git a/schemas/v3.0.0/bundled/config/document.vscode.json b/schemas/v3.0.0/bundled/config/document.vscode.json new file mode 100644 index 00000000..39e897a7 --- /dev/null +++ b/schemas/v3.0.0/bundled/config/document.vscode.json @@ -0,0 +1,617 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json", + "title": "DSC Configuration Document schema", + "description": "Describes a valid DSC Configuration Document.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDescribes a valid DSC Configuration Document.\n\nDSC Configurations enable users to define state by combining different DSC Resources. A\nconfiguration document uses parameters and variables to pass to a set of one or more resources\nthat define a desired state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "$schema", + "resources" + ], + "properties": { + "$schema": { + "title": "Schema", + "description": "This property must be the canonical URL of the DSC Configuration Document schema that the document is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property must be the canonical URL of the DSC Configuration Document schema that the\ndocument is implemented for.\n\nFor every version of the schema, there are three valid urls:\n\n```yaml\n.../config/document.json\n```\n\n> The URL to the canonical non-bundled schema. When it's used for validation, the validating\n> client needs to retrieve this schema and every schema it references.\n \n```yaml\n.../bundled/config/document.json\n```\n\n> The URL to the bundled schema. When it's used for validation, the validating client only\n> needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n\n```yaml\n.../bundled/config/document.vscode.json\n```\n\n> The URL to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and snippets\n> that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#schema\n", + "markdownEnumDescriptions": [ + "\n\n> #### `v3.0.0` non-bundled\n>\n> Indicates that the configuration document adheres to the `v3.0.0` schema. This URL\n> points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `v3.0.0` bundled\n>\n> Indicates that the configuration document adheres to the `v3.0.0` schema. This URL\n> points to the bundled schema. When it's used for validation, the validating client\n> only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `v3.0.0` enhanced authoring\n>\n> Indicates that the configuration document adheres to the `v3.0.0` schema. This URL\n> points to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/10` non-bundled\n>\n> Indicates that the configuration document adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/10` bundled\n>\n> Indicates that the configuration document adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/10` enhanced authoring\n>\n> Indicates that the configuration document adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/08` non-bundled\n>\n> Indicates that the configuration document adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/08` bundled\n>\n> Indicates that the configuration document adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/08` enhanced authoring\n>\n> Indicates that the configuration document adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n" + ] + }, + "parameters": { + "title": "DSC Configuration document parameters", + "description": "Defines runtime options for the configuration. Users and integrating tools can override use the defined parameters to pass alternate values to the configuration.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/config/document.parameter.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines runtime options for the configuration. Users and integrating tools can override use\nthe defined parameters to pass alternate values to the configuration.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#parameters\n", + "defaultSnippets": [ + { + "label": " New Parameter", + "markdownDescription": "Defines a new runtime option for the configuration.\n\n```yaml\nparameterId:\n type: \n description: \n defaultValue: \n allowedValues:\n - \n```", + "body": { + "${1:parameterId}": { + "type": "$2", + "description": "$3", + "defaultValue": "$4", + "allowedValues": [ + "$5" + ] + } + } + }, + { + "label": " New Integer Parameter", + "markdownDescription": "Defines a new runtime option for the configuration as an integer value.\n\n```yaml\nparameterId:\n type: int\n description: \n defaultValue: \n minValue: \n minValue: \n```", + "body": { + "${1:parameterId}": { + "type": "int", + "description": "$2", + "defaultValue": "$3", + "minValue": "$4", + "maxValue": "$5" + } + } + } + ] + }, + "variables": { + "title": "Configuration variables", + "description": "Defines a set of reusable values for the configuration document. The names of this value's properties are the strings used to reference a variable's value.", + "type": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a set of reusable values for the configuration document. The names of this value's\nproperties are the strings used to reference a variable's value.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#variables\n", + "defaultSnippets": [ + { + "label": " New variable property", + "markdownDescription": "Defines a new variable as a key-value pair.\n\n```yaml\nvariableName: variableValue\n```", + "body": { + "${1:variableName}": "${2:variableValue}" + } + }, + { + "label": " New variable property (object)", + "markdownDescription": "Defines a new key-value pair for the variables where the value is an object.\n\n```yaml\nvariableName:\n key: value\n```", + "body": { + "${1:variableName}": { + "${2:key}": "${3:value}" + } + } + }, + { + "label": " New variable property (array)", + "markdownDescription": "Defines a new key-value pair for the variables where the value is an array.\n\n```yaml\nvariableName:\n - firstValue\n - secondValue\n```", + "body": { + "${1:variableName}": [ + "${2:firstValue}", + "${3:secondValue}" + ] + } + } + ] + }, + "resources": { + "title": "DSC Configuration document resources", + "description": "Defines a list of DSC Resource instances for the configuration to manage.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of DSC Resource instances for the configuration to manage.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#resources\n" + }, + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/config/document.metadata.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0.0": { + "config": { + "document.parameter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.parameter.json", + "title": "Parameter", + "description": "Defines a runtime option for a DSC Configuration Document.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a runtime option for a DSC Configuration Document.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/dataTypes.json" + }, + "defaultValue": { + "title": "Default value", + "description": "Defines the default value for the parameter.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/validValueTypes.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the default value for the parameter.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#allowedvalues\n" + }, + "allowedValues": { + "title": "Allowed values", + "description": "Defines a list of valid values for the parameter. If the parameter is defined with any other values, it's invalid.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/validValueTypes.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of valid values for the parameter. If the parameter is defined with any other\nvalues, it's invalid.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#allowedvalues\n" + }, + "description": { + "title": "Parameter description", + "description": "Defines a synopsis for the parameter explaining its purpose.", + "type": "string", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a synopsis for the parameter explaining its purpose.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#description-1\n" + }, + "metadata": { + "title": "Parameter metadata", + "description": "Defines a set of key-value pairs for the parameter. This metadata isn't validated.", + "type": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a set of key-value pairs for the parameter. This metadata isn't validated.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#metadata-1\n", + "defaultSnippets": [ + { + "label": " New metadata property", + "markdownDescription": "Defines a key-value pair for the metadata:\n\n```yaml\nmetadataName: value\n```", + "body": { + "${1:metadataName}": "${2:value}" + } + }, + { + "label": " New metadata property (object)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an object.\n\n```yaml\nmetadataName:\n key: value\n```", + "body": { + "${1:metadataName}": { + "${2:key}": "${3:value}" + } + } + }, + { + "label": " New metadata property (array)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an array.\n\n```yaml\nmetadataName:\n - firstValue\n - secondValue\n```", + "body": { + "${1:metadataName}": [ + "${2:firstValue}", + "${3:secondValue}" + ] + } + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "minValue": { + "title": "Minimum value", + "description": "The minimum valid value for an integer type. If defined with the `maxValue` property, this value must be less than the value of `maxValue`.", + "type": "integer", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe minimum valid value for an integer type. If defined with the `maxValue` property,\nthis value must be less than the value of `maxValue`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#minvalue\n" + }, + "maxValue": { + "title": "Maximum value", + "description": "The maximum valid value for an integer type. If defined with the `minValue` property, this value must be greater than the value of `minValue`.", + "type": "integer", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe maximum valid value for an integer type. If defined with the `minValue` property,\nthis value must be greater than the value of `minValue`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#maxvalue\n" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + }, + { + "properties": { + "type": { + "const": "array" + } + } + } + ] + }, + "then": { + "properties": { + "minLength": { + "title": "Minimum length", + "description": "The minimum valid length for a `string`, `secureString`, or `array`. If defined with the `maxLength` property, this value must be less than the value of `maxLength`.", + "type": "integer", + "minimum": 0, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe minimum valid length for a `string`, `secureString`, or `array`. If defined with\nthe `maxLength` property, this value must be less than the value of `maxLength`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#minLength\n" + }, + "maxLength": { + "title": "Maximum length", + "description": "The maximum valid length for a `string`, `secureString`, or `array`. If defined with the `minLength` property, this value must be less than the value of `minLength`.", + "type": "integer", + "minimum": 0, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe maximum valid length for a `string`, `secureString`, or `array`. If defined with\nthe `minLength` property, this value must be less than the value of `minLength`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#maxLength\n" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "string" + }, + "allowedValues": { + "items": { + "type": "string" + } + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "object" + } + } + }, + { + "properties": { + "type": { + "const": "secureObject" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "object" + }, + "allowedValues": { + "items": { + "type": "object" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "integer" + }, + "allowedValues": { + "items": { + "type": "integer" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "array" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "bool" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "boolean" + }, + "allowedValues": { + "items": { + "type": "boolean" + } + } + } + } + } + ] + }, + "document.resource.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json", + "title": "DSC Resource instance", + "description": "Defines an instance of a DSC Resource in a configuration.", + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "dependsOn": { + "title": "Instance depends on", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", + "type": "array", + "items": { + "type": "string", + "uniqueItems": true, + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$", + "patternErrorMessage": "Invalid value, must be a value like `[resourceId('', '`)], such as\n`[resourceId('Microsoft/OSInfo', 'Foo')]`.\n\nThe `` and `` should be the fully qualified type of the resource and its\nfriendly name in the configuration.\n", + "defaultSnippets": [ + { + "label": " New dependency", + "markdownDescription": "Defines a new dependency for the resource instance.\n\n```yaml\n\"[resourceId('dependencyInstance/Type', 'dependencyInstanceName')]\"\n```", + "bodyText": "\"[resourceId('${3:dependencyInstance/Type}', '${4:dependencyInstanceName}')]\"" + } + ] + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of DSC Resource instances that DSC must successfully process before processing\nthis instance. Each value for this property must be the `resourceID()` lookup for another\ninstance in the configuration. Multiple instances can depend on the same instance, but every\ndependency for an instance must be unique in that instance's `dependsOn` property.\n\nThe `resourceID()` function uses this syntax:\n\n```yaml\n\"[resourceId('', '']\"\n```\n\nThe `` value is the `type` property of the dependent resource and\n`` is the dependency's `name` property. When adding a dependency in a\nYAML-format configuration document, always wrap the `resourceID()` lookup in double quotes\n(`\"`).\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#properties-1\n" + }, + "properties": { + "title": "Managed instance properties", + "description": "Defines the properties of the DSC Resource this instance manages. This property's value must be an object. DSC validates the property's value against the DSC Resource's schema.", + "type": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the properties of the DSC Resource this instance manages. This property's value must\nbe an object. DSC validates the property's value against the DSC Resource's schema.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#properties-1\n" + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an instance of a DSC Resource in a configuration.\n\nThe `resources` property of a DSC Configuration document always includes at least one DSC Resource\ninstance. Together, the instances in a configuration define the desired state that DSC can get,\ntest, and set on a machine.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " New resource instance", + "markdownDescription": "Defines a new instance of a DSC Resource for the configuration.\n\n```yaml\ntype: owner[.group][.area]/name\nname: instance_name\nproperties:\n propertyName: propertyValue\n```", + "body": { + "type": "${1:owner[.group][.area]/name}", + "name": "${2:instance_name}", + "properties": { + "${3:propertyName}": "${4:propertyValue}" + } + } + }, + { + "label": " New dependent resource instance", + "markdownDescription": "Defines a new instance of a DSC Resource for the configuration that depends on another\ninstance.\n\n```yaml\ntype: owner[.group][.area]/name\nname: instance_name\ndependsOn:\n - \"[resourceId('dependencyInstance/Type', 'dependencyInstanceName')]\"\nproperties:\n propertyName: propertyValue\n```", + "body": { + "type": "${1:owner[.group][.area]/name}", + "name": "${2:instance_name}", + "dependsOn": [ + "\"[resourceId('${3:dependencyInstance/Type}', '${4:dependencyInstanceName}')]\"" + ], + "properties": { + "${5:propertyName}": "${6:propertyValue}" + } + } + } + ] + }, + "document.metadata.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.metadata.json", + "title": "Configuration metadata", + "description": "Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` property, this metadata isn't validated. You can pass any data into this property of a configuration document.", + "type": "object", + "properties": { + "Microsoft.DSC": { + "type": "object", + "title": "DSC metadata", + "description": "The `Microsoft.DSC` metadata property contains directives and information that DSC itself uses when processing a configuration document. Unlike other metadata key-value pairs, DSC validates these properties.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe `Microsoft.DSC` metadata property contains directives and information that DSC itself\nuses when processing a configuration document. Unlike other metadata key-value pairs, DSC\nvalidates these properties.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true#microsoft.dsc\n", + "unevaluatedProperties": false, + "properties": { + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "default": "Current", + "description": "This property defines the security context a configuration requires. If you invoke a DSC operation against the configuration document in a security context that conflicts with this metadata, DSC raises an error when it validates the configuration document.\nThe default security context is `Current`.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property defines the security context a configuration requires. If you invoke a DSC\noperation against the configuration document in a security context that conflicts with\nthis metadata, DSC raises an error when it validates the configuration document.\n\nThe default security context is `Current`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true#microsoft.dsc\n", + "markdownEnumDescriptions": [ + "\n\n> ### Current security context\n>\n> Indicates that the configuration document is usable under any security context. You\n> can invoke DSC operations against the document when elevated as root or an\n> administrator and as a normal user or account.\n", + "\n\n> ### Elevated security context\n>\n> Indicates that the configuration document is usable only in an elevated security\n> context. You can invoke DSC operations against the document when elevated as root or\n> an administrator. When you invoke DSC operations against the document as a\n> non-elevated user or account, DSC raises an error when it validates the configuration\n> document.\n", + "\n\n> ### Restricted security context\n>\n> Indicates that the configuration document is usable only in a non-elevated security\n> context. You can invoke DSC operations against the document as a non-elevated user or\n> account. When you invoke DSC operations against the document as root or an\n> administrator, DSC raises an error when it validates the configuration document.\n" + ] + } + } + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC`\nproperty, this metadata isn't validated. You can pass any data into this property of a\nconfiguration document.\n\nThe `Microsoft.DSC` metadata property contains metadata directives and information that DSC\nitself uses when processing the configuration document. For more information, see\n[Microsoft.DSC][02]\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true#microsoft.dsc\n", + "defaultSnippets": [ + { + "label": " New metadata property", + "markdownDescription": "Defines a key-value pair for the metadata:\n\n```yaml\nmetadataName: value\n```", + "body": { + "${1:metadataName}": "${2:value}" + } + }, + { + "label": " New metadata property (object)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an object.\n\n```yaml\nmetadataName:\n key: value\n```", + "body": { + "${1:metadataName}": { + "${2:key}": "${3:value}" + } + } + }, + { + "label": " New metadata property (array)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an array.\n\n```yaml\nmetadataName:\n - firstValue\n - secondValue\n```", + "body": { + "${1:metadataName}": [ + "${2:firstValue}", + "${3:secondValue}" + ] + } + } + ] + } + }, + "definitions": { + "parameters": { + "dataTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/dataTypes.json", + "title": "Data Types", + "description": "Defines the data type for the parameter value.", + "type": "string", + "enum": [ + "string", + "secureString", + "int", + "bool", + "object", + "secureObject", + "array" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the data type for the parameter value.\n\nThe valid data types for a parameter are:\n\n- `array` for arrays\n- `bool` for booleans\n- `int` for integers\n- `object` for objects\n- `string` for strings\n- `secureObject` for secure objects\n- `secureString` for secure strings\n\nAccess parameters in a configuration using this syntax:\n\n```yaml\n\"[parameter('')]\"\n```\n\nIn YAML, the parameter syntax needs to be enclosed in double-quotes when used as an inline value.\nIf the syntax isn't quoted, YAML interprets the syntax as an array.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true\n", + "markdownEnumDescriptions": [ + "_Strings are an arbitrary set of text._\n\n> To define a long strings in YAML, use the folded block syntax or literal block syntax by\n> adding a `>` or `|` and a line break after the key. Then, indent the next line. Every line\n> in the string must start at the same level of indentation. You can trim the trailing\n> whitespace by using `>-` or `|-` instead.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#strings\n", + "_Secure strings are text that needs to be handled securely._\n\n> Secure strings are an arbitrary set of text that DSC and integrating tools shouldn't log or\n> record. If a secure data type parameter is used for a resource instance property that doesn't\n> expect a secure value, the resource may still log or record the value. If the resource has\n> independent logging or recording that isn't handled by DSC, the value may be stored\n> insecurely.\n>\n> Use secure strings for passwords and secrets. Never define a default value for secure string\n> parameters.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#secure-strings-and-objects\n", + "_Integer values are numbers without a fractional part._\n\n> Integer values may be limited by integrating tools or the DSC Resources they're used with.\n> DSC itself supports integer values between `-9223372036854775808` and `9223372036854775807`.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#integers\n", + "_Boolean values are either `true` or `false`._\n\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#booleans\n", + "_Objects define a set of key-value pairs._\n\n> The value for each key can be any valid data type. The values can be the same type or\n> different types.\n>\n> Access keys in the object using dot-notation. Dot-notation uses this syntax:\n>\n> ```yaml\n> \"[parameters('').]\n> ```\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#objects\n", + "_Secure objects are key-value pairs that need to be handled securely._\n\n> Secure objects define a set of key-value pairs that DSC and integrating tools shouldn't log\n> or record. If a secure data type parameter is used for a resource instance property that\n> doesn't expect a secure value, the resource may still log or record the value. If the\n> resource has independent logging or recording that isn't handled by DSC, the value may be\n> stored insecurely.\n>\n> Never define a default value for secure object parameters.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#secure-strings-and-objects\n", + "_Arrays are a list of one or more values._\n\n> The values in the array can be any valid data type. Values in the array can be the same type\n> or different types.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#arrays\n" + ] + }, + "validValueTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/validValueTypes.json", + "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", + "type": [ + "string", + "integer", + "object", + "array", + "boolean" + ] + } + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + } + }, + "metadata": { + "Microsoft.DSC": { + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/config/get.json b/schemas/v3.0.0/bundled/outputs/config/get.json new file mode 100644 index 00000000..87fb0dcb --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/config/get.json @@ -0,0 +1,333 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/get.json", + "title": "DSC Configuration get command result", + "description": "Represents the data structure returned by the `dsc config get` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `get` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json" + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/config/get.vscode.json b/schemas/v3.0.0/bundled/outputs/config/get.vscode.json new file mode 100644 index 00000000..3ffa6bee --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/config/get.vscode.json @@ -0,0 +1,368 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/get.json", + "title": "DSC Configuration get command result", + "description": "Represents the data structure returned by the `dsc config get` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `get` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json" + } + }, + "messages": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0.0": { + "metadata": { + "configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "Microsoft.DSC": { + "version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "markdownDescription": "Defines the version of DSC that ran the command. This value is always the semantic version of the\nDSC command, like `3.0.0-preview.7`.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "markdownDescription": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or\n`Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "markdownDescription": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf`\nmode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set`\noperations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the start date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the end date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "markdownDescription": "Defines whether the operation was for a configuration or a resource. If the value for this\nmetadata property is `configuration`, DSC was run through the `dsc config` command. If the value\nis `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + } + }, + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + } + }, + "outputs": { + "resource": { + "get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json" + } + } + }, + "get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json" + } + } + ] + }, + "get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + } + } + }, + "definitions": { + "messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json" + } + }, + "hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/config/set.json b/schemas/v3.0.0/bundled/outputs/config/set.json new file mode 100644 index 00000000..fca92e4c --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/config/set.json @@ -0,0 +1,349 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/set.json", + "title": "DSC Configuration set command result", + "description": "Represents the data structure returned by the `dsc config set` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `set` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json" + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/config/set.vscode.json b/schemas/v3.0.0/bundled/outputs/config/set.vscode.json new file mode 100644 index 00000000..783547b1 --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/config/set.vscode.json @@ -0,0 +1,384 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/set.json", + "title": "DSC Configuration set command result", + "description": "Represents the data structure returned by the `dsc config set` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `set` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json" + } + }, + "messages": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0.0": { + "metadata": { + "configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "Microsoft.DSC": { + "version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "markdownDescription": "Defines the version of DSC that ran the command. This value is always the semantic version of the\nDSC command, like `3.0.0-preview.7`.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "markdownDescription": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or\n`Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "markdownDescription": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf`\nmode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set`\noperations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the start date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the end date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "markdownDescription": "Defines whether the operation was for a configuration or a resource. If the value for this\nmetadata property is `configuration`, DSC was run through the `dsc config` command. If the value\nis `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + } + }, + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + } + }, + "outputs": { + "resource": { + "set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json" + } + } + }, + "set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json" + } + } + ] + }, + "set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json" + } + }, + "hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/config/test.json b/schemas/v3.0.0/bundled/outputs/config/test.json new file mode 100644 index 00000000..4f5af499 --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/config/test.json @@ -0,0 +1,355 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/test.json", + "title": "DSC Configuration test command result", + "description": "Represents the data structure returned by the `dsc config test` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `test` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json" + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/config/test.vscode.json b/schemas/v3.0.0/bundled/outputs/config/test.vscode.json new file mode 100644 index 00000000..48023b4b --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/config/test.vscode.json @@ -0,0 +1,390 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/test.json", + "title": "DSC Configuration test command result", + "description": "Represents the data structure returned by the `dsc config test` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `test` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json" + } + }, + "messages": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0.0": { + "metadata": { + "configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "Microsoft.DSC": { + "version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "markdownDescription": "Defines the version of DSC that ran the command. This value is always the semantic version of the\nDSC command, like `3.0.0-preview.7`.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "markdownDescription": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or\n`Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "markdownDescription": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf`\nmode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set`\noperations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the start date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the end date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "markdownDescription": "Defines whether the operation was for a configuration or a resource. If the value for this\nmetadata property is `configuration`, DSC was run through the `dsc config` command. If the value\nis `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + } + }, + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + } + }, + "outputs": { + "resource": { + "test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json" + } + } + }, + "test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json" + } + } + ] + }, + "test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json" + } + }, + "hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/resource/get.json b/schemas/v3.0.0/bundled/outputs/resource/get.json new file mode 100644 index 00000000..9e09a67a --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/resource/get.json @@ -0,0 +1,130 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json" + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/resource/get.vscode.json b/schemas/v3.0.0/bundled/outputs/resource/get.vscode.json new file mode 100644 index 00000000..8c5a2a9d --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/resource/get.vscode.json @@ -0,0 +1,156 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json" + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0.0": { + "outputs": { + "resource": { + "get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json" + } + } + }, + "get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json" + } + } + ] + } + } + }, + "metadata": { + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "Microsoft.DSC": { + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } + }, + "definitions": { + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/resource/list.json b/schemas/v3.0.0/bundled/outputs/resource/list.json new file mode 100644 index 00000000..3fb4b23e --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/resource/list.json @@ -0,0 +1,1238 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/list.json", + "title": "dsc resource list result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource list` command.", + "type": "object", + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json" + }, + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "capabilities": { + "title": "Resource capabilities", + "description": "Defines the list of DSC operations the resource is compatible with. If the resource doesn't list a given operation, like `set` or `export`, the resource can't be used for those operations. The exception to this is `test` - DSC uses synthetic testing for resources that don't have the `test` capability.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "get", + "set", + "setHandlesExist", + "whatIf", + "test", + "delete", + "export", + "resolve" + ] + } + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "path": { + "title": "Path", + "description": "Indicates the path to the DSC Resource on the file system.", + "type": "string" + }, + "directory": { + "title": "Directory", + "description": "Indicates the path to the folder containing the DSC Resource on the file system.", + "type": "string" + }, + "implementedAs": { + "title": "Implemented as", + "description": "Indicates how the DSC Resource was implemented.", + "oneOf": [ + { + "title": "Standard implementation", + "description": "Indicates that the DSC Resource is implemented as one of the standard implementations built into DSC.", + "type": "string", + "enum": [ + "command" + ] + }, + { + "title": "Custom implementation", + "description": "Indicates that the DSC Resource uses a custom implementation.", + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "title": "Custom implementation name", + "description": "The name of the custom implementation.", + "type": "string" + } + } + } + ] + }, + "author": { + "title": "Author", + "description": "Indicates the name of the person or organization that developed and maintains the DSC Resource.", + "type": [ + "string", + "null" + ] + }, + "properties": { + "title": "Properties", + "description": "Defines the DSC Resource's property names.", + "type": "array", + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "requireAdapter": { + "title": "Required DSC Resource Adapter", + "description": "Defines the fully qualified type name of the DSC Resource Adapter the DSC Resource depends on.", + "oneOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + { + "type": "null" + } + ] + }, + "manifest": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ] + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "get": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json" + }, + "set": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json" + }, + "delete": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json" + }, + "export": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json" + }, + "validate": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] + }, + "schema": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources." + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource." + } + } + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": {}, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json" + } + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json" + } + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json" + } + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json" + } + } + } + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command." + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json", + "title": "Instance should exist", + "description": "Indicates whether the DSC Resource instance should exist.", + "type": "boolean", + "default": true, + "enum": [ + false, + true + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json", + "title": "Instance is in the Desired State", + "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json", + "title": "Purge", + "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", + "type": [ + "boolean", + "null" + ], + "writeOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json", + "title": "Reboot Requested", + "description": "Indicates that the set operation requires a reboot before it's fully complete.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/resource/list.vscode.json b/schemas/v3.0.0/bundled/outputs/resource/list.vscode.json new file mode 100644 index 00000000..872d2295 --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/resource/list.vscode.json @@ -0,0 +1,2068 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/list.json", + "title": "dsc resource list result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource list` command.", + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "kind": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json" + }, + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "capabilities": { + "title": "Resource capabilities", + "description": "Defines the list of DSC operations the resource is compatible with. If the resource doesn't list a given operation, like `set` or `export`, the resource can't be used for those operations. The exception to this is `test` - DSC uses synthetic testing for resources that don't have the `test` capability.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "get", + "set", + "setHandlesExist", + "whatIf", + "test", + "delete", + "export", + "resolve" + ] + } + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "path": { + "title": "Path", + "description": "Indicates the path to the DSC Resource on the file system.", + "type": "string" + }, + "directory": { + "title": "Directory", + "description": "Indicates the path to the folder containing the DSC Resource on the file system.", + "type": "string" + }, + "implementedAs": { + "title": "Implemented as", + "description": "Indicates how the DSC Resource was implemented.", + "oneOf": [ + { + "title": "Standard implementation", + "description": "Indicates that the DSC Resource is implemented as one of the standard implementations built into DSC.", + "type": "string", + "enum": [ + "command" + ] + }, + { + "title": "Custom implementation", + "description": "Indicates that the DSC Resource uses a custom implementation.", + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "title": "Custom implementation name", + "description": "The name of the custom implementation.", + "type": "string" + } + } + } + ] + }, + "author": { + "title": "Author", + "description": "Indicates the name of the person or organization that developed and maintains the DSC Resource.", + "type": [ + "string", + "null" + ] + }, + "properties": { + "title": "Properties", + "description": "Defines the DSC Resource's property names.", + "type": "array", + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "requireAdapter": { + "title": "Required DSC Resource Adapter", + "description": "Defines the fully qualified type name of the DSC Resource Adapter the DSC Resource depends on.", + "oneOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + { + "type": "null" + } + ] + }, + "manifest": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0.0": { + "definitions": { + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the resource is a normal DSC Resource, a group resource, or an adapter\nresource. This property is only required for group resources.\n\nDSC infers the default value for this property based on whether the [adapter][02] property is\ndefined in the manifest:\n\n- If the `adapter` property is defined in the manifest, the default `kind` is `Adapter`.\n- If the `adapter` property is not defined in the manifest, the default `kind` is `Resource`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "markdownEnumDescriptions": [ + "\n\nIndicates that the manifest is for a standard command-based DSC Resource.\n", + "\n\nIndicates that the manifest is for an adapter resource that enables the use of\nnon-command-based resources with DSC.\n", + "\n\nIndicates that the manifest is for a group resource that processes an array of nested\nresource instances.\n", + "\n\nIndicates that the manifest is for an import resource that resolves an external source to DSC\nresource instances. The resolved instances are processed as nested instances for the import\nresource.\n" + ] + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "defaultSnippets": [ + { + "label": "String argument", + "markdownDescription": "Add a string argument to the command, like `config` or `--config`.", + "body": "${1:argument_name}" + }, + { + "label": "JSON input argument", + "markdownDescription": "Add a JSON input argument to the command. A command can only define one JSON input argument\nin the `args` list. When you define a JSON input argument, DSC passes the input data for\nthe command to the specified argument as a string representing the data as a compressed\nJSON object. The compressed JSON object doesn't have any spaces or newlines between the\nobject properties and values.\n\nIf the command doesn't define the `input` property, it must define a JSON input argument.\n\nIf the command defines both the `input` property and a JSON input argument, DSC sends the\ninput data to the command in both ways. For example, if the command defines `input` as\n`stdin` and has a JSON input argument in `args`, DSC sends the input data as a compressed\nJSON object over stdin and to the the specified argument.", + "body": { + "jsonInputArg": "${1:argument_name}", + "mandatory": "^$2" + } + } + ], + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command.", + "markdownDescription": "Any item in the argument array can be a string representing a static argument to pass to\nthe command.\n" + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "markdownDescription": "Defines an argument for the command that accepts the JSON input object as a string. DSC\npasses the JSON input to the named argument when available. You can define the `mandatory`\nproperty to indicate whether DSC should always pass the argument to the command, even when\nthere's no JSON input for the command. In that case, DSC passes an empty string to the\nJSON input argument. You can only define one JSON input argument per arguments array.\n\nIf you define a JSON input argument and an `input` kind for a command, DSC sends the JSON\ndata both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "markdownDescription": "Defines the argument that accepts the JSON property bag for the resource as input.\n", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "markdownDescription": "Defines whether the argument is mandatory. If this property is set to `true`, DSC\npasses an empty string when no JSON input is provided. The default value is `false`.\n", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ], + "markdownEnumDescriptions": [ + "_Environment variables_\n\n> Indicates that the resource expects the properties of an instance to be specified as\n> environment variables with the same names and casing.\n>\n> This option only supports the following data types for instance properties:\n>\n> - `boolean`\n> - `integer`\n> - `number`\n> - `string`\n> - `array` of `integer` values\n> - `array` of `number` values\n> - `array` of `string` values\n>\n> For non-array values, DSC sets the environment variable to the specified value as-is. When\n> the data type is an array of values, DSC sets the environment variable as a comma-delimited\n> string. For example, the property `foo` with a value of `[1, 2, 3]` is saved in the `foo`\n> environment variable as `\"1,2,3\"`.\n>\n> If the resource needs to support complex properties with an `object` value or multi-type\n> arrays, set this to `stdin` instead.\n", + "_JSON over `stdin`_\n\n> Indicates that the resource expects a JSON blob representing an instance from `stdin`.\n> The JSON must adhere to the instance schema.\n" + ] + }, + "returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + } + }, + "resource": { + "manifest.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the information DSC and integrating require to process and call a command-based DSC\nResource. For DSC to use a manifest on a system, the manifest file must:\n\n1. Be discoverable in the `PATH` environment variable.\n1. Follow the naming convention `.dsc.resource.json`.\n1. Be valid for this schema.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define a resource", + "markdownDescription": "Defines a standard resource that:\n\n- Can get the current state of an instance\n- Can set an instance to the desired state\n- Relies on DSC's synthetic testing to determine whether an instance is in the desired state\n- Defines an embedded JSON schema.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "set": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "implementsPretest": "^${11:false}", + "return": "${12:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (group)", + "markdownDescription": "Defines a group resource that expects a list of resource instances and operates on them.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "group", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${18|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${19:Resources}", + "description": "${20:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json" + } + }, + "${21:name}": { + "title": "${22:property title}", + "description": "${23:explanation of property purpose and usage}", + "type": "${24|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (adapter)", + "markdownDescription": "Defines an adapter resource that enables users to define non-command-based DSC Resources in\nthe configuration.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "adapter", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "adapter": { + "config": "${18|full,sequence|}", + "list": { + "executable": "${19:executable name}", + "args": [ + "${20:argument}" + ] + } + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${23|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${24:Resources}", + "description": "${25:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json" + } + }, + "${26:name}": { + "title": "${27:property title}", + "description": "${28:explanation of property purpose and usage}", + "type": "${29|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (importer)", + "markdownDescription": "Defines an importer resource that can resolve an external source to nested resource\ninstances.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "importer", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "resolve": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (assertion-only)", + "markdownDescription": "Defines an assertion resource that can get the current state of an instance but not configure\nit. By default, the resource relies on DSC's synthetic testing feature. If the resource\nimplements the `test` operation itself, define the `test` property.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + } + ], + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property must be one of the canonical URLs for the version of the Command-based DSC\nResource Manifest schema that the manifest is implemented for.\n\nFor every version of the schema, there are three valid urls:\n\n```yaml\n.../resource/manifest.json\n```\n\n> The URL to the canonical non-bundled schema. When it's used for validation, the validating\n> client needs to retrieve this schema and every schema it references.\n\n```yaml\n.../bundled/resource/manifest.json\n```\n\n> The URL to the bundled schema. When it's used for validation, the validating client only\n> needs to retrieve this schema.\n> \n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n\n```yaml\n.../bundled/resource/manifest.vscode.json\n```\n\n> The URL to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and snippets\n> that the others don't include.\n> \n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#schema\n", + "markdownEnumDescriptions": [ + "\n\n> #### `v3.0.0` non-bundled\n>\n> Indicates that the resource manifest adheres to the `v3.0.0` schema. This URL\n> points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `v3.0.0` bundled\n>\n> Indicates that the resource manifest adheres to the `v3.0.0` schema. This URL\n> points to the bundled schema. When it's used for validation, the validating client\n> only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `v3.0.0` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `v3.0.0` schema. This URL\n> points to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/10` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/10` bundled\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0.0` of the schema.\n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/10` enhanced authoring\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0.0` of the schema.\n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/08` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/08` bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/08` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n" + ] + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe semantic version ([semver][02]) of the DSC Resource. This version identifies the DSC\nResource, not the version of the application it manages.\n\nThis value uses the [suggested regular expression][03] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#version\n[02]: https://semver.org/\n[03]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a short synopsis of the DSC Resource's purpose.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#description-1\n" + }, + "kind": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of searchable terms for the resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#tags\n", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$", + "patternErrorMessage": "Invalid tag. Tags must be a string of alphanumeric characters and underscores. No other\ncharacters are permitted.\n" + } + }, + "get": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json" + }, + "set": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json" + }, + "delete": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json" + }, + "export": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json" + }, + "validate": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$", + "patternErrorMessage": "Invalid exit code. Must be a string representing a 32-bit signed integer.\n" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property defines a map of valid exit codes for the DSC Resource. DSC always interprets\nexit code `0` as a successful operation and any other exit code as an error. Use this\nproperty to indicate human-readable semantic meanings for the DSC Resource's exit codes.\n\nDefine the keys in this property as strings representing a valid 32-bit signed integer. You\ncan't use alternate formats for the exit code. For example, instead of the hexadecimal value\n`0x80070005` for \"Access denied\", specify the exit code as `-2147024891`. If you're authoring\nyour resource manifest in yaml, be sure to wrap the exit code in single quotes, like\n`'0': Success` instead of `0: Success` to ensure the YAML file can be parsed correctly.\n\nDefine the value for each key as a string explaining what the exit code indicates.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#exitcodes\n", + "defaultSnippets": [ + { + "label": " Defined exit codes", + "description": "Defines exit codes with semantic meaning for the resource.", + "body": { + "0": "Success", + "${1:first exit code number}": "${2:first exit code meaning}", + "${3:second exit code number}": "${4:second exit code meaning}" + } + } + ] + }, + "schema": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ] + }, + "manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of an instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"get\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property. When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"get\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `get` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `get` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `get` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `get` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `get` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to set the desired state of an instance and how to\nprocess the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set` command. Set this value to `true` if the DSC Resource tests input before modifying\nsystem state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set` command where the instance defines the `_exist` property as `false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's state after the set\noperation or the state and an array of the properties the DSC Resource modified.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's final state after the set\n> operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's final state and an array of property\n> names that the resource modified.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `set` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `set` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `set` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `set` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `set` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to indicate whether and how the set command will\nmodify an instance and how to process the output from the DSC Resource. If a resource doesn't\ndefine this method in the manifest, DSC synthesizes this behavior by converting the result of\nthe test operation for the resource into the [set result][02].\n\nThis method definition has the same structure as the [set method][03] in the resource manifest.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/outputs/resource/set?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\", \"--what-if\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n \"--what-if\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set --what-if` command . Set this value to `true` if the DSC Resource tests input before\nprocessing how it will modify system state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set --what-if` command where the instance defines the `_exist` property as\n`false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's expected state after a\nset operation in what-if mode or the state and an array of the properties the DSC Resource\nwould modify.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's expected final state after the\n> set operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's expected final state and an array of\n> property names that the resource would modify.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `whatIf` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `whatIf` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `whatIf` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `whatIf` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `whatIf` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to test if an instance is in the desired state and how\nto process the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"test\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"test\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#input\n" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's current state or the\nstate and an array of the properties that are out of the desired state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Actual state only_\n\n> Indicates that the resource returns only the instance's actual state as a JSON blob.\n", + "_Actual state and differing properties_\n\n> Indicates that the resource returns the instance's actual state and an array of\n> property names that are out of the desired state.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `test` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `test` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `test` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `test` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + "${4:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `test` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "return": "${1|state,stateAndDiff|}", + "executable": "${2:executable_name}", + "args": [ + { + "jsonInputArg": "${3:argument_name}", + "mandatory": "^$4" + } + ] + } + } + ] + }, + "manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to delete an instance. Define this method for\nresources as an alternative to handling the [`_exist`][02] property in a `set` operation, which\ncan lead to highly complex code. If the `set` method for the resource is able to handle deleting\nan instance when `_exist` is `false`, set the [`handlesExist`][03] property of the set method\ndefinition to `true` instead.\n\nIf you define the delete method in a resource manifest, ensure that you also define the\n[`_exist`][02] property in the [JSON schema for the resource's properties][04].\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[04]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"delete\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config delete\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `delete` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `delete` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `delete` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `delete` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `delete` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of every instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"export\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"export\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `export` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `export` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `export` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `export` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `export` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^3" + } + ] + } + } + ] + }, + "manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to validate the state of an instance. This method is\nmandatory for DSC Group Resources. It's ignored for all other DSC Resources.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"validate\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"validate\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `validate` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `validate` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `validate` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `validate` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `validate` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to resolve an external source to nested DSC\nConfiguration Document. Define this method for [importer resources][02] and set the [kind][03]\nproperty in the manifest root to `Import`.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourceKind?view=dsc-3.0&preserve-view=true#importer-resources\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"resolve\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"resolve\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `resolve` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `resolve` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `resolve` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `resolve` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `resolve` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to\nmanage resources that don't have their own manifests with DSC.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#list\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"registry\",\n \"args\": [\"resources\", \"list\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nregistry resources list\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#args\n" + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the adapter expects to receive a full and unprocessed configuration as a\nsingle JSON blob over stdin or a sequence of JSON Lines for each child resource's\nconfigurations.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#config\n", + "markdownEnumDescriptions": [ + "_Full and unprocessed config as a JSON blob_\n\n> Indicates that the adapter expects a JSON blob containing the full and unprocessed\n> configuration as a single JSON blob over `stdin`.\n", + "_Resource instances as JSON Lines_\n\n> Indicates that the adapter expects each resource's configuration as a [JSON Line][01]\n> over `stdin`.\n\n[01]: https://jsonlines.org/\n" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when no arguments are\nrequired.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}" + } + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when at least one\nargument is required.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + } + } + ] + }, + "manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"schema\", \"show\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource schema show\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#args\n" + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob\nrepresenting an instance of the DSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `schema` command for the resource when no arguments are required.\n", + "body": { + "executable": "${1:executable_name}" + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the `schema` command for the resource when at least one argument is required.\n", + "body": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + ] + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON Schema DSC must use to validate a JSON blob representing an instance of the\nDSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type. DSC only supports JSON Schema Draft 07 and later.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n", + "markdownEnumDescriptions": [ + "_Draft 2020-12 (recommended)_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2020-12][01].\n>\n> This is the latest published draft of JSON Schema and is the draft future drafts\n> will be most compatible with.\n\n[01]: https://json-schema.org/specification-links.html#2020-12\n", + "_Draft 2019-09_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2019-09][01].\n>\n> This is the previous published draft of JSON Schema. It's mostly compatible with\n> 2020-12, but less extensible and can't be bundled.\n\n[01]: https://json-schema.org/specification-links.html#draft-2019-09-formerly-known-as-draft-8\n", + "_Draft 07_\n\n> Indicates that the resource instance schema adheres to [JSON Schema Draft 07][01].\n>\n> This is an older published draft of JSON Schema. It's widely used, but incompatible\n> with 2019-09 and later. It's less expressive, extensible, maintainable, and isn't\n> recommended for new schema definitions.\n\n[01]: https://json-schema.org/specification-links.html#draft-7\n" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the unique ID for the DSC Resource's instance schema. If the instance schema is\npublished to its own public URI, set this keyword to that URI.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#id\n" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the properties that DSC can retrieve and manage for the resource's instances.\nThis keyword must define at least one property as a key-value pair. The key is the\nproperty's name. The value is a subschema that validates the property.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#properties\n", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": { + "defaultSnippets": [ + { + "label": " Define a property", + "markdownDescription": "Define a new property for the resource instance schema.", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + }, + { + "label": " Define a property (boolean)", + "markdownDescription": "Define a new [boolean][01] property for the resource instance schema, requiring the\nvalue to be either `true` or `false`.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/boolean.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "boolean" + } + }, + { + "label": " Define a property (string)", + "markdownDescription": "Define a new [string][01] property for the resource instance schema, requiring the\nvalue to be a blob of text.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/string.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "string" + } + }, + { + "label": " Define a property (integer)", + "markdownDescription": "Define a new [integer][01] property for the resource instance schema, requiring the\nvalue to be a number without a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "integer" + } + }, + { + "label": " Define a property (number)", + "markdownDescription": "Define a new [number][01] property for the resource instance schema, requiring the\nvalue to be a number that may include a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "number" + } + }, + { + "label": " Define a property (array)", + "markdownDescription": "Define a new [array][01] property for the resource instance schema, requiring the\nvalue to be a list of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/array.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "array", + "items": { + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + } + }, + { + "label": " Define a property (object)", + "markdownDescription": "Define a new [object][01] property for the resource instance schema, requiring the\nvalue to be a set of key-value pairs.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/object.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "object", + "properties": { + "${3:propertyName}": { + "title": "${4:propertyTitle}", + "description": "${5:explanation of property purpose and usage}", + "type": "${6|string,integer,number,array,object,null|}" + } + } + } + }, + { + "label": " Define a property (enum)", + "markdownDescription": "Define a new [enum][01] property for the resource instance schema that only accepts\na defined set of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "enum": [ + "^${3:\"first value\"}", + "^${4:\"second value\"}" + ] + } + }, + { + "label": " Define a property (const)", + "markdownDescription": "Define a new [const][01] property for the resource instance schema that only\naccepts a specific value.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#constant-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "const": "^${3:\"constant value\"}" + } + } + ] + }, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the resource can enforce whether instances exist, handling whether an\ninstance should be added, updated, or removed during a set operation. The default\nvalue is `true`.\n\nResources that define this property declare that the implementation adheres to the\nfollowing behavior contract:\n\n1. When the desired state for `_exist` is `true`, the resource expects the instance\n to exist. If it doesn't exist, the resource creates or adds the instance during\n the set operation.\n1. When the desired state for `_exist` is `false`, the resource expects the instance\n to not exist. If it does exist, the resource deletes or removes the instance\n during the set operation.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource returns this value for it's own `test` method. This\nproperty is mandatory when the manifest defines the `test` property. It shouldn't\nbe included if the DSC Resource relies on DSC's synthetic testing.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/indesiredstate?view=dsc-3.0&preserve-view=true\n" + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_purge` property to specify\nwhether the DSC Resource should remove all non-specified members when it manages\nan array of members or values.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/purge?view=dsc-3.0&preserve-view=true\n" + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_rebootRequested` property to\nreport whether the machine should be rebooted after the `set` method executes.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/rebootrequested?view=dsc-3.0&preserve-view=true\n" + } + }, + "defaultSnippets": [ + { + "label": " Define an instance property", + "markdownDescription": "Define a property for the resource instance schema.", + "body": { + "${1:propertyName}": { + "title": "${2:property title}", + "description": "${3:explanation of property purpose and usage}", + "type": "${4|string,integer,number,array,object,null|}" + } + } + } + ] + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must validate a JSON blob representing an instance of the DSC Resource.\n\nThe JSON schema can be defined dynamically with the `command` property or statically with the\n`embedded` property.\n\nFor development purposes, it can be more convenient to use the `command` property and avoid\nneeding to adjust both the code and the schema.\n\nMicrosoft recommends using the `embedded` property when publishing a resource publicly. When the\nmanifest declares the schema with the `command` property, DSC calls the command at the beginning\nof any operation using the resource, possibly impacting performance. The schema is also\nunavailable to integrating tools when the resource isn't installed locally. When the schema is\nembedded in the manifest, DSC and integrating tools only need the manifest itself.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define as command without arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when no arguments are required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}" + } + } + }, + { + "label": " Define as command with arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when at least one argument is required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + }, + { + "label": " Define as an embedded schema", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema embedded in the manifest. This is the preferred option\nfor publicly published resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "body": { + "embedded": { + "${escape_dollar:$}schema": "${1|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${2:name}": { + "title": "${3:property title}", + "description": "${4:explanation of property purpose and usage}", + "type": "${5|string,integer,number,array,object,null|}" + } + } + } + } + } + ] + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/resource/schema.json b/schemas/v3.0.0/bundled/outputs/resource/schema.json new file mode 100644 index 00000000..cba18d36 --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/resource/schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3.0.0/bundled/outputs/resource/schema.vscode.json b/schemas/v3.0.0/bundled/outputs/resource/schema.vscode.json new file mode 100644 index 00000000..cba18d36 --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/resource/schema.vscode.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3.0.0/bundled/outputs/resource/set.json b/schemas/v3.0.0/bundled/outputs/resource/set.json new file mode 100644 index 00000000..ce971ca1 --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/resource/set.json @@ -0,0 +1,146 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json" + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/resource/set.vscode.json b/schemas/v3.0.0/bundled/outputs/resource/set.vscode.json new file mode 100644 index 00000000..24f8add5 --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/resource/set.vscode.json @@ -0,0 +1,172 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json" + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0.0": { + "outputs": { + "resource": { + "set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json" + } + } + }, + "set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json" + } + } + ] + } + } + }, + "metadata": { + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "Microsoft.DSC": { + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } + }, + "definitions": { + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/resource/test.json b/schemas/v3.0.0/bundled/outputs/resource/test.json new file mode 100644 index 00000000..89117e9b --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/resource/test.json @@ -0,0 +1,152 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json" + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/resource/test.vscode.json b/schemas/v3.0.0/bundled/outputs/resource/test.vscode.json new file mode 100644 index 00000000..f7c64944 --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/resource/test.vscode.json @@ -0,0 +1,178 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json" + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0.0": { + "outputs": { + "resource": { + "test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json" + } + } + }, + "test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json" + } + } + ] + } + } + }, + "metadata": { + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "Microsoft.DSC": { + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } + }, + "definitions": { + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0.0/bundled/outputs/schema.json b/schemas/v3.0.0/bundled/outputs/schema.json new file mode 100644 index 00000000..5d69840e --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3.0.0/bundled/outputs/schema.vscode.json b/schemas/v3.0.0/bundled/outputs/schema.vscode.json new file mode 100644 index 00000000..5d69840e --- /dev/null +++ b/schemas/v3.0.0/bundled/outputs/schema.vscode.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3.0.0/bundled/resource/manifest.json b/schemas/v3.0.0/bundled/resource/manifest.json new file mode 100644 index 00000000..1e2c7edd --- /dev/null +++ b/schemas/v3.0.0/bundled/resource/manifest.json @@ -0,0 +1,1126 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ] + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "get": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json" + }, + "set": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json" + }, + "delete": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json" + }, + "export": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json" + }, + "validate": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] + }, + "schema": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources." + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource." + } + } + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": {}, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json" + } + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json" + } + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json" + } + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json" + } + } + } + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command." + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json", + "title": "Instance should exist", + "description": "Indicates whether the DSC Resource instance should exist.", + "type": "boolean", + "default": true, + "enum": [ + false, + true + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json", + "title": "Instance is in the Desired State", + "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json", + "title": "Purge", + "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", + "type": [ + "boolean", + "null" + ], + "writeOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json", + "title": "Reboot Requested", + "description": "Indicates that the set operation requires a reboot before it's fully complete.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + } + } +} diff --git a/schemas/v3.0.0/bundled/resource/manifest.vscode.json b/schemas/v3.0.0/bundled/resource/manifest.vscode.json new file mode 100644 index 00000000..e9d65f3e --- /dev/null +++ b/schemas/v3.0.0/bundled/resource/manifest.vscode.json @@ -0,0 +1,1956 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the information DSC and integrating require to process and call a command-based DSC\nResource. For DSC to use a manifest on a system, the manifest file must:\n\n1. Be discoverable in the `PATH` environment variable.\n1. Follow the naming convention `.dsc.resource.json`.\n1. Be valid for this schema.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define a resource", + "markdownDescription": "Defines a standard resource that:\n\n- Can get the current state of an instance\n- Can set an instance to the desired state\n- Relies on DSC's synthetic testing to determine whether an instance is in the desired state\n- Defines an embedded JSON schema.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "set": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "implementsPretest": "^${11:false}", + "return": "${12:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (group)", + "markdownDescription": "Defines a group resource that expects a list of resource instances and operates on them.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "group", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${18|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${19:Resources}", + "description": "${20:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json" + } + }, + "${21:name}": { + "title": "${22:property title}", + "description": "${23:explanation of property purpose and usage}", + "type": "${24|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (adapter)", + "markdownDescription": "Defines an adapter resource that enables users to define non-command-based DSC Resources in\nthe configuration.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "adapter", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "adapter": { + "config": "${18|full,sequence|}", + "list": { + "executable": "${19:executable name}", + "args": [ + "${20:argument}" + ] + } + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${23|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${24:Resources}", + "description": "${25:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json" + } + }, + "${26:name}": { + "title": "${27:property title}", + "description": "${28:explanation of property purpose and usage}", + "type": "${29|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (importer)", + "markdownDescription": "Defines an importer resource that can resolve an external source to nested resource\ninstances.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "importer", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "resolve": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (assertion-only)", + "markdownDescription": "Defines an assertion resource that can get the current state of an instance but not configure\nit. By default, the resource relies on DSC's synthetic testing feature. If the resource\nimplements the `test` operation itself, define the `test` property.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + } + ], + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property must be one of the canonical URLs for the version of the Command-based DSC\nResource Manifest schema that the manifest is implemented for.\n\nFor every version of the schema, there are three valid urls:\n\n```yaml\n.../resource/manifest.json\n```\n\n> The URL to the canonical non-bundled schema. When it's used for validation, the validating\n> client needs to retrieve this schema and every schema it references.\n\n```yaml\n.../bundled/resource/manifest.json\n```\n\n> The URL to the bundled schema. When it's used for validation, the validating client only\n> needs to retrieve this schema.\n> \n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n\n```yaml\n.../bundled/resource/manifest.vscode.json\n```\n\n> The URL to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and snippets\n> that the others don't include.\n> \n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#schema\n", + "markdownEnumDescriptions": [ + "\n\n> #### `v3.0.0` non-bundled\n>\n> Indicates that the resource manifest adheres to the `v3.0.0` schema. This URL\n> points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `v3.0.0` bundled\n>\n> Indicates that the resource manifest adheres to the `v3.0.0` schema. This URL\n> points to the bundled schema. When it's used for validation, the validating client\n> only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `v3.0.0` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `v3.0.0` schema. This URL\n> points to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/10` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/10` bundled\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0.0` of the schema.\n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/10` enhanced authoring\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0.0` of the schema.\n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/08` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/08` bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/08` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0.0` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n" + ] + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe semantic version ([semver][02]) of the DSC Resource. This version identifies the DSC\nResource, not the version of the application it manages.\n\nThis value uses the [suggested regular expression][03] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#version\n[02]: https://semver.org/\n[03]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a short synopsis of the DSC Resource's purpose.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#description-1\n" + }, + "kind": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of searchable terms for the resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#tags\n", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$", + "patternErrorMessage": "Invalid tag. Tags must be a string of alphanumeric characters and underscores. No other\ncharacters are permitted.\n" + } + }, + "get": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json" + }, + "set": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json" + }, + "delete": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json" + }, + "export": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json" + }, + "validate": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$", + "patternErrorMessage": "Invalid exit code. Must be a string representing a 32-bit signed integer.\n" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property defines a map of valid exit codes for the DSC Resource. DSC always interprets\nexit code `0` as a successful operation and any other exit code as an error. Use this\nproperty to indicate human-readable semantic meanings for the DSC Resource's exit codes.\n\nDefine the keys in this property as strings representing a valid 32-bit signed integer. You\ncan't use alternate formats for the exit code. For example, instead of the hexadecimal value\n`0x80070005` for \"Access denied\", specify the exit code as `-2147024891`. If you're authoring\nyour resource manifest in yaml, be sure to wrap the exit code in single quotes, like\n`'0': Success` instead of `0: Success` to ensure the YAML file can be parsed correctly.\n\nDefine the value for each key as a string explaining what the exit code indicates.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#exitcodes\n", + "defaultSnippets": [ + { + "label": " Defined exit codes", + "description": "Defines exit codes with semantic meaning for the resource.", + "body": { + "0": "Success", + "${1:first exit code number}": "${2:first exit code meaning}", + "${3:second exit code number}": "${4:second exit code meaning}" + } + } + ] + }, + "schema": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0.0": { + "definitions": { + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the resource is a normal DSC Resource, a group resource, or an adapter\nresource. This property is only required for group resources.\n\nDSC infers the default value for this property based on whether the [adapter][02] property is\ndefined in the manifest:\n\n- If the `adapter` property is defined in the manifest, the default `kind` is `Adapter`.\n- If the `adapter` property is not defined in the manifest, the default `kind` is `Resource`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "markdownEnumDescriptions": [ + "\n\nIndicates that the manifest is for a standard command-based DSC Resource.\n", + "\n\nIndicates that the manifest is for an adapter resource that enables the use of\nnon-command-based resources with DSC.\n", + "\n\nIndicates that the manifest is for a group resource that processes an array of nested\nresource instances.\n", + "\n\nIndicates that the manifest is for an import resource that resolves an external source to DSC\nresource instances. The resolved instances are processed as nested instances for the import\nresource.\n" + ] + }, + "commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "defaultSnippets": [ + { + "label": "String argument", + "markdownDescription": "Add a string argument to the command, like `config` or `--config`.", + "body": "${1:argument_name}" + }, + { + "label": "JSON input argument", + "markdownDescription": "Add a JSON input argument to the command. A command can only define one JSON input argument\nin the `args` list. When you define a JSON input argument, DSC passes the input data for\nthe command to the specified argument as a string representing the data as a compressed\nJSON object. The compressed JSON object doesn't have any spaces or newlines between the\nobject properties and values.\n\nIf the command doesn't define the `input` property, it must define a JSON input argument.\n\nIf the command defines both the `input` property and a JSON input argument, DSC sends the\ninput data to the command in both ways. For example, if the command defines `input` as\n`stdin` and has a JSON input argument in `args`, DSC sends the input data as a compressed\nJSON object over stdin and to the the specified argument.", + "body": { + "jsonInputArg": "${1:argument_name}", + "mandatory": "^$2" + } + } + ], + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command.", + "markdownDescription": "Any item in the argument array can be a string representing a static argument to pass to\nthe command.\n" + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "markdownDescription": "Defines an argument for the command that accepts the JSON input object as a string. DSC\npasses the JSON input to the named argument when available. You can define the `mandatory`\nproperty to indicate whether DSC should always pass the argument to the command, even when\nthere's no JSON input for the command. In that case, DSC passes an empty string to the\nJSON input argument. You can only define one JSON input argument per arguments array.\n\nIf you define a JSON input argument and an `input` kind for a command, DSC sends the JSON\ndata both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "markdownDescription": "Defines the argument that accepts the JSON property bag for the resource as input.\n", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "markdownDescription": "Defines whether the argument is mandatory. If this property is set to `true`, DSC\npasses an empty string when no JSON input is provided. The default value is `false`.\n", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ], + "markdownEnumDescriptions": [ + "_Environment variables_\n\n> Indicates that the resource expects the properties of an instance to be specified as\n> environment variables with the same names and casing.\n>\n> This option only supports the following data types for instance properties:\n>\n> - `boolean`\n> - `integer`\n> - `number`\n> - `string`\n> - `array` of `integer` values\n> - `array` of `number` values\n> - `array` of `string` values\n>\n> For non-array values, DSC sets the environment variable to the specified value as-is. When\n> the data type is an array of values, DSC sets the environment variable as a comma-delimited\n> string. For example, the property `foo` with a value of `[1, 2, 3]` is saved in the `foo`\n> environment variable as `\"1,2,3\"`.\n>\n> If the resource needs to support complex properties with an `object` value or multi-type\n> arrays, set this to `stdin` instead.\n", + "_JSON over `stdin`_\n\n> Indicates that the resource expects a JSON blob representing an instance from `stdin`.\n> The JSON must adhere to the instance schema.\n" + ] + }, + "returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + } + }, + "resource": { + "manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of an instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"get\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property. When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"get\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `get` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `get` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `get` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `get` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `get` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to set the desired state of an instance and how to\nprocess the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set` command. Set this value to `true` if the DSC Resource tests input before modifying\nsystem state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set` command where the instance defines the `_exist` property as `false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's state after the set\noperation or the state and an array of the properties the DSC Resource modified.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's final state after the set\n> operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's final state and an array of property\n> names that the resource modified.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `set` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `set` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `set` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `set` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `set` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to indicate whether and how the set command will\nmodify an instance and how to process the output from the DSC Resource. If a resource doesn't\ndefine this method in the manifest, DSC synthesizes this behavior by converting the result of\nthe test operation for the resource into the [set result][02].\n\nThis method definition has the same structure as the [set method][03] in the resource manifest.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/outputs/resource/set?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\", \"--what-if\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n \"--what-if\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set --what-if` command . Set this value to `true` if the DSC Resource tests input before\nprocessing how it will modify system state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set --what-if` command where the instance defines the `_exist` property as\n`false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's expected state after a\nset operation in what-if mode or the state and an array of the properties the DSC Resource\nwould modify.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's expected final state after the\n> set operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's expected final state and an array of\n> property names that the resource would modify.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `whatIf` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `whatIf` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `whatIf` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `whatIf` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `whatIf` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to test if an instance is in the desired state and how\nto process the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"test\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"test\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#input\n" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's current state or the\nstate and an array of the properties that are out of the desired state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Actual state only_\n\n> Indicates that the resource returns only the instance's actual state as a JSON blob.\n", + "_Actual state and differing properties_\n\n> Indicates that the resource returns the instance's actual state and an array of\n> property names that are out of the desired state.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `test` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `test` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `test` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `test` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + "${4:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `test` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "return": "${1|state,stateAndDiff|}", + "executable": "${2:executable_name}", + "args": [ + { + "jsonInputArg": "${3:argument_name}", + "mandatory": "^$4" + } + ] + } + } + ] + }, + "manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to delete an instance. Define this method for\nresources as an alternative to handling the [`_exist`][02] property in a `set` operation, which\ncan lead to highly complex code. If the `set` method for the resource is able to handle deleting\nan instance when `_exist` is `false`, set the [`handlesExist`][03] property of the set method\ndefinition to `true` instead.\n\nIf you define the delete method in a resource manifest, ensure that you also define the\n[`_exist`][02] property in the [JSON schema for the resource's properties][04].\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[04]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"delete\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config delete\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `delete` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `delete` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `delete` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `delete` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `delete` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of every instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"export\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"export\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `export` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `export` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `export` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `export` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `export` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^3" + } + ] + } + } + ] + }, + "manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to validate the state of an instance. This method is\nmandatory for DSC Group Resources. It's ignored for all other DSC Resources.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"validate\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"validate\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `validate` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `validate` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `validate` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `validate` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `validate` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to resolve an external source to nested DSC\nConfiguration Document. Define this method for [importer resources][02] and set the [kind][03]\nproperty in the manifest root to `Import`.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourceKind?view=dsc-3.0&preserve-view=true#importer-resources\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"resolve\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"resolve\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `resolve` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `resolve` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `resolve` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `resolve` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `resolve` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to\nmanage resources that don't have their own manifests with DSC.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#list\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"registry\",\n \"args\": [\"resources\", \"list\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nregistry resources list\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#args\n" + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the adapter expects to receive a full and unprocessed configuration as a\nsingle JSON blob over stdin or a sequence of JSON Lines for each child resource's\nconfigurations.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#config\n", + "markdownEnumDescriptions": [ + "_Full and unprocessed config as a JSON blob_\n\n> Indicates that the adapter expects a JSON blob containing the full and unprocessed\n> configuration as a single JSON blob over `stdin`.\n", + "_Resource instances as JSON Lines_\n\n> Indicates that the adapter expects each resource's configuration as a [JSON Line][01]\n> over `stdin`.\n\n[01]: https://jsonlines.org/\n" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when no arguments are\nrequired.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}" + } + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when at least one\nargument is required.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + } + } + ] + }, + "manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"schema\", \"show\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource schema show\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#args\n" + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob\nrepresenting an instance of the DSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `schema` command for the resource when no arguments are required.\n", + "body": { + "executable": "${1:executable_name}" + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the `schema` command for the resource when at least one argument is required.\n", + "body": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + ] + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON Schema DSC must use to validate a JSON blob representing an instance of the\nDSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type. DSC only supports JSON Schema Draft 07 and later.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n", + "markdownEnumDescriptions": [ + "_Draft 2020-12 (recommended)_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2020-12][01].\n>\n> This is the latest published draft of JSON Schema and is the draft future drafts\n> will be most compatible with.\n\n[01]: https://json-schema.org/specification-links.html#2020-12\n", + "_Draft 2019-09_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2019-09][01].\n>\n> This is the previous published draft of JSON Schema. It's mostly compatible with\n> 2020-12, but less extensible and can't be bundled.\n\n[01]: https://json-schema.org/specification-links.html#draft-2019-09-formerly-known-as-draft-8\n", + "_Draft 07_\n\n> Indicates that the resource instance schema adheres to [JSON Schema Draft 07][01].\n>\n> This is an older published draft of JSON Schema. It's widely used, but incompatible\n> with 2019-09 and later. It's less expressive, extensible, maintainable, and isn't\n> recommended for new schema definitions.\n\n[01]: https://json-schema.org/specification-links.html#draft-7\n" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the unique ID for the DSC Resource's instance schema. If the instance schema is\npublished to its own public URI, set this keyword to that URI.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#id\n" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the properties that DSC can retrieve and manage for the resource's instances.\nThis keyword must define at least one property as a key-value pair. The key is the\nproperty's name. The value is a subschema that validates the property.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#properties\n", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": { + "defaultSnippets": [ + { + "label": " Define a property", + "markdownDescription": "Define a new property for the resource instance schema.", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + }, + { + "label": " Define a property (boolean)", + "markdownDescription": "Define a new [boolean][01] property for the resource instance schema, requiring the\nvalue to be either `true` or `false`.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/boolean.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "boolean" + } + }, + { + "label": " Define a property (string)", + "markdownDescription": "Define a new [string][01] property for the resource instance schema, requiring the\nvalue to be a blob of text.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/string.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "string" + } + }, + { + "label": " Define a property (integer)", + "markdownDescription": "Define a new [integer][01] property for the resource instance schema, requiring the\nvalue to be a number without a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "integer" + } + }, + { + "label": " Define a property (number)", + "markdownDescription": "Define a new [number][01] property for the resource instance schema, requiring the\nvalue to be a number that may include a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "number" + } + }, + { + "label": " Define a property (array)", + "markdownDescription": "Define a new [array][01] property for the resource instance schema, requiring the\nvalue to be a list of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/array.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "array", + "items": { + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + } + }, + { + "label": " Define a property (object)", + "markdownDescription": "Define a new [object][01] property for the resource instance schema, requiring the\nvalue to be a set of key-value pairs.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/object.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "object", + "properties": { + "${3:propertyName}": { + "title": "${4:propertyTitle}", + "description": "${5:explanation of property purpose and usage}", + "type": "${6|string,integer,number,array,object,null|}" + } + } + } + }, + { + "label": " Define a property (enum)", + "markdownDescription": "Define a new [enum][01] property for the resource instance schema that only accepts\na defined set of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "enum": [ + "^${3:\"first value\"}", + "^${4:\"second value\"}" + ] + } + }, + { + "label": " Define a property (const)", + "markdownDescription": "Define a new [const][01] property for the resource instance schema that only\naccepts a specific value.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#constant-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "const": "^${3:\"constant value\"}" + } + } + ] + }, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the resource can enforce whether instances exist, handling whether an\ninstance should be added, updated, or removed during a set operation. The default\nvalue is `true`.\n\nResources that define this property declare that the implementation adheres to the\nfollowing behavior contract:\n\n1. When the desired state for `_exist` is `true`, the resource expects the instance\n to exist. If it doesn't exist, the resource creates or adds the instance during\n the set operation.\n1. When the desired state for `_exist` is `false`, the resource expects the instance\n to not exist. If it does exist, the resource deletes or removes the instance\n during the set operation.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource returns this value for it's own `test` method. This\nproperty is mandatory when the manifest defines the `test` property. It shouldn't\nbe included if the DSC Resource relies on DSC's synthetic testing.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/indesiredstate?view=dsc-3.0&preserve-view=true\n" + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_purge` property to specify\nwhether the DSC Resource should remove all non-specified members when it manages\nan array of members or values.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/purge?view=dsc-3.0&preserve-view=true\n" + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_rebootRequested` property to\nreport whether the machine should be rebooted after the `set` method executes.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/rebootrequested?view=dsc-3.0&preserve-view=true\n" + } + }, + "defaultSnippets": [ + { + "label": " Define an instance property", + "markdownDescription": "Define a property for the resource instance schema.", + "body": { + "${1:propertyName}": { + "title": "${2:property title}", + "description": "${3:explanation of property purpose and usage}", + "type": "${4|string,integer,number,array,object,null|}" + } + } + } + ] + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must validate a JSON blob representing an instance of the DSC Resource.\n\nThe JSON schema can be defined dynamically with the `command` property or statically with the\n`embedded` property.\n\nFor development purposes, it can be more convenient to use the `command` property and avoid\nneeding to adjust both the code and the schema.\n\nMicrosoft recommends using the `embedded` property when publishing a resource publicly. When the\nmanifest declares the schema with the `command` property, DSC calls the command at the beginning\nof any operation using the resource, possibly impacting performance. The schema is also\nunavailable to integrating tools when the resource isn't installed locally. When the schema is\nembedded in the manifest, DSC and integrating tools only need the manifest itself.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define as command without arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when no arguments are required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}" + } + } + }, + { + "label": " Define as command with arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when at least one argument is required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + }, + { + "label": " Define as an embedded schema", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema embedded in the manifest. This is the preferred option\nfor publicly published resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "body": { + "embedded": { + "${escape_dollar:$}schema": "${1|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${2:name}": { + "title": "${3:property title}", + "description": "${4:explanation of property purpose and usage}", + "type": "${5|string,integer,number,array,object,null|}" + } + } + } + } + } + ] + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0.0/config/document.json b/schemas/v3.0.0/config/document.json new file mode 100644 index 00000000..4ffff0c2 --- /dev/null +++ b/schemas/v3.0.0/config/document.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json", + "title": "DSC Configuration Document schema", + "description": "Describes a valid DSC Configuration Document.", + "type": "object", + "required": [ + "$schema", + "resources" + ], + "properties": { + "$schema": { + "title": "Schema", + "description": "This property must be the canonical URL of the DSC Configuration Document schema that the document is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json" + ] + }, + "parameters": { + "title": "DSC Configuration document parameters", + "description": "Defines runtime options for the configuration. Users and integrating tools can override use the defined parameters to pass alternate values to the configuration.", + "type": "object", + "additionalProperties": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/config/document.parameter.json" + } + }, + "variables": { + "title": "Configuration variables", + "description": "Defines a set of reusable values for the configuration document. The names of this value's properties are the strings used to reference a variable's value.", + "type": "object" + }, + "resources": { + "title": "DSC Configuration document resources", + "description": "Defines a list of DSC Resource instances for the configuration to manage.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json" + } + }, + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/config/document.metadata.json" + } + } +} diff --git a/schemas/v3.0.0/config/document.metadata.json b/schemas/v3.0.0/config/document.metadata.json new file mode 100644 index 00000000..c6b1b058 --- /dev/null +++ b/schemas/v3.0.0/config/document.metadata.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.metadata.json", + "title": "Configuration metadata", + "description": "Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` property, this metadata isn't validated. You can pass any data into this property of a configuration document.", + "type": "object", + "properties": { + "Microsoft.DSC": { + "type": "object", + "title": "DSC metadata", + "description": "The `Microsoft.DSC` metadata property contains directives and information that DSC itself uses when processing a configuration document. Unlike other metadata key-value pairs, DSC validates these properties.", + "unevaluatedProperties": false, + "properties": { + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "default": "Current", + "description": "This property defines the security context a configuration requires. If you invoke a DSC operation against the configuration document in a security context that conflicts with this metadata, DSC raises an error when it validates the configuration document.\nThe default security context is `Current`." + } + } + } + } +} diff --git a/schemas/v3.0.0/config/document.parameter.json b/schemas/v3.0.0/config/document.parameter.json new file mode 100644 index 00000000..a70ba1ac --- /dev/null +++ b/schemas/v3.0.0/config/document.parameter.json @@ -0,0 +1,228 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.parameter.json", + "title": "Parameter", + "description": "Defines a runtime option for a DSC Configuration Document.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/dataTypes.json" + }, + "defaultValue": { + "title": "Default value", + "description": "Defines the default value for the parameter.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/validValueTypes.json" + }, + "allowedValues": { + "title": "Allowed values", + "description": "Defines a list of valid values for the parameter. If the parameter is defined with any other values, it's invalid.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/validValueTypes.json" + } + }, + "description": { + "title": "Parameter description", + "description": "Defines a synopsis for the parameter explaining its purpose.", + "type": "string" + }, + "metadata": { + "title": "Parameter metadata", + "description": "Defines a set of key-value pairs for the parameter. This metadata isn't validated.", + "type": "object" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "minValue": { + "title": "Minimum value", + "description": "The minimum valid value for an integer type. If defined with the `maxValue` property, this value must be less than the value of `maxValue`.", + "type": "integer" + }, + "maxValue": { + "title": "Maximum value", + "description": "The maximum valid value for an integer type. If defined with the `minValue` property, this value must be greater than the value of `minValue`.", + "type": "integer" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + }, + { + "properties": { + "type": { + "const": "array" + } + } + } + ] + }, + "then": { + "properties": { + "minLength": { + "title": "Minimum length", + "description": "The minimum valid length for a `string`, `secureString`, or `array`. If defined with the `maxLength` property, this value must be less than the value of `maxLength`.", + "type": "integer", + "minimum": 0 + }, + "maxLength": { + "title": "Maximum length", + "description": "The maximum valid length for a `string`, `secureString`, or `array`. If defined with the `minLength` property, this value must be less than the value of `minLength`.", + "type": "integer", + "minimum": 0 + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "string" + }, + "allowedValues": { + "items": { + "type": "string" + } + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "object" + } + } + }, + { + "properties": { + "type": { + "const": "secureObject" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "object" + }, + "allowedValues": { + "items": { + "type": "object" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "integer" + }, + "allowedValues": { + "items": { + "type": "integer" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "array" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "bool" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "boolean" + }, + "allowedValues": { + "items": { + "type": "boolean" + } + } + } + } + } + ] +} diff --git a/schemas/v3.0.0/config/document.resource.json b/schemas/v3.0.0/config/document.resource.json new file mode 100644 index 00000000..ed9cabff --- /dev/null +++ b/schemas/v3.0.0/config/document.resource.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json", + "title": "DSC Resource instance", + "description": "Defines an instance of a DSC Resource in a configuration.", + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "dependsOn": { + "title": "Instance depends on", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", + "type": "array", + "items": { + "type": "string", + "uniqueItems": true, + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$" + } + }, + "properties": { + "title": "Managed instance properties", + "description": "Defines the properties of the DSC Resource this instance manages. This property's value must be an object. DSC validates the property's value against the DSC Resource's schema.", + "type": "object" + } + } +} diff --git a/schemas/v3.0.0/definitions/commandArgs.json b/schemas/v3.0.0/definitions/commandArgs.json new file mode 100644 index 00000000..24424b93 --- /dev/null +++ b/schemas/v3.0.0/definitions/commandArgs.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command." + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "type": "boolean", + "default": false + } + } + } + ] + } +} diff --git a/schemas/v3.0.0/definitions/commandExecutable.json b/schemas/v3.0.0/definitions/commandExecutable.json new file mode 100644 index 00000000..882058ca --- /dev/null +++ b/schemas/v3.0.0/definitions/commandExecutable.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" +} diff --git a/schemas/v3.0.0/definitions/hadErrors.json b/schemas/v3.0.0/definitions/hadErrors.json new file mode 100644 index 00000000..af1e485c --- /dev/null +++ b/schemas/v3.0.0/definitions/hadErrors.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" +} diff --git a/schemas/v3.0.0/definitions/inputKind.json b/schemas/v3.0.0/definitions/inputKind.json new file mode 100644 index 00000000..f94f1b37 --- /dev/null +++ b/schemas/v3.0.0/definitions/inputKind.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ] +} diff --git a/schemas/v3.0.0/definitions/instanceName.json b/schemas/v3.0.0/definitions/instanceName.json new file mode 100644 index 00000000..32ab3d9c --- /dev/null +++ b/schemas/v3.0.0/definitions/instanceName.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 +} diff --git a/schemas/v3.0.0/definitions/message.json b/schemas/v3.0.0/definitions/message.json new file mode 100644 index 00000000..88d0517b --- /dev/null +++ b/schemas/v3.0.0/definitions/message.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } +} diff --git a/schemas/v3.0.0/definitions/messages.json b/schemas/v3.0.0/definitions/messages.json new file mode 100644 index 00000000..7af6f555 --- /dev/null +++ b/schemas/v3.0.0/definitions/messages.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json" + } +} diff --git a/schemas/v3.0.0/definitions/parameters/dataTypes.json b/schemas/v3.0.0/definitions/parameters/dataTypes.json new file mode 100644 index 00000000..bf375e89 --- /dev/null +++ b/schemas/v3.0.0/definitions/parameters/dataTypes.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/dataTypes.json", + "title": "Data Types", + "description": "Defines the data type for the parameter value.", + "type": "string", + "enum": [ + "string", + "secureString", + "int", + "bool", + "object", + "secureObject", + "array" + ] +} diff --git a/schemas/v3.0.0/definitions/parameters/validValueTypes.json b/schemas/v3.0.0/definitions/parameters/validValueTypes.json new file mode 100644 index 00000000..d85872aa --- /dev/null +++ b/schemas/v3.0.0/definitions/parameters/validValueTypes.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/validValueTypes.json", + "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", + "type": [ + "string", + "integer", + "object", + "array", + "boolean" + ] +} diff --git a/schemas/v3.0.0/definitions/resourceKind.json b/schemas/v3.0.0/definitions/resourceKind.json new file mode 100644 index 00000000..9f0a64e9 --- /dev/null +++ b/schemas/v3.0.0/definitions/resourceKind.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ] +} diff --git a/schemas/v3.0.0/definitions/resourceType.json b/schemas/v3.0.0/definitions/resourceType.json new file mode 100644 index 00000000..cc9ae868 --- /dev/null +++ b/schemas/v3.0.0/definitions/resourceType.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" +} diff --git a/schemas/v3.0.0/definitions/returnKind.json b/schemas/v3.0.0/definitions/returnKind.json new file mode 100644 index 00000000..4d7bb607 --- /dev/null +++ b/schemas/v3.0.0/definitions/returnKind.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." +} diff --git a/schemas/v3.0.0/definitions/semver.json b/schemas/v3.0.0/definitions/semver.json new file mode 100644 index 00000000..b2b87349 --- /dev/null +++ b/schemas/v3.0.0/definitions/semver.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" +} diff --git a/schemas/v3.0.0/metadata/Microsoft.DSC/context.json b/schemas/v3.0.0/metadata/Microsoft.DSC/context.json new file mode 100644 index 00000000..3afffa3e --- /dev/null +++ b/schemas/v3.0.0/metadata/Microsoft.DSC/context.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] +} diff --git a/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json b/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json new file mode 100644 index 00000000..b53305e8 --- /dev/null +++ b/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" +} diff --git a/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json b/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json new file mode 100644 index 00000000..5b511210 --- /dev/null +++ b/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" +} diff --git a/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json b/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json new file mode 100644 index 00000000..4da024eb --- /dev/null +++ b/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] +} diff --git a/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json b/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json new file mode 100644 index 00000000..9c0cab76 --- /dev/null +++ b/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] +} diff --git a/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json b/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json new file mode 100644 index 00000000..2a4472a5 --- /dev/null +++ b/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] +} diff --git a/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json b/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json new file mode 100644 index 00000000..8eb7db58 --- /dev/null +++ b/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" +} diff --git a/schemas/v3.0.0/metadata/Microsoft.DSC/version.json b/schemas/v3.0.0/metadata/Microsoft.DSC/version.json new file mode 100644 index 00000000..582464b7 --- /dev/null +++ b/schemas/v3.0.0/metadata/Microsoft.DSC/version.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" +} diff --git a/schemas/v3.0.0/metadata/configurationDocumentResult.json b/schemas/v3.0.0/metadata/configurationDocumentResult.json new file mode 100644 index 00000000..09f48fb9 --- /dev/null +++ b/schemas/v3.0.0/metadata/configurationDocumentResult.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/context.json" + } + } + } + } +} diff --git a/schemas/v3.0.0/metadata/resourceInstanceResult.json b/schemas/v3.0.0/metadata/resourceInstanceResult.json new file mode 100644 index 00000000..43c68788 --- /dev/null +++ b/schemas/v3.0.0/metadata/resourceInstanceResult.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } +} diff --git a/schemas/v3.0.0/outputs/config/get.json b/schemas/v3.0.0/outputs/config/get.json new file mode 100644 index 00000000..7a3afbbd --- /dev/null +++ b/schemas/v3.0.0/outputs/config/get.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/get.json", + "title": "DSC Configuration get command result", + "description": "Represents the data structure returned by the `dsc config get` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `get` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json" + } + } +} diff --git a/schemas/v3.0.0/outputs/config/set.json b/schemas/v3.0.0/outputs/config/set.json new file mode 100644 index 00000000..385badc2 --- /dev/null +++ b/schemas/v3.0.0/outputs/config/set.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/set.json", + "title": "DSC Configuration set command result", + "description": "Represents the data structure returned by the `dsc config set` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `set` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json" + } + } +} diff --git a/schemas/v3.0.0/outputs/config/test.json b/schemas/v3.0.0/outputs/config/test.json new file mode 100644 index 00000000..2a8b37a8 --- /dev/null +++ b/schemas/v3.0.0/outputs/config/test.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/test.json", + "title": "DSC Configuration test command result", + "description": "Represents the data structure returned by the `dsc config test` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `test` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/hadErrors.json" + } + } +} diff --git a/schemas/v3.0.0/outputs/resource/get.full.json b/schemas/v3.0.0/outputs/resource/get.full.json new file mode 100644 index 00000000..5661f941 --- /dev/null +++ b/schemas/v3.0.0/outputs/resource/get.full.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json" + } + } +} diff --git a/schemas/v3.0.0/outputs/resource/get.json b/schemas/v3.0.0/outputs/resource/get.json new file mode 100644 index 00000000..c23f50c6 --- /dev/null +++ b/schemas/v3.0.0/outputs/resource/get.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json" + } + } + ] +} diff --git a/schemas/v3.0.0/outputs/resource/get.simple.json b/schemas/v3.0.0/outputs/resource/get.simple.json new file mode 100644 index 00000000..59d2eec1 --- /dev/null +++ b/schemas/v3.0.0/outputs/resource/get.simple.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } +} diff --git a/schemas/v3.0.0/outputs/resource/list.json b/schemas/v3.0.0/outputs/resource/list.json new file mode 100644 index 00000000..ab733465 --- /dev/null +++ b/schemas/v3.0.0/outputs/resource/list.json @@ -0,0 +1,112 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/list.json", + "title": "dsc resource list result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource list` command.", + "type": "object", + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json" + }, + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "capabilities": { + "title": "Resource capabilities", + "description": "Defines the list of DSC operations the resource is compatible with. If the resource doesn't list a given operation, like `set` or `export`, the resource can't be used for those operations. The exception to this is `test` - DSC uses synthetic testing for resources that don't have the `test` capability.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "get", + "set", + "setHandlesExist", + "whatIf", + "test", + "delete", + "export", + "resolve" + ] + } + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "path": { + "title": "Path", + "description": "Indicates the path to the DSC Resource on the file system.", + "type": "string" + }, + "directory": { + "title": "Directory", + "description": "Indicates the path to the folder containing the DSC Resource on the file system.", + "type": "string" + }, + "implementedAs": { + "title": "Implemented as", + "description": "Indicates how the DSC Resource was implemented.", + "oneOf": [ + { + "title": "Standard implementation", + "description": "Indicates that the DSC Resource is implemented as one of the standard implementations built into DSC.", + "type": "string", + "enum": [ + "command" + ] + }, + { + "title": "Custom implementation", + "description": "Indicates that the DSC Resource uses a custom implementation.", + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "title": "Custom implementation name", + "description": "The name of the custom implementation.", + "type": "string" + } + } + } + ] + }, + "author": { + "title": "Author", + "description": "Indicates the name of the person or organization that developed and maintains the DSC Resource.", + "type": [ + "string", + "null" + ] + }, + "properties": { + "title": "Properties", + "description": "Defines the DSC Resource's property names.", + "type": "array", + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "requireAdapter": { + "title": "Required DSC Resource Adapter", + "description": "Defines the fully qualified type name of the DSC Resource Adapter the DSC Resource depends on.", + "oneOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + { + "type": "null" + } + ] + }, + "manifest": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json" + } + } +} diff --git a/schemas/v3.0.0/outputs/resource/schema.json b/schemas/v3.0.0/outputs/resource/schema.json new file mode 100644 index 00000000..5d597234 --- /dev/null +++ b/schemas/v3.0.0/outputs/resource/schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", + "type": "object" +} diff --git a/schemas/v3.0.0/outputs/resource/set.full.json b/schemas/v3.0.0/outputs/resource/set.full.json new file mode 100644 index 00000000..ae8daeac --- /dev/null +++ b/schemas/v3.0.0/outputs/resource/set.full.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json" + } + } +} diff --git a/schemas/v3.0.0/outputs/resource/set.json b/schemas/v3.0.0/outputs/resource/set.json new file mode 100644 index 00000000..ce930bf9 --- /dev/null +++ b/schemas/v3.0.0/outputs/resource/set.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.full.json" + } + } + ] +} diff --git a/schemas/v3.0.0/outputs/resource/set.simple.json b/schemas/v3.0.0/outputs/resource/set.simple.json new file mode 100644 index 00000000..588c787a --- /dev/null +++ b/schemas/v3.0.0/outputs/resource/set.simple.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } +} diff --git a/schemas/v3.0.0/outputs/resource/test.full.json b/schemas/v3.0.0/outputs/resource/test.full.json new file mode 100644 index 00000000..ffac02e4 --- /dev/null +++ b/schemas/v3.0.0/outputs/resource/test.full.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json" + } + } +} diff --git a/schemas/v3.0.0/outputs/resource/test.json b/schemas/v3.0.0/outputs/resource/test.json new file mode 100644 index 00000000..21ed8a8f --- /dev/null +++ b/schemas/v3.0.0/outputs/resource/test.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.full.json" + } + } + ] +} diff --git a/schemas/v3.0.0/outputs/resource/test.simple.json b/schemas/v3.0.0/outputs/resource/test.simple.json new file mode 100644 index 00000000..5837b750 --- /dev/null +++ b/schemas/v3.0.0/outputs/resource/test.simple.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } +} diff --git a/schemas/v3.0.0/outputs/schema.json b/schemas/v3.0.0/outputs/schema.json new file mode 100644 index 00000000..62826b6c --- /dev/null +++ b/schemas/v3.0.0/outputs/schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", + "type": "object" +} diff --git a/schemas/v3.0.0/resource/manifest.adapter.json b/schemas/v3.0.0/resource/manifest.adapter.json new file mode 100644 index 00000000..62ced41e --- /dev/null +++ b/schemas/v3.0.0/resource/manifest.adapter.json @@ -0,0 +1,58 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources." + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ] +} diff --git a/schemas/v3.0.0/resource/manifest.delete.json b/schemas/v3.0.0/resource/manifest.delete.json new file mode 100644 index 00000000..7ab5cfc0 --- /dev/null +++ b/schemas/v3.0.0/resource/manifest.delete.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0.0/resource/manifest.export.json b/schemas/v3.0.0/resource/manifest.export.json new file mode 100644 index 00000000..f1bc815f --- /dev/null +++ b/schemas/v3.0.0/resource/manifest.export.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0.0/resource/manifest.get.json b/schemas/v3.0.0/resource/manifest.get.json new file mode 100644 index 00000000..7b2d3b1b --- /dev/null +++ b/schemas/v3.0.0/resource/manifest.get.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0.0/resource/manifest.json b/schemas/v3.0.0/resource/manifest.json new file mode 100644 index 00000000..65ab83e3 --- /dev/null +++ b/schemas/v3.0.0/resource/manifest.json @@ -0,0 +1,155 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ] + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/semver.json" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "get": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json" + }, + "set": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json" + }, + "delete": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json" + }, + "export": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json" + }, + "validate": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] + }, + "schema": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ] +} diff --git a/schemas/v3.0.0/resource/manifest.resolve.json b/schemas/v3.0.0/resource/manifest.resolve.json new file mode 100644 index 00000000..feb600fd --- /dev/null +++ b/schemas/v3.0.0/resource/manifest.resolve.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0.0/resource/manifest.schema.json b/schemas/v3.0.0/resource/manifest.schema.json new file mode 100644 index 00000000..75386928 --- /dev/null +++ b/schemas/v3.0.0/resource/manifest.schema.json @@ -0,0 +1,195 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource." + } + } + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": {}, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json" + } + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json" + } + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json" + } + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json" + } + } + } + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ] +} diff --git a/schemas/v3.0.0/resource/manifest.set.json b/schemas/v3.0.0/resource/manifest.set.json new file mode 100644 index 00000000..264f44ae --- /dev/null +++ b/schemas/v3.0.0/resource/manifest.set.json @@ -0,0 +1,83 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0.0/resource/manifest.test.json b/schemas/v3.0.0/resource/manifest.test.json new file mode 100644 index 00000000..7c6da681 --- /dev/null +++ b/schemas/v3.0.0/resource/manifest.test.json @@ -0,0 +1,72 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0.0/resource/manifest.validate.json b/schemas/v3.0.0/resource/manifest.validate.json new file mode 100644 index 00000000..ce02469f --- /dev/null +++ b/schemas/v3.0.0/resource/manifest.validate.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0.0/resource/manifest.whatIf.json b/schemas/v3.0.0/resource/manifest.whatIf.json new file mode 100644 index 00000000..4cb1122d --- /dev/null +++ b/schemas/v3.0.0/resource/manifest.whatIf.json @@ -0,0 +1,83 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0.0/resource/properties/exist.json b/schemas/v3.0.0/resource/properties/exist.json new file mode 100644 index 00000000..f2f3232e --- /dev/null +++ b/schemas/v3.0.0/resource/properties/exist.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json", + "title": "Instance should exist", + "description": "Indicates whether the DSC Resource instance should exist.", + "type": "boolean", + "default": true, + "enum": [ + false, + true + ] +} diff --git a/schemas/v3.0.0/resource/properties/inDesiredState.json b/schemas/v3.0.0/resource/properties/inDesiredState.json new file mode 100644 index 00000000..5321ebc6 --- /dev/null +++ b/schemas/v3.0.0/resource/properties/inDesiredState.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json", + "title": "Instance is in the Desired State", + "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", + "type": [ + "boolean", + "null" + ], + "readOnly": true +} diff --git a/schemas/v3.0.0/resource/properties/purge.json b/schemas/v3.0.0/resource/properties/purge.json new file mode 100644 index 00000000..24d01c9c --- /dev/null +++ b/schemas/v3.0.0/resource/properties/purge.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json", + "title": "Purge", + "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", + "type": [ + "boolean", + "null" + ], + "writeOnly": true +} diff --git a/schemas/v3.0.0/resource/properties/rebootRequested.json b/schemas/v3.0.0/resource/properties/rebootRequested.json new file mode 100644 index 00000000..6464924b --- /dev/null +++ b/schemas/v3.0.0/resource/properties/rebootRequested.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json", + "title": "Reboot Requested", + "description": "Indicates that the set operation requires a reboot before it's fully complete.", + "type": [ + "boolean", + "null" + ], + "readOnly": true +} diff --git a/schemas/v3.0/bundled/config/document.json b/schemas/v3.0/bundled/config/document.json new file mode 100644 index 00000000..7982f98e --- /dev/null +++ b/schemas/v3.0/bundled/config/document.json @@ -0,0 +1,398 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json", + "title": "DSC Configuration Document schema", + "description": "Describes a valid DSC Configuration Document.", + "type": "object", + "required": [ + "$schema", + "resources" + ], + "properties": { + "$schema": { + "title": "Schema", + "description": "This property must be the canonical URL of the DSC Configuration Document schema that the document is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json" + ] + }, + "parameters": { + "title": "DSC Configuration document parameters", + "description": "Defines runtime options for the configuration. Users and integrating tools can override use the defined parameters to pass alternate values to the configuration.", + "type": "object", + "additionalProperties": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/config/document.parameter.json" + } + }, + "variables": { + "title": "Configuration variables", + "description": "Defines a set of reusable values for the configuration document. The names of this value's properties are the strings used to reference a variable's value.", + "type": "object" + }, + "resources": { + "title": "DSC Configuration document resources", + "description": "Defines a list of DSC Resource instances for the configuration to manage.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/config/document.resource.json" + } + }, + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/config/document.metadata.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.parameter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.parameter.json", + "title": "Parameter", + "description": "Defines a runtime option for a DSC Configuration Document.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/dataTypes.json" + }, + "defaultValue": { + "title": "Default value", + "description": "Defines the default value for the parameter.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/validValueTypes.json" + }, + "allowedValues": { + "title": "Allowed values", + "description": "Defines a list of valid values for the parameter. If the parameter is defined with any other values, it's invalid.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/validValueTypes.json" + } + }, + "description": { + "title": "Parameter description", + "description": "Defines a synopsis for the parameter explaining its purpose.", + "type": "string" + }, + "metadata": { + "title": "Parameter metadata", + "description": "Defines a set of key-value pairs for the parameter. This metadata isn't validated.", + "type": "object" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "minValue": { + "title": "Minimum value", + "description": "The minimum valid value for an integer type. If defined with the `maxValue` property, this value must be less than the value of `maxValue`.", + "type": "integer" + }, + "maxValue": { + "title": "Maximum value", + "description": "The maximum valid value for an integer type. If defined with the `minValue` property, this value must be greater than the value of `minValue`.", + "type": "integer" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + }, + { + "properties": { + "type": { + "const": "array" + } + } + } + ] + }, + "then": { + "properties": { + "minLength": { + "title": "Minimum length", + "description": "The minimum valid length for a `string`, `secureString`, or `array`. If defined with the `maxLength` property, this value must be less than the value of `maxLength`.", + "type": "integer", + "minimum": 0 + }, + "maxLength": { + "title": "Maximum length", + "description": "The maximum valid length for a `string`, `secureString`, or `array`. If defined with the `minLength` property, this value must be less than the value of `minLength`.", + "type": "integer", + "minimum": 0 + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "string" + }, + "allowedValues": { + "items": { + "type": "string" + } + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "object" + } + } + }, + { + "properties": { + "type": { + "const": "secureObject" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "object" + }, + "allowedValues": { + "items": { + "type": "object" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "integer" + }, + "allowedValues": { + "items": { + "type": "integer" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "array" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "bool" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "boolean" + }, + "allowedValues": { + "items": { + "type": "boolean" + } + } + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.resource.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.resource.json", + "title": "DSC Resource instance", + "description": "Defines an instance of a DSC Resource in a configuration.", + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "dependsOn": { + "title": "Instance depends on", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", + "type": "array", + "items": { + "type": "string", + "uniqueItems": true, + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$" + } + }, + "properties": { + "title": "Managed instance properties", + "description": "Defines the properties of the DSC Resource this instance manages. This property's value must be an object. DSC validates the property's value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.metadata.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.metadata.json", + "title": "Configuration metadata", + "description": "Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` property, this metadata isn't validated. You can pass any data into this property of a configuration document.", + "type": "object", + "properties": { + "Microsoft.DSC": { + "type": "object", + "title": "DSC metadata", + "description": "The `Microsoft.DSC` metadata property contains directives and information that DSC itself uses when processing a configuration document. Unlike other metadata key-value pairs, DSC validates these properties.", + "unevaluatedProperties": false, + "properties": { + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "default": "Current", + "description": "This property defines the security context a configuration requires. If you invoke a DSC operation against the configuration document in a security context that conflicts with this metadata, DSC raises an error when it validates the configuration document.\nThe default security context is `Current`." + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/dataTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/dataTypes.json", + "title": "Data Types", + "description": "Defines the data type for the parameter value.", + "type": "string", + "enum": [ + "string", + "secureString", + "int", + "bool", + "object", + "secureObject", + "array" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/validValueTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/validValueTypes.json", + "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", + "type": [ + "string", + "integer", + "object", + "array", + "boolean" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + } + } +} diff --git a/schemas/v3.0/bundled/config/document.vscode.json b/schemas/v3.0/bundled/config/document.vscode.json new file mode 100644 index 00000000..284a0377 --- /dev/null +++ b/schemas/v3.0/bundled/config/document.vscode.json @@ -0,0 +1,617 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json", + "title": "DSC Configuration Document schema", + "description": "Describes a valid DSC Configuration Document.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDescribes a valid DSC Configuration Document.\n\nDSC Configurations enable users to define state by combining different DSC Resources. A\nconfiguration document uses parameters and variables to pass to a set of one or more resources\nthat define a desired state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "$schema", + "resources" + ], + "properties": { + "$schema": { + "title": "Schema", + "description": "This property must be the canonical URL of the DSC Configuration Document schema that the document is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property must be the canonical URL of the DSC Configuration Document schema that the\ndocument is implemented for.\n\nFor every version of the schema, there are three valid urls:\n\n```yaml\n.../config/document.json\n```\n\n> The URL to the canonical non-bundled schema. When it's used for validation, the validating\n> client needs to retrieve this schema and every schema it references.\n \n```yaml\n.../bundled/config/document.json\n```\n\n> The URL to the bundled schema. When it's used for validation, the validating client only\n> needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n\n```yaml\n.../bundled/config/document.vscode.json\n```\n\n> The URL to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and snippets\n> that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#schema\n", + "markdownEnumDescriptions": [ + "\n\n> #### `v3.0` non-bundled\n>\n> Indicates that the configuration document adheres to the `v3.0` schema. This URL\n> points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `v3.0` bundled\n>\n> Indicates that the configuration document adheres to the `v3.0` schema. This URL\n> points to the bundled schema. When it's used for validation, the validating client\n> only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `v3.0` enhanced authoring\n>\n> Indicates that the configuration document adheres to the `v3.0` schema. This URL\n> points to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/10` non-bundled\n>\n> Indicates that the configuration document adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/10` bundled\n>\n> Indicates that the configuration document adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/10` enhanced authoring\n>\n> Indicates that the configuration document adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/08` non-bundled\n>\n> Indicates that the configuration document adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/08` bundled\n>\n> Indicates that the configuration document adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/08` enhanced authoring\n>\n> Indicates that the configuration document adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n" + ] + }, + "parameters": { + "title": "DSC Configuration document parameters", + "description": "Defines runtime options for the configuration. Users and integrating tools can override use the defined parameters to pass alternate values to the configuration.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/config/document.parameter.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines runtime options for the configuration. Users and integrating tools can override use\nthe defined parameters to pass alternate values to the configuration.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#parameters\n", + "defaultSnippets": [ + { + "label": " New Parameter", + "markdownDescription": "Defines a new runtime option for the configuration.\n\n```yaml\nparameterId:\n type: \n description: \n defaultValue: \n allowedValues:\n - \n```", + "body": { + "${1:parameterId}": { + "type": "$2", + "description": "$3", + "defaultValue": "$4", + "allowedValues": [ + "$5" + ] + } + } + }, + { + "label": " New Integer Parameter", + "markdownDescription": "Defines a new runtime option for the configuration as an integer value.\n\n```yaml\nparameterId:\n type: int\n description: \n defaultValue: \n minValue: \n minValue: \n```", + "body": { + "${1:parameterId}": { + "type": "int", + "description": "$2", + "defaultValue": "$3", + "minValue": "$4", + "maxValue": "$5" + } + } + } + ] + }, + "variables": { + "title": "Configuration variables", + "description": "Defines a set of reusable values for the configuration document. The names of this value's properties are the strings used to reference a variable's value.", + "type": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a set of reusable values for the configuration document. The names of this value's\nproperties are the strings used to reference a variable's value.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#variables\n", + "defaultSnippets": [ + { + "label": " New variable property", + "markdownDescription": "Defines a new variable as a key-value pair.\n\n```yaml\nvariableName: variableValue\n```", + "body": { + "${1:variableName}": "${2:variableValue}" + } + }, + { + "label": " New variable property (object)", + "markdownDescription": "Defines a new key-value pair for the variables where the value is an object.\n\n```yaml\nvariableName:\n key: value\n```", + "body": { + "${1:variableName}": { + "${2:key}": "${3:value}" + } + } + }, + { + "label": " New variable property (array)", + "markdownDescription": "Defines a new key-value pair for the variables where the value is an array.\n\n```yaml\nvariableName:\n - firstValue\n - secondValue\n```", + "body": { + "${1:variableName}": [ + "${2:firstValue}", + "${3:secondValue}" + ] + } + } + ] + }, + "resources": { + "title": "DSC Configuration document resources", + "description": "Defines a list of DSC Resource instances for the configuration to manage.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/config/document.resource.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of DSC Resource instances for the configuration to manage.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#resources\n" + }, + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/config/document.metadata.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0": { + "config": { + "document.parameter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.parameter.json", + "title": "Parameter", + "description": "Defines a runtime option for a DSC Configuration Document.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a runtime option for a DSC Configuration Document.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/dataTypes.json" + }, + "defaultValue": { + "title": "Default value", + "description": "Defines the default value for the parameter.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/validValueTypes.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the default value for the parameter.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#allowedvalues\n" + }, + "allowedValues": { + "title": "Allowed values", + "description": "Defines a list of valid values for the parameter. If the parameter is defined with any other values, it's invalid.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/validValueTypes.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of valid values for the parameter. If the parameter is defined with any other\nvalues, it's invalid.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#allowedvalues\n" + }, + "description": { + "title": "Parameter description", + "description": "Defines a synopsis for the parameter explaining its purpose.", + "type": "string", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a synopsis for the parameter explaining its purpose.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#description-1\n" + }, + "metadata": { + "title": "Parameter metadata", + "description": "Defines a set of key-value pairs for the parameter. This metadata isn't validated.", + "type": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a set of key-value pairs for the parameter. This metadata isn't validated.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#metadata-1\n", + "defaultSnippets": [ + { + "label": " New metadata property", + "markdownDescription": "Defines a key-value pair for the metadata:\n\n```yaml\nmetadataName: value\n```", + "body": { + "${1:metadataName}": "${2:value}" + } + }, + { + "label": " New metadata property (object)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an object.\n\n```yaml\nmetadataName:\n key: value\n```", + "body": { + "${1:metadataName}": { + "${2:key}": "${3:value}" + } + } + }, + { + "label": " New metadata property (array)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an array.\n\n```yaml\nmetadataName:\n - firstValue\n - secondValue\n```", + "body": { + "${1:metadataName}": [ + "${2:firstValue}", + "${3:secondValue}" + ] + } + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "minValue": { + "title": "Minimum value", + "description": "The minimum valid value for an integer type. If defined with the `maxValue` property, this value must be less than the value of `maxValue`.", + "type": "integer", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe minimum valid value for an integer type. If defined with the `maxValue` property,\nthis value must be less than the value of `maxValue`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#minvalue\n" + }, + "maxValue": { + "title": "Maximum value", + "description": "The maximum valid value for an integer type. If defined with the `minValue` property, this value must be greater than the value of `minValue`.", + "type": "integer", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe maximum valid value for an integer type. If defined with the `minValue` property,\nthis value must be greater than the value of `minValue`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#maxvalue\n" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + }, + { + "properties": { + "type": { + "const": "array" + } + } + } + ] + }, + "then": { + "properties": { + "minLength": { + "title": "Minimum length", + "description": "The minimum valid length for a `string`, `secureString`, or `array`. If defined with the `maxLength` property, this value must be less than the value of `maxLength`.", + "type": "integer", + "minimum": 0, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe minimum valid length for a `string`, `secureString`, or `array`. If defined with\nthe `maxLength` property, this value must be less than the value of `maxLength`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#minLength\n" + }, + "maxLength": { + "title": "Maximum length", + "description": "The maximum valid length for a `string`, `secureString`, or `array`. If defined with the `minLength` property, this value must be less than the value of `minLength`.", + "type": "integer", + "minimum": 0, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe maximum valid length for a `string`, `secureString`, or `array`. If defined with\nthe `minLength` property, this value must be less than the value of `minLength`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#maxLength\n" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "string" + }, + "allowedValues": { + "items": { + "type": "string" + } + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "object" + } + } + }, + { + "properties": { + "type": { + "const": "secureObject" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "object" + }, + "allowedValues": { + "items": { + "type": "object" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "integer" + }, + "allowedValues": { + "items": { + "type": "integer" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "array" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "bool" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "boolean" + }, + "allowedValues": { + "items": { + "type": "boolean" + } + } + } + } + } + ] + }, + "document.resource.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.resource.json", + "title": "DSC Resource instance", + "description": "Defines an instance of a DSC Resource in a configuration.", + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "dependsOn": { + "title": "Instance depends on", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", + "type": "array", + "items": { + "type": "string", + "uniqueItems": true, + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$", + "patternErrorMessage": "Invalid value, must be a value like `[resourceId('', '`)], such as\n`[resourceId('Microsoft/OSInfo', 'Foo')]`.\n\nThe `` and `` should be the fully qualified type of the resource and its\nfriendly name in the configuration.\n", + "defaultSnippets": [ + { + "label": " New dependency", + "markdownDescription": "Defines a new dependency for the resource instance.\n\n```yaml\n\"[resourceId('dependencyInstance/Type', 'dependencyInstanceName')]\"\n```", + "bodyText": "\"[resourceId('${3:dependencyInstance/Type}', '${4:dependencyInstanceName}')]\"" + } + ] + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of DSC Resource instances that DSC must successfully process before processing\nthis instance. Each value for this property must be the `resourceID()` lookup for another\ninstance in the configuration. Multiple instances can depend on the same instance, but every\ndependency for an instance must be unique in that instance's `dependsOn` property.\n\nThe `resourceID()` function uses this syntax:\n\n```yaml\n\"[resourceId('', '']\"\n```\n\nThe `` value is the `type` property of the dependent resource and\n`` is the dependency's `name` property. When adding a dependency in a\nYAML-format configuration document, always wrap the `resourceID()` lookup in double quotes\n(`\"`).\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#properties-1\n" + }, + "properties": { + "title": "Managed instance properties", + "description": "Defines the properties of the DSC Resource this instance manages. This property's value must be an object. DSC validates the property's value against the DSC Resource's schema.", + "type": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the properties of the DSC Resource this instance manages. This property's value must\nbe an object. DSC validates the property's value against the DSC Resource's schema.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#properties-1\n" + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an instance of a DSC Resource in a configuration.\n\nThe `resources` property of a DSC Configuration document always includes at least one DSC Resource\ninstance. Together, the instances in a configuration define the desired state that DSC can get,\ntest, and set on a machine.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " New resource instance", + "markdownDescription": "Defines a new instance of a DSC Resource for the configuration.\n\n```yaml\ntype: owner[.group][.area]/name\nname: instance_name\nproperties:\n propertyName: propertyValue\n```", + "body": { + "type": "${1:owner[.group][.area]/name}", + "name": "${2:instance_name}", + "properties": { + "${3:propertyName}": "${4:propertyValue}" + } + } + }, + { + "label": " New dependent resource instance", + "markdownDescription": "Defines a new instance of a DSC Resource for the configuration that depends on another\ninstance.\n\n```yaml\ntype: owner[.group][.area]/name\nname: instance_name\ndependsOn:\n - \"[resourceId('dependencyInstance/Type', 'dependencyInstanceName')]\"\nproperties:\n propertyName: propertyValue\n```", + "body": { + "type": "${1:owner[.group][.area]/name}", + "name": "${2:instance_name}", + "dependsOn": [ + "\"[resourceId('${3:dependencyInstance/Type}', '${4:dependencyInstanceName}')]\"" + ], + "properties": { + "${5:propertyName}": "${6:propertyValue}" + } + } + } + ] + }, + "document.metadata.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.metadata.json", + "title": "Configuration metadata", + "description": "Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` property, this metadata isn't validated. You can pass any data into this property of a configuration document.", + "type": "object", + "properties": { + "Microsoft.DSC": { + "type": "object", + "title": "DSC metadata", + "description": "The `Microsoft.DSC` metadata property contains directives and information that DSC itself uses when processing a configuration document. Unlike other metadata key-value pairs, DSC validates these properties.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe `Microsoft.DSC` metadata property contains directives and information that DSC itself\nuses when processing a configuration document. Unlike other metadata key-value pairs, DSC\nvalidates these properties.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true#microsoft.dsc\n", + "unevaluatedProperties": false, + "properties": { + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "default": "Current", + "description": "This property defines the security context a configuration requires. If you invoke a DSC operation against the configuration document in a security context that conflicts with this metadata, DSC raises an error when it validates the configuration document.\nThe default security context is `Current`.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property defines the security context a configuration requires. If you invoke a DSC\noperation against the configuration document in a security context that conflicts with\nthis metadata, DSC raises an error when it validates the configuration document.\n\nThe default security context is `Current`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true#microsoft.dsc\n", + "markdownEnumDescriptions": [ + "\n\n> ### Current security context\n>\n> Indicates that the configuration document is usable under any security context. You\n> can invoke DSC operations against the document when elevated as root or an\n> administrator and as a normal user or account.\n", + "\n\n> ### Elevated security context\n>\n> Indicates that the configuration document is usable only in an elevated security\n> context. You can invoke DSC operations against the document when elevated as root or\n> an administrator. When you invoke DSC operations against the document as a\n> non-elevated user or account, DSC raises an error when it validates the configuration\n> document.\n", + "\n\n> ### Restricted security context\n>\n> Indicates that the configuration document is usable only in a non-elevated security\n> context. You can invoke DSC operations against the document as a non-elevated user or\n> account. When you invoke DSC operations against the document as root or an\n> administrator, DSC raises an error when it validates the configuration document.\n" + ] + } + } + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC`\nproperty, this metadata isn't validated. You can pass any data into this property of a\nconfiguration document.\n\nThe `Microsoft.DSC` metadata property contains metadata directives and information that DSC\nitself uses when processing the configuration document. For more information, see\n[Microsoft.DSC][02]\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true#microsoft.dsc\n", + "defaultSnippets": [ + { + "label": " New metadata property", + "markdownDescription": "Defines a key-value pair for the metadata:\n\n```yaml\nmetadataName: value\n```", + "body": { + "${1:metadataName}": "${2:value}" + } + }, + { + "label": " New metadata property (object)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an object.\n\n```yaml\nmetadataName:\n key: value\n```", + "body": { + "${1:metadataName}": { + "${2:key}": "${3:value}" + } + } + }, + { + "label": " New metadata property (array)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an array.\n\n```yaml\nmetadataName:\n - firstValue\n - secondValue\n```", + "body": { + "${1:metadataName}": [ + "${2:firstValue}", + "${3:secondValue}" + ] + } + } + ] + } + }, + "definitions": { + "parameters": { + "dataTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/dataTypes.json", + "title": "Data Types", + "description": "Defines the data type for the parameter value.", + "type": "string", + "enum": [ + "string", + "secureString", + "int", + "bool", + "object", + "secureObject", + "array" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the data type for the parameter value.\n\nThe valid data types for a parameter are:\n\n- `array` for arrays\n- `bool` for booleans\n- `int` for integers\n- `object` for objects\n- `string` for strings\n- `secureObject` for secure objects\n- `secureString` for secure strings\n\nAccess parameters in a configuration using this syntax:\n\n```yaml\n\"[parameter('')]\"\n```\n\nIn YAML, the parameter syntax needs to be enclosed in double-quotes when used as an inline value.\nIf the syntax isn't quoted, YAML interprets the syntax as an array.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true\n", + "markdownEnumDescriptions": [ + "_Strings are an arbitrary set of text._\n\n> To define a long strings in YAML, use the folded block syntax or literal block syntax by\n> adding a `>` or `|` and a line break after the key. Then, indent the next line. Every line\n> in the string must start at the same level of indentation. You can trim the trailing\n> whitespace by using `>-` or `|-` instead.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#strings\n", + "_Secure strings are text that needs to be handled securely._\n\n> Secure strings are an arbitrary set of text that DSC and integrating tools shouldn't log or\n> record. If a secure data type parameter is used for a resource instance property that doesn't\n> expect a secure value, the resource may still log or record the value. If the resource has\n> independent logging or recording that isn't handled by DSC, the value may be stored\n> insecurely.\n>\n> Use secure strings for passwords and secrets. Never define a default value for secure string\n> parameters.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#secure-strings-and-objects\n", + "_Integer values are numbers without a fractional part._\n\n> Integer values may be limited by integrating tools or the DSC Resources they're used with.\n> DSC itself supports integer values between `-9223372036854775808` and `9223372036854775807`.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#integers\n", + "_Boolean values are either `true` or `false`._\n\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#booleans\n", + "_Objects define a set of key-value pairs._\n\n> The value for each key can be any valid data type. The values can be the same type or\n> different types.\n>\n> Access keys in the object using dot-notation. Dot-notation uses this syntax:\n>\n> ```yaml\n> \"[parameters('').]\n> ```\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#objects\n", + "_Secure objects are key-value pairs that need to be handled securely._\n\n> Secure objects define a set of key-value pairs that DSC and integrating tools shouldn't log\n> or record. If a secure data type parameter is used for a resource instance property that\n> doesn't expect a secure value, the resource may still log or record the value. If the\n> resource has independent logging or recording that isn't handled by DSC, the value may be\n> stored insecurely.\n>\n> Never define a default value for secure object parameters.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#secure-strings-and-objects\n", + "_Arrays are a list of one or more values._\n\n> The values in the array can be any valid data type. Values in the array can be the same type\n> or different types.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#arrays\n" + ] + }, + "validValueTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/validValueTypes.json", + "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", + "type": [ + "string", + "integer", + "object", + "array", + "boolean" + ] + } + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + } + }, + "metadata": { + "Microsoft.DSC": { + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0/bundled/outputs/config/get.json b/schemas/v3.0/bundled/outputs/config/get.json new file mode 100644 index 00000000..de5ee45e --- /dev/null +++ b/schemas/v3.0/bundled/outputs/config/get.json @@ -0,0 +1,333 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/get.json", + "title": "DSC Configuration get command result", + "description": "Represents the data structure returned by the `dsc config get` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `get` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/message.json" + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } +} diff --git a/schemas/v3.0/bundled/outputs/config/get.vscode.json b/schemas/v3.0/bundled/outputs/config/get.vscode.json new file mode 100644 index 00000000..7569418b --- /dev/null +++ b/schemas/v3.0/bundled/outputs/config/get.vscode.json @@ -0,0 +1,368 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/get.json", + "title": "DSC Configuration get command result", + "description": "Represents the data structure returned by the `dsc config get` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `get` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json" + } + }, + "messages": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0": { + "metadata": { + "configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "Microsoft.DSC": { + "version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "markdownDescription": "Defines the version of DSC that ran the command. This value is always the semantic version of the\nDSC command, like `3.0.0-preview.7`.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "markdownDescription": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or\n`Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "markdownDescription": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf`\nmode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set`\noperations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the start date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the end date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "markdownDescription": "Defines whether the operation was for a configuration or a resource. If the value for this\nmetadata property is `configuration`, DSC was run through the `dsc config` command. If the value\nis `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + } + }, + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + } + }, + "outputs": { + "resource": { + "get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json" + } + } + }, + "get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json" + } + } + ] + }, + "get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + } + } + }, + "definitions": { + "messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/message.json" + } + }, + "hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0/bundled/outputs/config/set.json b/schemas/v3.0/bundled/outputs/config/set.json new file mode 100644 index 00000000..c41d0a81 --- /dev/null +++ b/schemas/v3.0/bundled/outputs/config/set.json @@ -0,0 +1,349 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/set.json", + "title": "DSC Configuration set command result", + "description": "Represents the data structure returned by the `dsc config set` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `set` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/message.json" + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } +} diff --git a/schemas/v3.0/bundled/outputs/config/set.vscode.json b/schemas/v3.0/bundled/outputs/config/set.vscode.json new file mode 100644 index 00000000..bb2a49bd --- /dev/null +++ b/schemas/v3.0/bundled/outputs/config/set.vscode.json @@ -0,0 +1,384 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/set.json", + "title": "DSC Configuration set command result", + "description": "Represents the data structure returned by the `dsc config set` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `set` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json" + } + }, + "messages": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0": { + "metadata": { + "configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "Microsoft.DSC": { + "version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "markdownDescription": "Defines the version of DSC that ran the command. This value is always the semantic version of the\nDSC command, like `3.0.0-preview.7`.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "markdownDescription": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or\n`Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "markdownDescription": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf`\nmode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set`\noperations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the start date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the end date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "markdownDescription": "Defines whether the operation was for a configuration or a resource. If the value for this\nmetadata property is `configuration`, DSC was run through the `dsc config` command. If the value\nis `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + } + }, + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + } + }, + "outputs": { + "resource": { + "set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json" + } + } + }, + "set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json" + } + } + ] + }, + "set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/message.json" + } + }, + "hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0/bundled/outputs/config/test.json b/schemas/v3.0/bundled/outputs/config/test.json new file mode 100644 index 00000000..f2b0030b --- /dev/null +++ b/schemas/v3.0/bundled/outputs/config/test.json @@ -0,0 +1,355 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/test.json", + "title": "DSC Configuration test command result", + "description": "Represents the data structure returned by the `dsc config test` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `test` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/message.json" + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } +} diff --git a/schemas/v3.0/bundled/outputs/config/test.vscode.json b/schemas/v3.0/bundled/outputs/config/test.vscode.json new file mode 100644 index 00000000..53a07650 --- /dev/null +++ b/schemas/v3.0/bundled/outputs/config/test.vscode.json @@ -0,0 +1,390 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/test.json", + "title": "DSC Configuration test command result", + "description": "Represents the data structure returned by the `dsc config test` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `test` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json" + } + }, + "messages": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0": { + "metadata": { + "configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "Microsoft.DSC": { + "version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "markdownDescription": "Defines the version of DSC that ran the command. This value is always the semantic version of the\nDSC command, like `3.0.0-preview.7`.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "markdownDescription": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or\n`Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "markdownDescription": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf`\nmode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set`\noperations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the start date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the end date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "markdownDescription": "Defines whether the operation was for a configuration or a resource. If the value for this\nmetadata property is `configuration`, DSC was run through the `dsc config` command. If the value\nis `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + } + }, + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + } + }, + "outputs": { + "resource": { + "test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json" + } + } + }, + "test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json" + } + } + ] + }, + "test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/message.json" + } + }, + "hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0/bundled/outputs/resource/get.json b/schemas/v3.0/bundled/outputs/resource/get.json new file mode 100644 index 00000000..46cc9cef --- /dev/null +++ b/schemas/v3.0/bundled/outputs/resource/get.json @@ -0,0 +1,130 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json" + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } +} diff --git a/schemas/v3.0/bundled/outputs/resource/get.vscode.json b/schemas/v3.0/bundled/outputs/resource/get.vscode.json new file mode 100644 index 00000000..9d2904cd --- /dev/null +++ b/schemas/v3.0/bundled/outputs/resource/get.vscode.json @@ -0,0 +1,156 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json" + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0": { + "outputs": { + "resource": { + "get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json" + } + } + }, + "get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json" + } + } + ] + } + } + }, + "metadata": { + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "Microsoft.DSC": { + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } + }, + "definitions": { + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0/bundled/outputs/resource/list.json b/schemas/v3.0/bundled/outputs/resource/list.json new file mode 100644 index 00000000..5a4be08c --- /dev/null +++ b/schemas/v3.0/bundled/outputs/resource/list.json @@ -0,0 +1,1238 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/list.json", + "title": "dsc resource list result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource list` command.", + "type": "object", + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json" + }, + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "capabilities": { + "title": "Resource capabilities", + "description": "Defines the list of DSC operations the resource is compatible with. If the resource doesn't list a given operation, like `set` or `export`, the resource can't be used for those operations. The exception to this is `test` - DSC uses synthetic testing for resources that don't have the `test` capability.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "get", + "set", + "setHandlesExist", + "whatIf", + "test", + "delete", + "export", + "resolve" + ] + } + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "path": { + "title": "Path", + "description": "Indicates the path to the DSC Resource on the file system.", + "type": "string" + }, + "directory": { + "title": "Directory", + "description": "Indicates the path to the folder containing the DSC Resource on the file system.", + "type": "string" + }, + "implementedAs": { + "title": "Implemented as", + "description": "Indicates how the DSC Resource was implemented.", + "oneOf": [ + { + "title": "Standard implementation", + "description": "Indicates that the DSC Resource is implemented as one of the standard implementations built into DSC.", + "type": "string", + "enum": [ + "command" + ] + }, + { + "title": "Custom implementation", + "description": "Indicates that the DSC Resource uses a custom implementation.", + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "title": "Custom implementation name", + "description": "The name of the custom implementation.", + "type": "string" + } + } + } + ] + }, + "author": { + "title": "Author", + "description": "Indicates the name of the person or organization that developed and maintains the DSC Resource.", + "type": [ + "string", + "null" + ] + }, + "properties": { + "title": "Properties", + "description": "Defines the DSC Resource's property names.", + "type": "array", + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "requireAdapter": { + "title": "Required DSC Resource Adapter", + "description": "Defines the fully qualified type name of the DSC Resource Adapter the DSC Resource depends on.", + "oneOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + { + "type": "null" + } + ] + }, + "manifest": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ] + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "get": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json" + }, + "set": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json" + }, + "delete": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json" + }, + "export": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json" + }, + "validate": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] + }, + "schema": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources." + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource." + } + } + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": {}, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json" + } + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json" + } + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json" + } + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json" + } + } + } + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command." + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json", + "title": "Instance should exist", + "description": "Indicates whether the DSC Resource instance should exist.", + "type": "boolean", + "default": true, + "enum": [ + false, + true + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json", + "title": "Instance is in the Desired State", + "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json", + "title": "Purge", + "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", + "type": [ + "boolean", + "null" + ], + "writeOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json", + "title": "Reboot Requested", + "description": "Indicates that the set operation requires a reboot before it's fully complete.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + } + } +} diff --git a/schemas/v3.0/bundled/outputs/resource/list.vscode.json b/schemas/v3.0/bundled/outputs/resource/list.vscode.json new file mode 100644 index 00000000..2b15a224 --- /dev/null +++ b/schemas/v3.0/bundled/outputs/resource/list.vscode.json @@ -0,0 +1,2068 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/list.json", + "title": "dsc resource list result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource list` command.", + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "kind": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json" + }, + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "capabilities": { + "title": "Resource capabilities", + "description": "Defines the list of DSC operations the resource is compatible with. If the resource doesn't list a given operation, like `set` or `export`, the resource can't be used for those operations. The exception to this is `test` - DSC uses synthetic testing for resources that don't have the `test` capability.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "get", + "set", + "setHandlesExist", + "whatIf", + "test", + "delete", + "export", + "resolve" + ] + } + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "path": { + "title": "Path", + "description": "Indicates the path to the DSC Resource on the file system.", + "type": "string" + }, + "directory": { + "title": "Directory", + "description": "Indicates the path to the folder containing the DSC Resource on the file system.", + "type": "string" + }, + "implementedAs": { + "title": "Implemented as", + "description": "Indicates how the DSC Resource was implemented.", + "oneOf": [ + { + "title": "Standard implementation", + "description": "Indicates that the DSC Resource is implemented as one of the standard implementations built into DSC.", + "type": "string", + "enum": [ + "command" + ] + }, + { + "title": "Custom implementation", + "description": "Indicates that the DSC Resource uses a custom implementation.", + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "title": "Custom implementation name", + "description": "The name of the custom implementation.", + "type": "string" + } + } + } + ] + }, + "author": { + "title": "Author", + "description": "Indicates the name of the person or organization that developed and maintains the DSC Resource.", + "type": [ + "string", + "null" + ] + }, + "properties": { + "title": "Properties", + "description": "Defines the DSC Resource's property names.", + "type": "array", + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "requireAdapter": { + "title": "Required DSC Resource Adapter", + "description": "Defines the fully qualified type name of the DSC Resource Adapter the DSC Resource depends on.", + "oneOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + { + "type": "null" + } + ] + }, + "manifest": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0": { + "definitions": { + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the resource is a normal DSC Resource, a group resource, or an adapter\nresource. This property is only required for group resources.\n\nDSC infers the default value for this property based on whether the [adapter][02] property is\ndefined in the manifest:\n\n- If the `adapter` property is defined in the manifest, the default `kind` is `Adapter`.\n- If the `adapter` property is not defined in the manifest, the default `kind` is `Resource`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "markdownEnumDescriptions": [ + "\n\nIndicates that the manifest is for a standard command-based DSC Resource.\n", + "\n\nIndicates that the manifest is for an adapter resource that enables the use of\nnon-command-based resources with DSC.\n", + "\n\nIndicates that the manifest is for a group resource that processes an array of nested\nresource instances.\n", + "\n\nIndicates that the manifest is for an import resource that resolves an external source to DSC\nresource instances. The resolved instances are processed as nested instances for the import\nresource.\n" + ] + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "defaultSnippets": [ + { + "label": "String argument", + "markdownDescription": "Add a string argument to the command, like `config` or `--config`.", + "body": "${1:argument_name}" + }, + { + "label": "JSON input argument", + "markdownDescription": "Add a JSON input argument to the command. A command can only define one JSON input argument\nin the `args` list. When you define a JSON input argument, DSC passes the input data for\nthe command to the specified argument as a string representing the data as a compressed\nJSON object. The compressed JSON object doesn't have any spaces or newlines between the\nobject properties and values.\n\nIf the command doesn't define the `input` property, it must define a JSON input argument.\n\nIf the command defines both the `input` property and a JSON input argument, DSC sends the\ninput data to the command in both ways. For example, if the command defines `input` as\n`stdin` and has a JSON input argument in `args`, DSC sends the input data as a compressed\nJSON object over stdin and to the the specified argument.", + "body": { + "jsonInputArg": "${1:argument_name}", + "mandatory": "^$2" + } + } + ], + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command.", + "markdownDescription": "Any item in the argument array can be a string representing a static argument to pass to\nthe command.\n" + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "markdownDescription": "Defines an argument for the command that accepts the JSON input object as a string. DSC\npasses the JSON input to the named argument when available. You can define the `mandatory`\nproperty to indicate whether DSC should always pass the argument to the command, even when\nthere's no JSON input for the command. In that case, DSC passes an empty string to the\nJSON input argument. You can only define one JSON input argument per arguments array.\n\nIf you define a JSON input argument and an `input` kind for a command, DSC sends the JSON\ndata both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "markdownDescription": "Defines the argument that accepts the JSON property bag for the resource as input.\n", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "markdownDescription": "Defines whether the argument is mandatory. If this property is set to `true`, DSC\npasses an empty string when no JSON input is provided. The default value is `false`.\n", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ], + "markdownEnumDescriptions": [ + "_Environment variables_\n\n> Indicates that the resource expects the properties of an instance to be specified as\n> environment variables with the same names and casing.\n>\n> This option only supports the following data types for instance properties:\n>\n> - `boolean`\n> - `integer`\n> - `number`\n> - `string`\n> - `array` of `integer` values\n> - `array` of `number` values\n> - `array` of `string` values\n>\n> For non-array values, DSC sets the environment variable to the specified value as-is. When\n> the data type is an array of values, DSC sets the environment variable as a comma-delimited\n> string. For example, the property `foo` with a value of `[1, 2, 3]` is saved in the `foo`\n> environment variable as `\"1,2,3\"`.\n>\n> If the resource needs to support complex properties with an `object` value or multi-type\n> arrays, set this to `stdin` instead.\n", + "_JSON over `stdin`_\n\n> Indicates that the resource expects a JSON blob representing an instance from `stdin`.\n> The JSON must adhere to the instance schema.\n" + ] + }, + "returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + } + }, + "resource": { + "manifest.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the information DSC and integrating require to process and call a command-based DSC\nResource. For DSC to use a manifest on a system, the manifest file must:\n\n1. Be discoverable in the `PATH` environment variable.\n1. Follow the naming convention `.dsc.resource.json`.\n1. Be valid for this schema.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define a resource", + "markdownDescription": "Defines a standard resource that:\n\n- Can get the current state of an instance\n- Can set an instance to the desired state\n- Relies on DSC's synthetic testing to determine whether an instance is in the desired state\n- Defines an embedded JSON schema.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "set": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "implementsPretest": "^${11:false}", + "return": "${12:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (group)", + "markdownDescription": "Defines a group resource that expects a list of resource instances and operates on them.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "group", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${18|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${19:Resources}", + "description": "${20:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.resource.json" + } + }, + "${21:name}": { + "title": "${22:property title}", + "description": "${23:explanation of property purpose and usage}", + "type": "${24|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (adapter)", + "markdownDescription": "Defines an adapter resource that enables users to define non-command-based DSC Resources in\nthe configuration.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "adapter", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "adapter": { + "config": "${18|full,sequence|}", + "list": { + "executable": "${19:executable name}", + "args": [ + "${20:argument}" + ] + } + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${23|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${24:Resources}", + "description": "${25:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.resource.json" + } + }, + "${26:name}": { + "title": "${27:property title}", + "description": "${28:explanation of property purpose and usage}", + "type": "${29|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (importer)", + "markdownDescription": "Defines an importer resource that can resolve an external source to nested resource\ninstances.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "importer", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "resolve": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (assertion-only)", + "markdownDescription": "Defines an assertion resource that can get the current state of an instance but not configure\nit. By default, the resource relies on DSC's synthetic testing feature. If the resource\nimplements the `test` operation itself, define the `test` property.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + } + ], + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property must be one of the canonical URLs for the version of the Command-based DSC\nResource Manifest schema that the manifest is implemented for.\n\nFor every version of the schema, there are three valid urls:\n\n```yaml\n.../resource/manifest.json\n```\n\n> The URL to the canonical non-bundled schema. When it's used for validation, the validating\n> client needs to retrieve this schema and every schema it references.\n\n```yaml\n.../bundled/resource/manifest.json\n```\n\n> The URL to the bundled schema. When it's used for validation, the validating client only\n> needs to retrieve this schema.\n> \n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n\n```yaml\n.../bundled/resource/manifest.vscode.json\n```\n\n> The URL to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and snippets\n> that the others don't include.\n> \n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#schema\n", + "markdownEnumDescriptions": [ + "\n\n> #### `v3.0` non-bundled\n>\n> Indicates that the resource manifest adheres to the `v3.0` schema. This URL\n> points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `v3.0` bundled\n>\n> Indicates that the resource manifest adheres to the `v3.0` schema. This URL\n> points to the bundled schema. When it's used for validation, the validating client\n> only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `v3.0` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `v3.0` schema. This URL\n> points to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/10` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/10` bundled\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0` of the schema.\n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/10` enhanced authoring\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0` of the schema.\n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/08` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/08` bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/08` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n" + ] + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe semantic version ([semver][02]) of the DSC Resource. This version identifies the DSC\nResource, not the version of the application it manages.\n\nThis value uses the [suggested regular expression][03] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#version\n[02]: https://semver.org/\n[03]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a short synopsis of the DSC Resource's purpose.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#description-1\n" + }, + "kind": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of searchable terms for the resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#tags\n", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$", + "patternErrorMessage": "Invalid tag. Tags must be a string of alphanumeric characters and underscores. No other\ncharacters are permitted.\n" + } + }, + "get": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json" + }, + "set": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json" + }, + "delete": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json" + }, + "export": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json" + }, + "validate": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$", + "patternErrorMessage": "Invalid exit code. Must be a string representing a 32-bit signed integer.\n" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property defines a map of valid exit codes for the DSC Resource. DSC always interprets\nexit code `0` as a successful operation and any other exit code as an error. Use this\nproperty to indicate human-readable semantic meanings for the DSC Resource's exit codes.\n\nDefine the keys in this property as strings representing a valid 32-bit signed integer. You\ncan't use alternate formats for the exit code. For example, instead of the hexadecimal value\n`0x80070005` for \"Access denied\", specify the exit code as `-2147024891`. If you're authoring\nyour resource manifest in yaml, be sure to wrap the exit code in single quotes, like\n`'0': Success` instead of `0: Success` to ensure the YAML file can be parsed correctly.\n\nDefine the value for each key as a string explaining what the exit code indicates.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#exitcodes\n", + "defaultSnippets": [ + { + "label": " Defined exit codes", + "description": "Defines exit codes with semantic meaning for the resource.", + "body": { + "0": "Success", + "${1:first exit code number}": "${2:first exit code meaning}", + "${3:second exit code number}": "${4:second exit code meaning}" + } + } + ] + }, + "schema": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ] + }, + "manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of an instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"get\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property. When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"get\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `get` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `get` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `get` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `get` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `get` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to set the desired state of an instance and how to\nprocess the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set` command. Set this value to `true` if the DSC Resource tests input before modifying\nsystem state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set` command where the instance defines the `_exist` property as `false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's state after the set\noperation or the state and an array of the properties the DSC Resource modified.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's final state after the set\n> operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's final state and an array of property\n> names that the resource modified.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `set` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `set` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `set` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `set` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `set` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to indicate whether and how the set command will\nmodify an instance and how to process the output from the DSC Resource. If a resource doesn't\ndefine this method in the manifest, DSC synthesizes this behavior by converting the result of\nthe test operation for the resource into the [set result][02].\n\nThis method definition has the same structure as the [set method][03] in the resource manifest.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/outputs/resource/set?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\", \"--what-if\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n \"--what-if\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set --what-if` command . Set this value to `true` if the DSC Resource tests input before\nprocessing how it will modify system state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set --what-if` command where the instance defines the `_exist` property as\n`false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's expected state after a\nset operation in what-if mode or the state and an array of the properties the DSC Resource\nwould modify.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's expected final state after the\n> set operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's expected final state and an array of\n> property names that the resource would modify.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `whatIf` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `whatIf` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `whatIf` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `whatIf` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `whatIf` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to test if an instance is in the desired state and how\nto process the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"test\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"test\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#input\n" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's current state or the\nstate and an array of the properties that are out of the desired state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Actual state only_\n\n> Indicates that the resource returns only the instance's actual state as a JSON blob.\n", + "_Actual state and differing properties_\n\n> Indicates that the resource returns the instance's actual state and an array of\n> property names that are out of the desired state.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `test` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `test` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `test` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `test` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + "${4:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `test` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "return": "${1|state,stateAndDiff|}", + "executable": "${2:executable_name}", + "args": [ + { + "jsonInputArg": "${3:argument_name}", + "mandatory": "^$4" + } + ] + } + } + ] + }, + "manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to delete an instance. Define this method for\nresources as an alternative to handling the [`_exist`][02] property in a `set` operation, which\ncan lead to highly complex code. If the `set` method for the resource is able to handle deleting\nan instance when `_exist` is `false`, set the [`handlesExist`][03] property of the set method\ndefinition to `true` instead.\n\nIf you define the delete method in a resource manifest, ensure that you also define the\n[`_exist`][02] property in the [JSON schema for the resource's properties][04].\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[04]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"delete\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config delete\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `delete` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `delete` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `delete` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `delete` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `delete` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of every instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"export\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"export\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `export` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `export` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `export` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `export` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `export` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^3" + } + ] + } + } + ] + }, + "manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to validate the state of an instance. This method is\nmandatory for DSC Group Resources. It's ignored for all other DSC Resources.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"validate\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"validate\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `validate` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `validate` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `validate` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `validate` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `validate` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to resolve an external source to nested DSC\nConfiguration Document. Define this method for [importer resources][02] and set the [kind][03]\nproperty in the manifest root to `Import`.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourceKind?view=dsc-3.0&preserve-view=true#importer-resources\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"resolve\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"resolve\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `resolve` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `resolve` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `resolve` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `resolve` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `resolve` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to\nmanage resources that don't have their own manifests with DSC.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#list\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"registry\",\n \"args\": [\"resources\", \"list\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nregistry resources list\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#args\n" + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the adapter expects to receive a full and unprocessed configuration as a\nsingle JSON blob over stdin or a sequence of JSON Lines for each child resource's\nconfigurations.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#config\n", + "markdownEnumDescriptions": [ + "_Full and unprocessed config as a JSON blob_\n\n> Indicates that the adapter expects a JSON blob containing the full and unprocessed\n> configuration as a single JSON blob over `stdin`.\n", + "_Resource instances as JSON Lines_\n\n> Indicates that the adapter expects each resource's configuration as a [JSON Line][01]\n> over `stdin`.\n\n[01]: https://jsonlines.org/\n" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when no arguments are\nrequired.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}" + } + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when at least one\nargument is required.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + } + } + ] + }, + "manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"schema\", \"show\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource schema show\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#args\n" + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob\nrepresenting an instance of the DSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `schema` command for the resource when no arguments are required.\n", + "body": { + "executable": "${1:executable_name}" + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the `schema` command for the resource when at least one argument is required.\n", + "body": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + ] + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON Schema DSC must use to validate a JSON blob representing an instance of the\nDSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type. DSC only supports JSON Schema Draft 07 and later.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n", + "markdownEnumDescriptions": [ + "_Draft 2020-12 (recommended)_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2020-12][01].\n>\n> This is the latest published draft of JSON Schema and is the draft future drafts\n> will be most compatible with.\n\n[01]: https://json-schema.org/specification-links.html#2020-12\n", + "_Draft 2019-09_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2019-09][01].\n>\n> This is the previous published draft of JSON Schema. It's mostly compatible with\n> 2020-12, but less extensible and can't be bundled.\n\n[01]: https://json-schema.org/specification-links.html#draft-2019-09-formerly-known-as-draft-8\n", + "_Draft 07_\n\n> Indicates that the resource instance schema adheres to [JSON Schema Draft 07][01].\n>\n> This is an older published draft of JSON Schema. It's widely used, but incompatible\n> with 2019-09 and later. It's less expressive, extensible, maintainable, and isn't\n> recommended for new schema definitions.\n\n[01]: https://json-schema.org/specification-links.html#draft-7\n" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the unique ID for the DSC Resource's instance schema. If the instance schema is\npublished to its own public URI, set this keyword to that URI.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#id\n" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the properties that DSC can retrieve and manage for the resource's instances.\nThis keyword must define at least one property as a key-value pair. The key is the\nproperty's name. The value is a subschema that validates the property.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#properties\n", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": { + "defaultSnippets": [ + { + "label": " Define a property", + "markdownDescription": "Define a new property for the resource instance schema.", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + }, + { + "label": " Define a property (boolean)", + "markdownDescription": "Define a new [boolean][01] property for the resource instance schema, requiring the\nvalue to be either `true` or `false`.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/boolean.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "boolean" + } + }, + { + "label": " Define a property (string)", + "markdownDescription": "Define a new [string][01] property for the resource instance schema, requiring the\nvalue to be a blob of text.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/string.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "string" + } + }, + { + "label": " Define a property (integer)", + "markdownDescription": "Define a new [integer][01] property for the resource instance schema, requiring the\nvalue to be a number without a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "integer" + } + }, + { + "label": " Define a property (number)", + "markdownDescription": "Define a new [number][01] property for the resource instance schema, requiring the\nvalue to be a number that may include a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "number" + } + }, + { + "label": " Define a property (array)", + "markdownDescription": "Define a new [array][01] property for the resource instance schema, requiring the\nvalue to be a list of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/array.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "array", + "items": { + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + } + }, + { + "label": " Define a property (object)", + "markdownDescription": "Define a new [object][01] property for the resource instance schema, requiring the\nvalue to be a set of key-value pairs.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/object.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "object", + "properties": { + "${3:propertyName}": { + "title": "${4:propertyTitle}", + "description": "${5:explanation of property purpose and usage}", + "type": "${6|string,integer,number,array,object,null|}" + } + } + } + }, + { + "label": " Define a property (enum)", + "markdownDescription": "Define a new [enum][01] property for the resource instance schema that only accepts\na defined set of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "enum": [ + "^${3:\"first value\"}", + "^${4:\"second value\"}" + ] + } + }, + { + "label": " Define a property (const)", + "markdownDescription": "Define a new [const][01] property for the resource instance schema that only\naccepts a specific value.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#constant-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "const": "^${3:\"constant value\"}" + } + } + ] + }, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the resource can enforce whether instances exist, handling whether an\ninstance should be added, updated, or removed during a set operation. The default\nvalue is `true`.\n\nResources that define this property declare that the implementation adheres to the\nfollowing behavior contract:\n\n1. When the desired state for `_exist` is `true`, the resource expects the instance\n to exist. If it doesn't exist, the resource creates or adds the instance during\n the set operation.\n1. When the desired state for `_exist` is `false`, the resource expects the instance\n to not exist. If it does exist, the resource deletes or removes the instance\n during the set operation.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource returns this value for it's own `test` method. This\nproperty is mandatory when the manifest defines the `test` property. It shouldn't\nbe included if the DSC Resource relies on DSC's synthetic testing.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/indesiredstate?view=dsc-3.0&preserve-view=true\n" + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_purge` property to specify\nwhether the DSC Resource should remove all non-specified members when it manages\nan array of members or values.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/purge?view=dsc-3.0&preserve-view=true\n" + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_rebootRequested` property to\nreport whether the machine should be rebooted after the `set` method executes.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/rebootrequested?view=dsc-3.0&preserve-view=true\n" + } + }, + "defaultSnippets": [ + { + "label": " Define an instance property", + "markdownDescription": "Define a property for the resource instance schema.", + "body": { + "${1:propertyName}": { + "title": "${2:property title}", + "description": "${3:explanation of property purpose and usage}", + "type": "${4|string,integer,number,array,object,null|}" + } + } + } + ] + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must validate a JSON blob representing an instance of the DSC Resource.\n\nThe JSON schema can be defined dynamically with the `command` property or statically with the\n`embedded` property.\n\nFor development purposes, it can be more convenient to use the `command` property and avoid\nneeding to adjust both the code and the schema.\n\nMicrosoft recommends using the `embedded` property when publishing a resource publicly. When the\nmanifest declares the schema with the `command` property, DSC calls the command at the beginning\nof any operation using the resource, possibly impacting performance. The schema is also\nunavailable to integrating tools when the resource isn't installed locally. When the schema is\nembedded in the manifest, DSC and integrating tools only need the manifest itself.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define as command without arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when no arguments are required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}" + } + } + }, + { + "label": " Define as command with arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when at least one argument is required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + }, + { + "label": " Define as an embedded schema", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema embedded in the manifest. This is the preferred option\nfor publicly published resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "body": { + "embedded": { + "${escape_dollar:$}schema": "${1|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${2:name}": { + "title": "${3:property title}", + "description": "${4:explanation of property purpose and usage}", + "type": "${5|string,integer,number,array,object,null|}" + } + } + } + } + } + ] + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0/bundled/outputs/resource/schema.json b/schemas/v3.0/bundled/outputs/resource/schema.json new file mode 100644 index 00000000..ce9e3aa7 --- /dev/null +++ b/schemas/v3.0/bundled/outputs/resource/schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3.0/bundled/outputs/resource/schema.vscode.json b/schemas/v3.0/bundled/outputs/resource/schema.vscode.json new file mode 100644 index 00000000..ce9e3aa7 --- /dev/null +++ b/schemas/v3.0/bundled/outputs/resource/schema.vscode.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3.0/bundled/outputs/resource/set.json b/schemas/v3.0/bundled/outputs/resource/set.json new file mode 100644 index 00000000..850d3be7 --- /dev/null +++ b/schemas/v3.0/bundled/outputs/resource/set.json @@ -0,0 +1,146 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json" + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } +} diff --git a/schemas/v3.0/bundled/outputs/resource/set.vscode.json b/schemas/v3.0/bundled/outputs/resource/set.vscode.json new file mode 100644 index 00000000..970d73e9 --- /dev/null +++ b/schemas/v3.0/bundled/outputs/resource/set.vscode.json @@ -0,0 +1,172 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json" + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0": { + "outputs": { + "resource": { + "set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json" + } + } + }, + "set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json" + } + } + ] + } + } + }, + "metadata": { + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "Microsoft.DSC": { + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } + }, + "definitions": { + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0/bundled/outputs/resource/test.json b/schemas/v3.0/bundled/outputs/resource/test.json new file mode 100644 index 00000000..3ebe16dd --- /dev/null +++ b/schemas/v3.0/bundled/outputs/resource/test.json @@ -0,0 +1,152 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json" + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } +} diff --git a/schemas/v3.0/bundled/outputs/resource/test.vscode.json b/schemas/v3.0/bundled/outputs/resource/test.vscode.json new file mode 100644 index 00000000..5104919c --- /dev/null +++ b/schemas/v3.0/bundled/outputs/resource/test.vscode.json @@ -0,0 +1,178 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json" + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0": { + "outputs": { + "resource": { + "test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json" + } + } + }, + "test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json" + } + } + ] + } + } + }, + "metadata": { + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "Microsoft.DSC": { + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } + }, + "definitions": { + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0/bundled/outputs/schema.json b/schemas/v3.0/bundled/outputs/schema.json new file mode 100644 index 00000000..1690bf2e --- /dev/null +++ b/schemas/v3.0/bundled/outputs/schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3.0/bundled/outputs/schema.vscode.json b/schemas/v3.0/bundled/outputs/schema.vscode.json new file mode 100644 index 00000000..1690bf2e --- /dev/null +++ b/schemas/v3.0/bundled/outputs/schema.vscode.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3.0/bundled/resource/manifest.json b/schemas/v3.0/bundled/resource/manifest.json new file mode 100644 index 00000000..0b0f384b --- /dev/null +++ b/schemas/v3.0/bundled/resource/manifest.json @@ -0,0 +1,1126 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ] + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "get": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json" + }, + "set": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json" + }, + "delete": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json" + }, + "export": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json" + }, + "validate": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] + }, + "schema": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources." + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource." + } + } + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": {}, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json" + } + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json" + } + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json" + } + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json" + } + } + } + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command." + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json", + "title": "Instance should exist", + "description": "Indicates whether the DSC Resource instance should exist.", + "type": "boolean", + "default": true, + "enum": [ + false, + true + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json", + "title": "Instance is in the Desired State", + "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json", + "title": "Purge", + "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", + "type": [ + "boolean", + "null" + ], + "writeOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json", + "title": "Reboot Requested", + "description": "Indicates that the set operation requires a reboot before it's fully complete.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + } + } +} diff --git a/schemas/v3.0/bundled/resource/manifest.vscode.json b/schemas/v3.0/bundled/resource/manifest.vscode.json new file mode 100644 index 00000000..da4875b2 --- /dev/null +++ b/schemas/v3.0/bundled/resource/manifest.vscode.json @@ -0,0 +1,1956 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the information DSC and integrating require to process and call a command-based DSC\nResource. For DSC to use a manifest on a system, the manifest file must:\n\n1. Be discoverable in the `PATH` environment variable.\n1. Follow the naming convention `.dsc.resource.json`.\n1. Be valid for this schema.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define a resource", + "markdownDescription": "Defines a standard resource that:\n\n- Can get the current state of an instance\n- Can set an instance to the desired state\n- Relies on DSC's synthetic testing to determine whether an instance is in the desired state\n- Defines an embedded JSON schema.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "set": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "implementsPretest": "^${11:false}", + "return": "${12:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (group)", + "markdownDescription": "Defines a group resource that expects a list of resource instances and operates on them.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "group", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${18|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${19:Resources}", + "description": "${20:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.resource.json" + } + }, + "${21:name}": { + "title": "${22:property title}", + "description": "${23:explanation of property purpose and usage}", + "type": "${24|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (adapter)", + "markdownDescription": "Defines an adapter resource that enables users to define non-command-based DSC Resources in\nthe configuration.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "adapter", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "adapter": { + "config": "${18|full,sequence|}", + "list": { + "executable": "${19:executable name}", + "args": [ + "${20:argument}" + ] + } + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${23|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${24:Resources}", + "description": "${25:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.resource.json" + } + }, + "${26:name}": { + "title": "${27:property title}", + "description": "${28:explanation of property purpose and usage}", + "type": "${29|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (importer)", + "markdownDescription": "Defines an importer resource that can resolve an external source to nested resource\ninstances.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "importer", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "resolve": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (assertion-only)", + "markdownDescription": "Defines an assertion resource that can get the current state of an instance but not configure\nit. By default, the resource relies on DSC's synthetic testing feature. If the resource\nimplements the `test` operation itself, define the `test` property.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + } + ], + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property must be one of the canonical URLs for the version of the Command-based DSC\nResource Manifest schema that the manifest is implemented for.\n\nFor every version of the schema, there are three valid urls:\n\n```yaml\n.../resource/manifest.json\n```\n\n> The URL to the canonical non-bundled schema. When it's used for validation, the validating\n> client needs to retrieve this schema and every schema it references.\n\n```yaml\n.../bundled/resource/manifest.json\n```\n\n> The URL to the bundled schema. When it's used for validation, the validating client only\n> needs to retrieve this schema.\n> \n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n\n```yaml\n.../bundled/resource/manifest.vscode.json\n```\n\n> The URL to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and snippets\n> that the others don't include.\n> \n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#schema\n", + "markdownEnumDescriptions": [ + "\n\n> #### `v3.0` non-bundled\n>\n> Indicates that the resource manifest adheres to the `v3.0` schema. This URL\n> points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `v3.0` bundled\n>\n> Indicates that the resource manifest adheres to the `v3.0` schema. This URL\n> points to the bundled schema. When it's used for validation, the validating client\n> only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `v3.0` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `v3.0` schema. This URL\n> points to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/10` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/10` bundled\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0` of the schema.\n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/10` enhanced authoring\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3.0` of the schema.\n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/08` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/08` bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/08` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3.0` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n" + ] + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe semantic version ([semver][02]) of the DSC Resource. This version identifies the DSC\nResource, not the version of the application it manages.\n\nThis value uses the [suggested regular expression][03] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#version\n[02]: https://semver.org/\n[03]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a short synopsis of the DSC Resource's purpose.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#description-1\n" + }, + "kind": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of searchable terms for the resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#tags\n", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$", + "patternErrorMessage": "Invalid tag. Tags must be a string of alphanumeric characters and underscores. No other\ncharacters are permitted.\n" + } + }, + "get": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json" + }, + "set": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json" + }, + "delete": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json" + }, + "export": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json" + }, + "validate": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$", + "patternErrorMessage": "Invalid exit code. Must be a string representing a 32-bit signed integer.\n" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property defines a map of valid exit codes for the DSC Resource. DSC always interprets\nexit code `0` as a successful operation and any other exit code as an error. Use this\nproperty to indicate human-readable semantic meanings for the DSC Resource's exit codes.\n\nDefine the keys in this property as strings representing a valid 32-bit signed integer. You\ncan't use alternate formats for the exit code. For example, instead of the hexadecimal value\n`0x80070005` for \"Access denied\", specify the exit code as `-2147024891`. If you're authoring\nyour resource manifest in yaml, be sure to wrap the exit code in single quotes, like\n`'0': Success` instead of `0: Success` to ensure the YAML file can be parsed correctly.\n\nDefine the value for each key as a string explaining what the exit code indicates.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#exitcodes\n", + "defaultSnippets": [ + { + "label": " Defined exit codes", + "description": "Defines exit codes with semantic meaning for the resource.", + "body": { + "0": "Success", + "${1:first exit code number}": "${2:first exit code meaning}", + "${3:second exit code number}": "${4:second exit code meaning}" + } + } + ] + }, + "schema": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3.0": { + "definitions": { + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the resource is a normal DSC Resource, a group resource, or an adapter\nresource. This property is only required for group resources.\n\nDSC infers the default value for this property based on whether the [adapter][02] property is\ndefined in the manifest:\n\n- If the `adapter` property is defined in the manifest, the default `kind` is `Adapter`.\n- If the `adapter` property is not defined in the manifest, the default `kind` is `Resource`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "markdownEnumDescriptions": [ + "\n\nIndicates that the manifest is for a standard command-based DSC Resource.\n", + "\n\nIndicates that the manifest is for an adapter resource that enables the use of\nnon-command-based resources with DSC.\n", + "\n\nIndicates that the manifest is for a group resource that processes an array of nested\nresource instances.\n", + "\n\nIndicates that the manifest is for an import resource that resolves an external source to DSC\nresource instances. The resolved instances are processed as nested instances for the import\nresource.\n" + ] + }, + "commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "defaultSnippets": [ + { + "label": "String argument", + "markdownDescription": "Add a string argument to the command, like `config` or `--config`.", + "body": "${1:argument_name}" + }, + { + "label": "JSON input argument", + "markdownDescription": "Add a JSON input argument to the command. A command can only define one JSON input argument\nin the `args` list. When you define a JSON input argument, DSC passes the input data for\nthe command to the specified argument as a string representing the data as a compressed\nJSON object. The compressed JSON object doesn't have any spaces or newlines between the\nobject properties and values.\n\nIf the command doesn't define the `input` property, it must define a JSON input argument.\n\nIf the command defines both the `input` property and a JSON input argument, DSC sends the\ninput data to the command in both ways. For example, if the command defines `input` as\n`stdin` and has a JSON input argument in `args`, DSC sends the input data as a compressed\nJSON object over stdin and to the the specified argument.", + "body": { + "jsonInputArg": "${1:argument_name}", + "mandatory": "^$2" + } + } + ], + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command.", + "markdownDescription": "Any item in the argument array can be a string representing a static argument to pass to\nthe command.\n" + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "markdownDescription": "Defines an argument for the command that accepts the JSON input object as a string. DSC\npasses the JSON input to the named argument when available. You can define the `mandatory`\nproperty to indicate whether DSC should always pass the argument to the command, even when\nthere's no JSON input for the command. In that case, DSC passes an empty string to the\nJSON input argument. You can only define one JSON input argument per arguments array.\n\nIf you define a JSON input argument and an `input` kind for a command, DSC sends the JSON\ndata both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "markdownDescription": "Defines the argument that accepts the JSON property bag for the resource as input.\n", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "markdownDescription": "Defines whether the argument is mandatory. If this property is set to `true`, DSC\npasses an empty string when no JSON input is provided. The default value is `false`.\n", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ], + "markdownEnumDescriptions": [ + "_Environment variables_\n\n> Indicates that the resource expects the properties of an instance to be specified as\n> environment variables with the same names and casing.\n>\n> This option only supports the following data types for instance properties:\n>\n> - `boolean`\n> - `integer`\n> - `number`\n> - `string`\n> - `array` of `integer` values\n> - `array` of `number` values\n> - `array` of `string` values\n>\n> For non-array values, DSC sets the environment variable to the specified value as-is. When\n> the data type is an array of values, DSC sets the environment variable as a comma-delimited\n> string. For example, the property `foo` with a value of `[1, 2, 3]` is saved in the `foo`\n> environment variable as `\"1,2,3\"`.\n>\n> If the resource needs to support complex properties with an `object` value or multi-type\n> arrays, set this to `stdin` instead.\n", + "_JSON over `stdin`_\n\n> Indicates that the resource expects a JSON blob representing an instance from `stdin`.\n> The JSON must adhere to the instance schema.\n" + ] + }, + "returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + } + }, + "resource": { + "manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of an instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"get\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property. When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"get\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `get` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `get` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `get` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `get` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `get` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to set the desired state of an instance and how to\nprocess the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set` command. Set this value to `true` if the DSC Resource tests input before modifying\nsystem state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set` command where the instance defines the `_exist` property as `false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's state after the set\noperation or the state and an array of the properties the DSC Resource modified.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's final state after the set\n> operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's final state and an array of property\n> names that the resource modified.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `set` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `set` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `set` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `set` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `set` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to indicate whether and how the set command will\nmodify an instance and how to process the output from the DSC Resource. If a resource doesn't\ndefine this method in the manifest, DSC synthesizes this behavior by converting the result of\nthe test operation for the resource into the [set result][02].\n\nThis method definition has the same structure as the [set method][03] in the resource manifest.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/outputs/resource/set?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\", \"--what-if\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n \"--what-if\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set --what-if` command . Set this value to `true` if the DSC Resource tests input before\nprocessing how it will modify system state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set --what-if` command where the instance defines the `_exist` property as\n`false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's expected state after a\nset operation in what-if mode or the state and an array of the properties the DSC Resource\nwould modify.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's expected final state after the\n> set operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's expected final state and an array of\n> property names that the resource would modify.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `whatIf` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `whatIf` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `whatIf` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `whatIf` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `whatIf` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to test if an instance is in the desired state and how\nto process the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"test\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"test\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#input\n" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's current state or the\nstate and an array of the properties that are out of the desired state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Actual state only_\n\n> Indicates that the resource returns only the instance's actual state as a JSON blob.\n", + "_Actual state and differing properties_\n\n> Indicates that the resource returns the instance's actual state and an array of\n> property names that are out of the desired state.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `test` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `test` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `test` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `test` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + "${4:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `test` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "return": "${1|state,stateAndDiff|}", + "executable": "${2:executable_name}", + "args": [ + { + "jsonInputArg": "${3:argument_name}", + "mandatory": "^$4" + } + ] + } + } + ] + }, + "manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to delete an instance. Define this method for\nresources as an alternative to handling the [`_exist`][02] property in a `set` operation, which\ncan lead to highly complex code. If the `set` method for the resource is able to handle deleting\nan instance when `_exist` is `false`, set the [`handlesExist`][03] property of the set method\ndefinition to `true` instead.\n\nIf you define the delete method in a resource manifest, ensure that you also define the\n[`_exist`][02] property in the [JSON schema for the resource's properties][04].\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[04]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"delete\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config delete\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `delete` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `delete` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `delete` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `delete` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `delete` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of every instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"export\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"export\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `export` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `export` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `export` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `export` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `export` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^3" + } + ] + } + } + ] + }, + "manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to validate the state of an instance. This method is\nmandatory for DSC Group Resources. It's ignored for all other DSC Resources.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"validate\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"validate\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `validate` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `validate` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `validate` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `validate` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `validate` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to resolve an external source to nested DSC\nConfiguration Document. Define this method for [importer resources][02] and set the [kind][03]\nproperty in the manifest root to `Import`.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourceKind?view=dsc-3.0&preserve-view=true#importer-resources\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"resolve\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"resolve\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `resolve` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `resolve` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `resolve` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `resolve` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `resolve` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to\nmanage resources that don't have their own manifests with DSC.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#list\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"registry\",\n \"args\": [\"resources\", \"list\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nregistry resources list\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#args\n" + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the adapter expects to receive a full and unprocessed configuration as a\nsingle JSON blob over stdin or a sequence of JSON Lines for each child resource's\nconfigurations.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#config\n", + "markdownEnumDescriptions": [ + "_Full and unprocessed config as a JSON blob_\n\n> Indicates that the adapter expects a JSON blob containing the full and unprocessed\n> configuration as a single JSON blob over `stdin`.\n", + "_Resource instances as JSON Lines_\n\n> Indicates that the adapter expects each resource's configuration as a [JSON Line][01]\n> over `stdin`.\n\n[01]: https://jsonlines.org/\n" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when no arguments are\nrequired.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}" + } + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when at least one\nargument is required.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + } + } + ] + }, + "manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"schema\", \"show\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource schema show\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#args\n" + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob\nrepresenting an instance of the DSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `schema` command for the resource when no arguments are required.\n", + "body": { + "executable": "${1:executable_name}" + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the `schema` command for the resource when at least one argument is required.\n", + "body": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + ] + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON Schema DSC must use to validate a JSON blob representing an instance of the\nDSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type. DSC only supports JSON Schema Draft 07 and later.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n", + "markdownEnumDescriptions": [ + "_Draft 2020-12 (recommended)_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2020-12][01].\n>\n> This is the latest published draft of JSON Schema and is the draft future drafts\n> will be most compatible with.\n\n[01]: https://json-schema.org/specification-links.html#2020-12\n", + "_Draft 2019-09_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2019-09][01].\n>\n> This is the previous published draft of JSON Schema. It's mostly compatible with\n> 2020-12, but less extensible and can't be bundled.\n\n[01]: https://json-schema.org/specification-links.html#draft-2019-09-formerly-known-as-draft-8\n", + "_Draft 07_\n\n> Indicates that the resource instance schema adheres to [JSON Schema Draft 07][01].\n>\n> This is an older published draft of JSON Schema. It's widely used, but incompatible\n> with 2019-09 and later. It's less expressive, extensible, maintainable, and isn't\n> recommended for new schema definitions.\n\n[01]: https://json-schema.org/specification-links.html#draft-7\n" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the unique ID for the DSC Resource's instance schema. If the instance schema is\npublished to its own public URI, set this keyword to that URI.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#id\n" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the properties that DSC can retrieve and manage for the resource's instances.\nThis keyword must define at least one property as a key-value pair. The key is the\nproperty's name. The value is a subschema that validates the property.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#properties\n", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": { + "defaultSnippets": [ + { + "label": " Define a property", + "markdownDescription": "Define a new property for the resource instance schema.", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + }, + { + "label": " Define a property (boolean)", + "markdownDescription": "Define a new [boolean][01] property for the resource instance schema, requiring the\nvalue to be either `true` or `false`.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/boolean.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "boolean" + } + }, + { + "label": " Define a property (string)", + "markdownDescription": "Define a new [string][01] property for the resource instance schema, requiring the\nvalue to be a blob of text.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/string.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "string" + } + }, + { + "label": " Define a property (integer)", + "markdownDescription": "Define a new [integer][01] property for the resource instance schema, requiring the\nvalue to be a number without a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "integer" + } + }, + { + "label": " Define a property (number)", + "markdownDescription": "Define a new [number][01] property for the resource instance schema, requiring the\nvalue to be a number that may include a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "number" + } + }, + { + "label": " Define a property (array)", + "markdownDescription": "Define a new [array][01] property for the resource instance schema, requiring the\nvalue to be a list of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/array.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "array", + "items": { + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + } + }, + { + "label": " Define a property (object)", + "markdownDescription": "Define a new [object][01] property for the resource instance schema, requiring the\nvalue to be a set of key-value pairs.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/object.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "object", + "properties": { + "${3:propertyName}": { + "title": "${4:propertyTitle}", + "description": "${5:explanation of property purpose and usage}", + "type": "${6|string,integer,number,array,object,null|}" + } + } + } + }, + { + "label": " Define a property (enum)", + "markdownDescription": "Define a new [enum][01] property for the resource instance schema that only accepts\na defined set of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "enum": [ + "^${3:\"first value\"}", + "^${4:\"second value\"}" + ] + } + }, + { + "label": " Define a property (const)", + "markdownDescription": "Define a new [const][01] property for the resource instance schema that only\naccepts a specific value.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#constant-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "const": "^${3:\"constant value\"}" + } + } + ] + }, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the resource can enforce whether instances exist, handling whether an\ninstance should be added, updated, or removed during a set operation. The default\nvalue is `true`.\n\nResources that define this property declare that the implementation adheres to the\nfollowing behavior contract:\n\n1. When the desired state for `_exist` is `true`, the resource expects the instance\n to exist. If it doesn't exist, the resource creates or adds the instance during\n the set operation.\n1. When the desired state for `_exist` is `false`, the resource expects the instance\n to not exist. If it does exist, the resource deletes or removes the instance\n during the set operation.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource returns this value for it's own `test` method. This\nproperty is mandatory when the manifest defines the `test` property. It shouldn't\nbe included if the DSC Resource relies on DSC's synthetic testing.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/indesiredstate?view=dsc-3.0&preserve-view=true\n" + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_purge` property to specify\nwhether the DSC Resource should remove all non-specified members when it manages\nan array of members or values.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/purge?view=dsc-3.0&preserve-view=true\n" + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_rebootRequested` property to\nreport whether the machine should be rebooted after the `set` method executes.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/rebootrequested?view=dsc-3.0&preserve-view=true\n" + } + }, + "defaultSnippets": [ + { + "label": " Define an instance property", + "markdownDescription": "Define a property for the resource instance schema.", + "body": { + "${1:propertyName}": { + "title": "${2:property title}", + "description": "${3:explanation of property purpose and usage}", + "type": "${4|string,integer,number,array,object,null|}" + } + } + } + ] + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must validate a JSON blob representing an instance of the DSC Resource.\n\nThe JSON schema can be defined dynamically with the `command` property or statically with the\n`embedded` property.\n\nFor development purposes, it can be more convenient to use the `command` property and avoid\nneeding to adjust both the code and the schema.\n\nMicrosoft recommends using the `embedded` property when publishing a resource publicly. When the\nmanifest declares the schema with the `command` property, DSC calls the command at the beginning\nof any operation using the resource, possibly impacting performance. The schema is also\nunavailable to integrating tools when the resource isn't installed locally. When the schema is\nembedded in the manifest, DSC and integrating tools only need the manifest itself.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define as command without arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when no arguments are required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}" + } + } + }, + { + "label": " Define as command with arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when at least one argument is required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + }, + { + "label": " Define as an embedded schema", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema embedded in the manifest. This is the preferred option\nfor publicly published resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "body": { + "embedded": { + "${escape_dollar:$}schema": "${1|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${2:name}": { + "title": "${3:property title}", + "description": "${4:explanation of property purpose and usage}", + "type": "${5|string,integer,number,array,object,null|}" + } + } + } + } + } + ] + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3.0/config/document.json b/schemas/v3.0/config/document.json new file mode 100644 index 00000000..b27100bb --- /dev/null +++ b/schemas/v3.0/config/document.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json", + "title": "DSC Configuration Document schema", + "description": "Describes a valid DSC Configuration Document.", + "type": "object", + "required": [ + "$schema", + "resources" + ], + "properties": { + "$schema": { + "title": "Schema", + "description": "This property must be the canonical URL of the DSC Configuration Document schema that the document is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json" + ] + }, + "parameters": { + "title": "DSC Configuration document parameters", + "description": "Defines runtime options for the configuration. Users and integrating tools can override use the defined parameters to pass alternate values to the configuration.", + "type": "object", + "additionalProperties": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/config/document.parameter.json" + } + }, + "variables": { + "title": "Configuration variables", + "description": "Defines a set of reusable values for the configuration document. The names of this value's properties are the strings used to reference a variable's value.", + "type": "object" + }, + "resources": { + "title": "DSC Configuration document resources", + "description": "Defines a list of DSC Resource instances for the configuration to manage.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/config/document.resource.json" + } + }, + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/config/document.metadata.json" + } + } +} diff --git a/schemas/v3.0/config/document.metadata.json b/schemas/v3.0/config/document.metadata.json new file mode 100644 index 00000000..34618db4 --- /dev/null +++ b/schemas/v3.0/config/document.metadata.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.metadata.json", + "title": "Configuration metadata", + "description": "Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` property, this metadata isn't validated. You can pass any data into this property of a configuration document.", + "type": "object", + "properties": { + "Microsoft.DSC": { + "type": "object", + "title": "DSC metadata", + "description": "The `Microsoft.DSC` metadata property contains directives and information that DSC itself uses when processing a configuration document. Unlike other metadata key-value pairs, DSC validates these properties.", + "unevaluatedProperties": false, + "properties": { + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "default": "Current", + "description": "This property defines the security context a configuration requires. If you invoke a DSC operation against the configuration document in a security context that conflicts with this metadata, DSC raises an error when it validates the configuration document.\nThe default security context is `Current`." + } + } + } + } +} diff --git a/schemas/v3.0/config/document.parameter.json b/schemas/v3.0/config/document.parameter.json new file mode 100644 index 00000000..4e9240bb --- /dev/null +++ b/schemas/v3.0/config/document.parameter.json @@ -0,0 +1,228 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.parameter.json", + "title": "Parameter", + "description": "Defines a runtime option for a DSC Configuration Document.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/dataTypes.json" + }, + "defaultValue": { + "title": "Default value", + "description": "Defines the default value for the parameter.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/validValueTypes.json" + }, + "allowedValues": { + "title": "Allowed values", + "description": "Defines a list of valid values for the parameter. If the parameter is defined with any other values, it's invalid.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/validValueTypes.json" + } + }, + "description": { + "title": "Parameter description", + "description": "Defines a synopsis for the parameter explaining its purpose.", + "type": "string" + }, + "metadata": { + "title": "Parameter metadata", + "description": "Defines a set of key-value pairs for the parameter. This metadata isn't validated.", + "type": "object" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "minValue": { + "title": "Minimum value", + "description": "The minimum valid value for an integer type. If defined with the `maxValue` property, this value must be less than the value of `maxValue`.", + "type": "integer" + }, + "maxValue": { + "title": "Maximum value", + "description": "The maximum valid value for an integer type. If defined with the `minValue` property, this value must be greater than the value of `minValue`.", + "type": "integer" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + }, + { + "properties": { + "type": { + "const": "array" + } + } + } + ] + }, + "then": { + "properties": { + "minLength": { + "title": "Minimum length", + "description": "The minimum valid length for a `string`, `secureString`, or `array`. If defined with the `maxLength` property, this value must be less than the value of `maxLength`.", + "type": "integer", + "minimum": 0 + }, + "maxLength": { + "title": "Maximum length", + "description": "The maximum valid length for a `string`, `secureString`, or `array`. If defined with the `minLength` property, this value must be less than the value of `minLength`.", + "type": "integer", + "minimum": 0 + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "string" + }, + "allowedValues": { + "items": { + "type": "string" + } + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "object" + } + } + }, + { + "properties": { + "type": { + "const": "secureObject" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "object" + }, + "allowedValues": { + "items": { + "type": "object" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "integer" + }, + "allowedValues": { + "items": { + "type": "integer" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "array" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "bool" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "boolean" + }, + "allowedValues": { + "items": { + "type": "boolean" + } + } + } + } + } + ] +} diff --git a/schemas/v3.0/config/document.resource.json b/schemas/v3.0/config/document.resource.json new file mode 100644 index 00000000..14c9341f --- /dev/null +++ b/schemas/v3.0/config/document.resource.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.resource.json", + "title": "DSC Resource instance", + "description": "Defines an instance of a DSC Resource in a configuration.", + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "dependsOn": { + "title": "Instance depends on", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", + "type": "array", + "items": { + "type": "string", + "uniqueItems": true, + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$" + } + }, + "properties": { + "title": "Managed instance properties", + "description": "Defines the properties of the DSC Resource this instance manages. This property's value must be an object. DSC validates the property's value against the DSC Resource's schema.", + "type": "object" + } + } +} diff --git a/schemas/v3.0/definitions/commandArgs.json b/schemas/v3.0/definitions/commandArgs.json new file mode 100644 index 00000000..ffff0144 --- /dev/null +++ b/schemas/v3.0/definitions/commandArgs.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command." + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "type": "boolean", + "default": false + } + } + } + ] + } +} diff --git a/schemas/v3.0/definitions/commandExecutable.json b/schemas/v3.0/definitions/commandExecutable.json new file mode 100644 index 00000000..2d8c9fbb --- /dev/null +++ b/schemas/v3.0/definitions/commandExecutable.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" +} diff --git a/schemas/v3.0/definitions/hadErrors.json b/schemas/v3.0/definitions/hadErrors.json new file mode 100644 index 00000000..68c4024a --- /dev/null +++ b/schemas/v3.0/definitions/hadErrors.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" +} diff --git a/schemas/v3.0/definitions/inputKind.json b/schemas/v3.0/definitions/inputKind.json new file mode 100644 index 00000000..8c97288d --- /dev/null +++ b/schemas/v3.0/definitions/inputKind.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ] +} diff --git a/schemas/v3.0/definitions/instanceName.json b/schemas/v3.0/definitions/instanceName.json new file mode 100644 index 00000000..fb9151a9 --- /dev/null +++ b/schemas/v3.0/definitions/instanceName.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 +} diff --git a/schemas/v3.0/definitions/message.json b/schemas/v3.0/definitions/message.json new file mode 100644 index 00000000..ece7e676 --- /dev/null +++ b/schemas/v3.0/definitions/message.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } +} diff --git a/schemas/v3.0/definitions/messages.json b/schemas/v3.0/definitions/messages.json new file mode 100644 index 00000000..95c2c412 --- /dev/null +++ b/schemas/v3.0/definitions/messages.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/message.json" + } +} diff --git a/schemas/v3.0/definitions/parameters/dataTypes.json b/schemas/v3.0/definitions/parameters/dataTypes.json new file mode 100644 index 00000000..d09281e8 --- /dev/null +++ b/schemas/v3.0/definitions/parameters/dataTypes.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/dataTypes.json", + "title": "Data Types", + "description": "Defines the data type for the parameter value.", + "type": "string", + "enum": [ + "string", + "secureString", + "int", + "bool", + "object", + "secureObject", + "array" + ] +} diff --git a/schemas/v3.0/definitions/parameters/validValueTypes.json b/schemas/v3.0/definitions/parameters/validValueTypes.json new file mode 100644 index 00000000..fb9295f8 --- /dev/null +++ b/schemas/v3.0/definitions/parameters/validValueTypes.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/parameters/validValueTypes.json", + "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", + "type": [ + "string", + "integer", + "object", + "array", + "boolean" + ] +} diff --git a/schemas/v3.0/definitions/resourceKind.json b/schemas/v3.0/definitions/resourceKind.json new file mode 100644 index 00000000..ac8417b2 --- /dev/null +++ b/schemas/v3.0/definitions/resourceKind.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ] +} diff --git a/schemas/v3.0/definitions/resourceType.json b/schemas/v3.0/definitions/resourceType.json new file mode 100644 index 00000000..e3670520 --- /dev/null +++ b/schemas/v3.0/definitions/resourceType.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" +} diff --git a/schemas/v3.0/definitions/returnKind.json b/schemas/v3.0/definitions/returnKind.json new file mode 100644 index 00000000..ebe474f1 --- /dev/null +++ b/schemas/v3.0/definitions/returnKind.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." +} diff --git a/schemas/v3.0/definitions/semver.json b/schemas/v3.0/definitions/semver.json new file mode 100644 index 00000000..c4934b78 --- /dev/null +++ b/schemas/v3.0/definitions/semver.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" +} diff --git a/schemas/v3.0/metadata/Microsoft.DSC/context.json b/schemas/v3.0/metadata/Microsoft.DSC/context.json new file mode 100644 index 00000000..15e8c173 --- /dev/null +++ b/schemas/v3.0/metadata/Microsoft.DSC/context.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] +} diff --git a/schemas/v3.0/metadata/Microsoft.DSC/duration.json b/schemas/v3.0/metadata/Microsoft.DSC/duration.json new file mode 100644 index 00000000..81e70845 --- /dev/null +++ b/schemas/v3.0/metadata/Microsoft.DSC/duration.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" +} diff --git a/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json b/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json new file mode 100644 index 00000000..eaad1b1d --- /dev/null +++ b/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" +} diff --git a/schemas/v3.0/metadata/Microsoft.DSC/executionType.json b/schemas/v3.0/metadata/Microsoft.DSC/executionType.json new file mode 100644 index 00000000..2e2dde6d --- /dev/null +++ b/schemas/v3.0/metadata/Microsoft.DSC/executionType.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] +} diff --git a/schemas/v3.0/metadata/Microsoft.DSC/operation.json b/schemas/v3.0/metadata/Microsoft.DSC/operation.json new file mode 100644 index 00000000..e65b2bb8 --- /dev/null +++ b/schemas/v3.0/metadata/Microsoft.DSC/operation.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] +} diff --git a/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json b/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json new file mode 100644 index 00000000..2e8dc2af --- /dev/null +++ b/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] +} diff --git a/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json b/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json new file mode 100644 index 00000000..e6946e1f --- /dev/null +++ b/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" +} diff --git a/schemas/v3.0/metadata/Microsoft.DSC/version.json b/schemas/v3.0/metadata/Microsoft.DSC/version.json new file mode 100644 index 00000000..1feb9cc1 --- /dev/null +++ b/schemas/v3.0/metadata/Microsoft.DSC/version.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" +} diff --git a/schemas/v3.0/metadata/configurationDocumentResult.json b/schemas/v3.0/metadata/configurationDocumentResult.json new file mode 100644 index 00000000..ff8ff11c --- /dev/null +++ b/schemas/v3.0/metadata/configurationDocumentResult.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/context.json" + } + } + } + } +} diff --git a/schemas/v3.0/metadata/resourceInstanceResult.json b/schemas/v3.0/metadata/resourceInstanceResult.json new file mode 100644 index 00000000..a1e99253 --- /dev/null +++ b/schemas/v3.0/metadata/resourceInstanceResult.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/Microsoft.DSC/duration.json" + } + } + } + } +} diff --git a/schemas/v3.0/outputs/config/get.json b/schemas/v3.0/outputs/config/get.json new file mode 100644 index 00000000..a1fafd7c --- /dev/null +++ b/schemas/v3.0/outputs/config/get.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/get.json", + "title": "DSC Configuration get command result", + "description": "Represents the data structure returned by the `dsc config get` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `get` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json" + } + } +} diff --git a/schemas/v3.0/outputs/config/set.json b/schemas/v3.0/outputs/config/set.json new file mode 100644 index 00000000..e61b7d82 --- /dev/null +++ b/schemas/v3.0/outputs/config/set.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/set.json", + "title": "DSC Configuration set command result", + "description": "Represents the data structure returned by the `dsc config set` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `set` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json" + } + } +} diff --git a/schemas/v3.0/outputs/config/test.json b/schemas/v3.0/outputs/config/test.json new file mode 100644 index 00000000..6c654877 --- /dev/null +++ b/schemas/v3.0/outputs/config/test.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/test.json", + "title": "DSC Configuration test command result", + "description": "Represents the data structure returned by the `dsc config test` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `test` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/hadErrors.json" + } + } +} diff --git a/schemas/v3.0/outputs/resource/get.full.json b/schemas/v3.0/outputs/resource/get.full.json new file mode 100644 index 00000000..2d80bcea --- /dev/null +++ b/schemas/v3.0/outputs/resource/get.full.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json" + } + } +} diff --git a/schemas/v3.0/outputs/resource/get.json b/schemas/v3.0/outputs/resource/get.json new file mode 100644 index 00000000..3ec064fe --- /dev/null +++ b/schemas/v3.0/outputs/resource/get.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.full.json" + } + } + ] +} diff --git a/schemas/v3.0/outputs/resource/get.simple.json b/schemas/v3.0/outputs/resource/get.simple.json new file mode 100644 index 00000000..1438571d --- /dev/null +++ b/schemas/v3.0/outputs/resource/get.simple.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } +} diff --git a/schemas/v3.0/outputs/resource/list.json b/schemas/v3.0/outputs/resource/list.json new file mode 100644 index 00000000..15696a69 --- /dev/null +++ b/schemas/v3.0/outputs/resource/list.json @@ -0,0 +1,112 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/list.json", + "title": "dsc resource list result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource list` command.", + "type": "object", + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json" + }, + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "capabilities": { + "title": "Resource capabilities", + "description": "Defines the list of DSC operations the resource is compatible with. If the resource doesn't list a given operation, like `set` or `export`, the resource can't be used for those operations. The exception to this is `test` - DSC uses synthetic testing for resources that don't have the `test` capability.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "get", + "set", + "setHandlesExist", + "whatIf", + "test", + "delete", + "export", + "resolve" + ] + } + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "path": { + "title": "Path", + "description": "Indicates the path to the DSC Resource on the file system.", + "type": "string" + }, + "directory": { + "title": "Directory", + "description": "Indicates the path to the folder containing the DSC Resource on the file system.", + "type": "string" + }, + "implementedAs": { + "title": "Implemented as", + "description": "Indicates how the DSC Resource was implemented.", + "oneOf": [ + { + "title": "Standard implementation", + "description": "Indicates that the DSC Resource is implemented as one of the standard implementations built into DSC.", + "type": "string", + "enum": [ + "command" + ] + }, + { + "title": "Custom implementation", + "description": "Indicates that the DSC Resource uses a custom implementation.", + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "title": "Custom implementation name", + "description": "The name of the custom implementation.", + "type": "string" + } + } + } + ] + }, + "author": { + "title": "Author", + "description": "Indicates the name of the person or organization that developed and maintains the DSC Resource.", + "type": [ + "string", + "null" + ] + }, + "properties": { + "title": "Properties", + "description": "Defines the DSC Resource's property names.", + "type": "array", + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "requireAdapter": { + "title": "Required DSC Resource Adapter", + "description": "Defines the fully qualified type name of the DSC Resource Adapter the DSC Resource depends on.", + "oneOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + { + "type": "null" + } + ] + }, + "manifest": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json" + } + } +} diff --git a/schemas/v3.0/outputs/resource/schema.json b/schemas/v3.0/outputs/resource/schema.json new file mode 100644 index 00000000..f4430014 --- /dev/null +++ b/schemas/v3.0/outputs/resource/schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", + "type": "object" +} diff --git a/schemas/v3.0/outputs/resource/set.full.json b/schemas/v3.0/outputs/resource/set.full.json new file mode 100644 index 00000000..110ddfdb --- /dev/null +++ b/schemas/v3.0/outputs/resource/set.full.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json" + } + } +} diff --git a/schemas/v3.0/outputs/resource/set.json b/schemas/v3.0/outputs/resource/set.json new file mode 100644 index 00000000..ea161777 --- /dev/null +++ b/schemas/v3.0/outputs/resource/set.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.full.json" + } + } + ] +} diff --git a/schemas/v3.0/outputs/resource/set.simple.json b/schemas/v3.0/outputs/resource/set.simple.json new file mode 100644 index 00000000..2196c7ab --- /dev/null +++ b/schemas/v3.0/outputs/resource/set.simple.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } +} diff --git a/schemas/v3.0/outputs/resource/test.full.json b/schemas/v3.0/outputs/resource/test.full.json new file mode 100644 index 00000000..0994aa0a --- /dev/null +++ b/schemas/v3.0/outputs/resource/test.full.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json" + } + } +} diff --git a/schemas/v3.0/outputs/resource/test.json b/schemas/v3.0/outputs/resource/test.json new file mode 100644 index 00000000..201600f2 --- /dev/null +++ b/schemas/v3.0/outputs/resource/test.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.full.json" + } + } + ] +} diff --git a/schemas/v3.0/outputs/resource/test.simple.json b/schemas/v3.0/outputs/resource/test.simple.json new file mode 100644 index 00000000..03911f82 --- /dev/null +++ b/schemas/v3.0/outputs/resource/test.simple.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } +} diff --git a/schemas/v3.0/outputs/schema.json b/schemas/v3.0/outputs/schema.json new file mode 100644 index 00000000..68f0cd35 --- /dev/null +++ b/schemas/v3.0/outputs/schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", + "type": "object" +} diff --git a/schemas/v3.0/resource/manifest.adapter.json b/schemas/v3.0/resource/manifest.adapter.json new file mode 100644 index 00000000..a953943a --- /dev/null +++ b/schemas/v3.0/resource/manifest.adapter.json @@ -0,0 +1,58 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources." + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ] +} diff --git a/schemas/v3.0/resource/manifest.delete.json b/schemas/v3.0/resource/manifest.delete.json new file mode 100644 index 00000000..576bc3ca --- /dev/null +++ b/schemas/v3.0/resource/manifest.delete.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0/resource/manifest.export.json b/schemas/v3.0/resource/manifest.export.json new file mode 100644 index 00000000..f8aaac6b --- /dev/null +++ b/schemas/v3.0/resource/manifest.export.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0/resource/manifest.get.json b/schemas/v3.0/resource/manifest.get.json new file mode 100644 index 00000000..e453cae9 --- /dev/null +++ b/schemas/v3.0/resource/manifest.get.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0/resource/manifest.json b/schemas/v3.0/resource/manifest.json new file mode 100644 index 00000000..9ded2158 --- /dev/null +++ b/schemas/v3.0/resource/manifest.json @@ -0,0 +1,155 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ] + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/semver.json" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "get": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.get.json" + }, + "set": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json" + }, + "delete": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.delete.json" + }, + "export": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.export.json" + }, + "validate": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] + }, + "schema": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ] +} diff --git a/schemas/v3.0/resource/manifest.resolve.json b/schemas/v3.0/resource/manifest.resolve.json new file mode 100644 index 00000000..03a0ee90 --- /dev/null +++ b/schemas/v3.0/resource/manifest.resolve.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0/resource/manifest.schema.json b/schemas/v3.0/resource/manifest.schema.json new file mode 100644 index 00000000..575b95f0 --- /dev/null +++ b/schemas/v3.0/resource/manifest.schema.json @@ -0,0 +1,195 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource." + } + } + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": {}, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json" + } + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json" + } + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json" + } + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json" + } + } + } + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ] +} diff --git a/schemas/v3.0/resource/manifest.set.json b/schemas/v3.0/resource/manifest.set.json new file mode 100644 index 00000000..1112a633 --- /dev/null +++ b/schemas/v3.0/resource/manifest.set.json @@ -0,0 +1,83 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0/resource/manifest.test.json b/schemas/v3.0/resource/manifest.test.json new file mode 100644 index 00000000..c1bac714 --- /dev/null +++ b/schemas/v3.0/resource/manifest.test.json @@ -0,0 +1,72 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0/resource/manifest.validate.json b/schemas/v3.0/resource/manifest.validate.json new file mode 100644 index 00000000..8bb8e3ca --- /dev/null +++ b/schemas/v3.0/resource/manifest.validate.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0/resource/manifest.whatIf.json b/schemas/v3.0/resource/manifest.whatIf.json new file mode 100644 index 00000000..a264d856 --- /dev/null +++ b/schemas/v3.0/resource/manifest.whatIf.json @@ -0,0 +1,83 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "/PowerShell/DSC/main/schemas/v3.0/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3.0/resource/properties/exist.json b/schemas/v3.0/resource/properties/exist.json new file mode 100644 index 00000000..43be775e --- /dev/null +++ b/schemas/v3.0/resource/properties/exist.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json", + "title": "Instance should exist", + "description": "Indicates whether the DSC Resource instance should exist.", + "type": "boolean", + "default": true, + "enum": [ + false, + true + ] +} diff --git a/schemas/v3.0/resource/properties/inDesiredState.json b/schemas/v3.0/resource/properties/inDesiredState.json new file mode 100644 index 00000000..4756c777 --- /dev/null +++ b/schemas/v3.0/resource/properties/inDesiredState.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json", + "title": "Instance is in the Desired State", + "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", + "type": [ + "boolean", + "null" + ], + "readOnly": true +} diff --git a/schemas/v3.0/resource/properties/purge.json b/schemas/v3.0/resource/properties/purge.json new file mode 100644 index 00000000..7181b6d5 --- /dev/null +++ b/schemas/v3.0/resource/properties/purge.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json", + "title": "Purge", + "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", + "type": [ + "boolean", + "null" + ], + "writeOnly": true +} diff --git a/schemas/v3.0/resource/properties/rebootRequested.json b/schemas/v3.0/resource/properties/rebootRequested.json new file mode 100644 index 00000000..d77a4917 --- /dev/null +++ b/schemas/v3.0/resource/properties/rebootRequested.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json", + "title": "Reboot Requested", + "description": "Indicates that the set operation requires a reboot before it's fully complete.", + "type": [ + "boolean", + "null" + ], + "readOnly": true +} diff --git a/schemas/v3/bundled/config/document.json b/schemas/v3/bundled/config/document.json new file mode 100644 index 00000000..c370a2e6 --- /dev/null +++ b/schemas/v3/bundled/config/document.json @@ -0,0 +1,398 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json", + "title": "DSC Configuration Document schema", + "description": "Describes a valid DSC Configuration Document.", + "type": "object", + "required": [ + "$schema", + "resources" + ], + "properties": { + "$schema": { + "title": "Schema", + "description": "This property must be the canonical URL of the DSC Configuration Document schema that the document is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json" + ] + }, + "parameters": { + "title": "DSC Configuration document parameters", + "description": "Defines runtime options for the configuration. Users and integrating tools can override use the defined parameters to pass alternate values to the configuration.", + "type": "object", + "additionalProperties": { + "$ref": "/PowerShell/DSC/main/schemas/v3/config/document.parameter.json" + } + }, + "variables": { + "title": "Configuration variables", + "description": "Defines a set of reusable values for the configuration document. The names of this value's properties are the strings used to reference a variable's value.", + "type": "object" + }, + "resources": { + "title": "DSC Configuration document resources", + "description": "Defines a list of DSC Resource instances for the configuration to manage.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/config/document.resource.json" + } + }, + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/config/document.metadata.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.parameter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.parameter.json", + "title": "Parameter", + "description": "Defines a runtime option for a DSC Configuration Document.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/parameters/dataTypes.json" + }, + "defaultValue": { + "title": "Default value", + "description": "Defines the default value for the parameter.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/parameters/validValueTypes.json" + }, + "allowedValues": { + "title": "Allowed values", + "description": "Defines a list of valid values for the parameter. If the parameter is defined with any other values, it's invalid.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/parameters/validValueTypes.json" + } + }, + "description": { + "title": "Parameter description", + "description": "Defines a synopsis for the parameter explaining its purpose.", + "type": "string" + }, + "metadata": { + "title": "Parameter metadata", + "description": "Defines a set of key-value pairs for the parameter. This metadata isn't validated.", + "type": "object" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "minValue": { + "title": "Minimum value", + "description": "The minimum valid value for an integer type. If defined with the `maxValue` property, this value must be less than the value of `maxValue`.", + "type": "integer" + }, + "maxValue": { + "title": "Maximum value", + "description": "The maximum valid value for an integer type. If defined with the `minValue` property, this value must be greater than the value of `minValue`.", + "type": "integer" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + }, + { + "properties": { + "type": { + "const": "array" + } + } + } + ] + }, + "then": { + "properties": { + "minLength": { + "title": "Minimum length", + "description": "The minimum valid length for a `string`, `secureString`, or `array`. If defined with the `maxLength` property, this value must be less than the value of `maxLength`.", + "type": "integer", + "minimum": 0 + }, + "maxLength": { + "title": "Maximum length", + "description": "The maximum valid length for a `string`, `secureString`, or `array`. If defined with the `minLength` property, this value must be less than the value of `minLength`.", + "type": "integer", + "minimum": 0 + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "string" + }, + "allowedValues": { + "items": { + "type": "string" + } + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "object" + } + } + }, + { + "properties": { + "type": { + "const": "secureObject" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "object" + }, + "allowedValues": { + "items": { + "type": "object" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "integer" + }, + "allowedValues": { + "items": { + "type": "integer" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "array" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "bool" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "boolean" + }, + "allowedValues": { + "items": { + "type": "boolean" + } + } + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.resource.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.resource.json", + "title": "DSC Resource instance", + "description": "Defines an instance of a DSC Resource in a configuration.", + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "dependsOn": { + "title": "Instance depends on", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", + "type": "array", + "items": { + "type": "string", + "uniqueItems": true, + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$" + } + }, + "properties": { + "title": "Managed instance properties", + "description": "Defines the properties of the DSC Resource this instance manages. This property's value must be an object. DSC validates the property's value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.metadata.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.metadata.json", + "title": "Configuration metadata", + "description": "Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` property, this metadata isn't validated. You can pass any data into this property of a configuration document.", + "type": "object", + "properties": { + "Microsoft.DSC": { + "type": "object", + "title": "DSC metadata", + "description": "The `Microsoft.DSC` metadata property contains directives and information that DSC itself uses when processing a configuration document. Unlike other metadata key-value pairs, DSC validates these properties.", + "unevaluatedProperties": false, + "properties": { + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "default": "Current", + "description": "This property defines the security context a configuration requires. If you invoke a DSC operation against the configuration document in a security context that conflicts with this metadata, DSC raises an error when it validates the configuration document.\nThe default security context is `Current`." + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/parameters/dataTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/parameters/dataTypes.json", + "title": "Data Types", + "description": "Defines the data type for the parameter value.", + "type": "string", + "enum": [ + "string", + "secureString", + "int", + "bool", + "object", + "secureObject", + "array" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/parameters/validValueTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/parameters/validValueTypes.json", + "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", + "type": [ + "string", + "integer", + "object", + "array", + "boolean" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + } + } +} diff --git a/schemas/v3/bundled/config/document.vscode.json b/schemas/v3/bundled/config/document.vscode.json new file mode 100644 index 00000000..f6e5222b --- /dev/null +++ b/schemas/v3/bundled/config/document.vscode.json @@ -0,0 +1,617 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json", + "title": "DSC Configuration Document schema", + "description": "Describes a valid DSC Configuration Document.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDescribes a valid DSC Configuration Document.\n\nDSC Configurations enable users to define state by combining different DSC Resources. A\nconfiguration document uses parameters and variables to pass to a set of one or more resources\nthat define a desired state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "$schema", + "resources" + ], + "properties": { + "$schema": { + "title": "Schema", + "description": "This property must be the canonical URL of the DSC Configuration Document schema that the document is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property must be the canonical URL of the DSC Configuration Document schema that the\ndocument is implemented for.\n\nFor every version of the schema, there are three valid urls:\n\n```yaml\n.../config/document.json\n```\n\n> The URL to the canonical non-bundled schema. When it's used for validation, the validating\n> client needs to retrieve this schema and every schema it references.\n \n```yaml\n.../bundled/config/document.json\n```\n\n> The URL to the bundled schema. When it's used for validation, the validating client only\n> needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n\n```yaml\n.../bundled/config/document.vscode.json\n```\n\n> The URL to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and snippets\n> that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#schema\n", + "markdownEnumDescriptions": [ + "\n\n> #### `v3` non-bundled\n>\n> Indicates that the configuration document adheres to the `v3` schema. This URL\n> points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `v3` bundled\n>\n> Indicates that the configuration document adheres to the `v3` schema. This URL\n> points to the bundled schema. When it's used for validation, the validating client\n> only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `v3` enhanced authoring\n>\n> Indicates that the configuration document adheres to the `v3` schema. This URL\n> points to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/10` non-bundled\n>\n> Indicates that the configuration document adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/10` bundled\n>\n> Indicates that the configuration document adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/10` enhanced authoring\n>\n> Indicates that the configuration document adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/08` non-bundled\n>\n> Indicates that the configuration document adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/08` bundled\n>\n> Indicates that the configuration document adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/08` enhanced authoring\n>\n> Indicates that the configuration document adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n" + ] + }, + "parameters": { + "title": "DSC Configuration document parameters", + "description": "Defines runtime options for the configuration. Users and integrating tools can override use the defined parameters to pass alternate values to the configuration.", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/config/document.parameter.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines runtime options for the configuration. Users and integrating tools can override use\nthe defined parameters to pass alternate values to the configuration.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#parameters\n", + "defaultSnippets": [ + { + "label": " New Parameter", + "markdownDescription": "Defines a new runtime option for the configuration.\n\n```yaml\nparameterId:\n type: \n description: \n defaultValue: \n allowedValues:\n - \n```", + "body": { + "${1:parameterId}": { + "type": "$2", + "description": "$3", + "defaultValue": "$4", + "allowedValues": [ + "$5" + ] + } + } + }, + { + "label": " New Integer Parameter", + "markdownDescription": "Defines a new runtime option for the configuration as an integer value.\n\n```yaml\nparameterId:\n type: int\n description: \n defaultValue: \n minValue: \n minValue: \n```", + "body": { + "${1:parameterId}": { + "type": "int", + "description": "$2", + "defaultValue": "$3", + "minValue": "$4", + "maxValue": "$5" + } + } + } + ] + }, + "variables": { + "title": "Configuration variables", + "description": "Defines a set of reusable values for the configuration document. The names of this value's properties are the strings used to reference a variable's value.", + "type": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a set of reusable values for the configuration document. The names of this value's\nproperties are the strings used to reference a variable's value.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#variables\n", + "defaultSnippets": [ + { + "label": " New variable property", + "markdownDescription": "Defines a new variable as a key-value pair.\n\n```yaml\nvariableName: variableValue\n```", + "body": { + "${1:variableName}": "${2:variableValue}" + } + }, + { + "label": " New variable property (object)", + "markdownDescription": "Defines a new key-value pair for the variables where the value is an object.\n\n```yaml\nvariableName:\n key: value\n```", + "body": { + "${1:variableName}": { + "${2:key}": "${3:value}" + } + } + }, + { + "label": " New variable property (array)", + "markdownDescription": "Defines a new key-value pair for the variables where the value is an array.\n\n```yaml\nvariableName:\n - firstValue\n - secondValue\n```", + "body": { + "${1:variableName}": [ + "${2:firstValue}", + "${3:secondValue}" + ] + } + } + ] + }, + "resources": { + "title": "DSC Configuration document resources", + "description": "Defines a list of DSC Resource instances for the configuration to manage.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/config/document.resource.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of DSC Resource instances for the configuration to manage.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/document?view=dsc-3.0&preserve-view=true#resources\n" + }, + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/config/document.metadata.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3": { + "config": { + "document.parameter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.parameter.json", + "title": "Parameter", + "description": "Defines a runtime option for a DSC Configuration Document.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a runtime option for a DSC Configuration Document.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/parameters/dataTypes.json" + }, + "defaultValue": { + "title": "Default value", + "description": "Defines the default value for the parameter.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/parameters/validValueTypes.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the default value for the parameter.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#allowedvalues\n" + }, + "allowedValues": { + "title": "Allowed values", + "description": "Defines a list of valid values for the parameter. If the parameter is defined with any other values, it's invalid.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/parameters/validValueTypes.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of valid values for the parameter. If the parameter is defined with any other\nvalues, it's invalid.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#allowedvalues\n" + }, + "description": { + "title": "Parameter description", + "description": "Defines a synopsis for the parameter explaining its purpose.", + "type": "string", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a synopsis for the parameter explaining its purpose.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#description-1\n" + }, + "metadata": { + "title": "Parameter metadata", + "description": "Defines a set of key-value pairs for the parameter. This metadata isn't validated.", + "type": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a set of key-value pairs for the parameter. This metadata isn't validated.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#metadata-1\n", + "defaultSnippets": [ + { + "label": " New metadata property", + "markdownDescription": "Defines a key-value pair for the metadata:\n\n```yaml\nmetadataName: value\n```", + "body": { + "${1:metadataName}": "${2:value}" + } + }, + { + "label": " New metadata property (object)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an object.\n\n```yaml\nmetadataName:\n key: value\n```", + "body": { + "${1:metadataName}": { + "${2:key}": "${3:value}" + } + } + }, + { + "label": " New metadata property (array)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an array.\n\n```yaml\nmetadataName:\n - firstValue\n - secondValue\n```", + "body": { + "${1:metadataName}": [ + "${2:firstValue}", + "${3:secondValue}" + ] + } + } + ] + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "minValue": { + "title": "Minimum value", + "description": "The minimum valid value for an integer type. If defined with the `maxValue` property, this value must be less than the value of `maxValue`.", + "type": "integer", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe minimum valid value for an integer type. If defined with the `maxValue` property,\nthis value must be less than the value of `maxValue`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#minvalue\n" + }, + "maxValue": { + "title": "Maximum value", + "description": "The maximum valid value for an integer type. If defined with the `minValue` property, this value must be greater than the value of `minValue`.", + "type": "integer", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe maximum valid value for an integer type. If defined with the `minValue` property,\nthis value must be greater than the value of `minValue`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#maxvalue\n" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + }, + { + "properties": { + "type": { + "const": "array" + } + } + } + ] + }, + "then": { + "properties": { + "minLength": { + "title": "Minimum length", + "description": "The minimum valid length for a `string`, `secureString`, or `array`. If defined with the `maxLength` property, this value must be less than the value of `maxLength`.", + "type": "integer", + "minimum": 0, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe minimum valid length for a `string`, `secureString`, or `array`. If defined with\nthe `maxLength` property, this value must be less than the value of `maxLength`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#minLength\n" + }, + "maxLength": { + "title": "Maximum length", + "description": "The maximum valid length for a `string`, `secureString`, or `array`. If defined with the `minLength` property, this value must be less than the value of `minLength`.", + "type": "integer", + "minimum": 0, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe maximum valid length for a `string`, `secureString`, or `array`. If defined with\nthe `minLength` property, this value must be less than the value of `minLength`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/parameter?view=dsc-3.0&preserve-view=true#maxLength\n" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "string" + }, + "allowedValues": { + "items": { + "type": "string" + } + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "object" + } + } + }, + { + "properties": { + "type": { + "const": "secureObject" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "object" + }, + "allowedValues": { + "items": { + "type": "object" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "integer" + }, + "allowedValues": { + "items": { + "type": "integer" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "array" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "bool" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "boolean" + }, + "allowedValues": { + "items": { + "type": "boolean" + } + } + } + } + } + ] + }, + "document.resource.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.resource.json", + "title": "DSC Resource instance", + "description": "Defines an instance of a DSC Resource in a configuration.", + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "dependsOn": { + "title": "Instance depends on", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", + "type": "array", + "items": { + "type": "string", + "uniqueItems": true, + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$", + "patternErrorMessage": "Invalid value, must be a value like `[resourceId('', '`)], such as\n`[resourceId('Microsoft/OSInfo', 'Foo')]`.\n\nThe `` and `` should be the fully qualified type of the resource and its\nfriendly name in the configuration.\n", + "defaultSnippets": [ + { + "label": " New dependency", + "markdownDescription": "Defines a new dependency for the resource instance.\n\n```yaml\n\"[resourceId('dependencyInstance/Type', 'dependencyInstanceName')]\"\n```", + "bodyText": "\"[resourceId('${3:dependencyInstance/Type}', '${4:dependencyInstanceName}')]\"" + } + ] + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of DSC Resource instances that DSC must successfully process before processing\nthis instance. Each value for this property must be the `resourceID()` lookup for another\ninstance in the configuration. Multiple instances can depend on the same instance, but every\ndependency for an instance must be unique in that instance's `dependsOn` property.\n\nThe `resourceID()` function uses this syntax:\n\n```yaml\n\"[resourceId('', '']\"\n```\n\nThe `` value is the `type` property of the dependent resource and\n`` is the dependency's `name` property. When adding a dependency in a\nYAML-format configuration document, always wrap the `resourceID()` lookup in double quotes\n(`\"`).\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#properties-1\n" + }, + "properties": { + "title": "Managed instance properties", + "description": "Defines the properties of the DSC Resource this instance manages. This property's value must be an object. DSC validates the property's value against the DSC Resource's schema.", + "type": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the properties of the DSC Resource this instance manages. This property's value must\nbe an object. DSC validates the property's value against the DSC Resource's schema.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#properties-1\n" + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an instance of a DSC Resource in a configuration.\n\nThe `resources` property of a DSC Configuration document always includes at least one DSC Resource\ninstance. Together, the instances in a configuration define the desired state that DSC can get,\ntest, and set on a machine.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " New resource instance", + "markdownDescription": "Defines a new instance of a DSC Resource for the configuration.\n\n```yaml\ntype: owner[.group][.area]/name\nname: instance_name\nproperties:\n propertyName: propertyValue\n```", + "body": { + "type": "${1:owner[.group][.area]/name}", + "name": "${2:instance_name}", + "properties": { + "${3:propertyName}": "${4:propertyValue}" + } + } + }, + { + "label": " New dependent resource instance", + "markdownDescription": "Defines a new instance of a DSC Resource for the configuration that depends on another\ninstance.\n\n```yaml\ntype: owner[.group][.area]/name\nname: instance_name\ndependsOn:\n - \"[resourceId('dependencyInstance/Type', 'dependencyInstanceName')]\"\nproperties:\n propertyName: propertyValue\n```", + "body": { + "type": "${1:owner[.group][.area]/name}", + "name": "${2:instance_name}", + "dependsOn": [ + "\"[resourceId('${3:dependencyInstance/Type}', '${4:dependencyInstanceName}')]\"" + ], + "properties": { + "${5:propertyName}": "${6:propertyValue}" + } + } + } + ] + }, + "document.metadata.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.metadata.json", + "title": "Configuration metadata", + "description": "Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` property, this metadata isn't validated. You can pass any data into this property of a configuration document.", + "type": "object", + "properties": { + "Microsoft.DSC": { + "type": "object", + "title": "DSC metadata", + "description": "The `Microsoft.DSC` metadata property contains directives and information that DSC itself uses when processing a configuration document. Unlike other metadata key-value pairs, DSC validates these properties.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe `Microsoft.DSC` metadata property contains directives and information that DSC itself\nuses when processing a configuration document. Unlike other metadata key-value pairs, DSC\nvalidates these properties.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true#microsoft.dsc\n", + "unevaluatedProperties": false, + "properties": { + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "default": "Current", + "description": "This property defines the security context a configuration requires. If you invoke a DSC operation against the configuration document in a security context that conflicts with this metadata, DSC raises an error when it validates the configuration document.\nThe default security context is `Current`.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property defines the security context a configuration requires. If you invoke a DSC\noperation against the configuration document in a security context that conflicts with\nthis metadata, DSC raises an error when it validates the configuration document.\n\nThe default security context is `Current`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true#microsoft.dsc\n", + "markdownEnumDescriptions": [ + "\n\n> ### Current security context\n>\n> Indicates that the configuration document is usable under any security context. You\n> can invoke DSC operations against the document when elevated as root or an\n> administrator and as a normal user or account.\n", + "\n\n> ### Elevated security context\n>\n> Indicates that the configuration document is usable only in an elevated security\n> context. You can invoke DSC operations against the document when elevated as root or\n> an administrator. When you invoke DSC operations against the document as a\n> non-elevated user or account, DSC raises an error when it validates the configuration\n> document.\n", + "\n\n> ### Restricted security context\n>\n> Indicates that the configuration document is usable only in a non-elevated security\n> context. You can invoke DSC operations against the document as a non-elevated user or\n> account. When you invoke DSC operations against the document as root or an\n> administrator, DSC raises an error when it validates the configuration document.\n" + ] + } + } + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC`\nproperty, this metadata isn't validated. You can pass any data into this property of a\nconfiguration document.\n\nThe `Microsoft.DSC` metadata property contains metadata directives and information that DSC\nitself uses when processing the configuration document. For more information, see\n[Microsoft.DSC][02]\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/metadata?view=dsc-3.0&preserve-view=true#microsoft.dsc\n", + "defaultSnippets": [ + { + "label": " New metadata property", + "markdownDescription": "Defines a key-value pair for the metadata:\n\n```yaml\nmetadataName: value\n```", + "body": { + "${1:metadataName}": "${2:value}" + } + }, + { + "label": " New metadata property (object)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an object.\n\n```yaml\nmetadataName:\n key: value\n```", + "body": { + "${1:metadataName}": { + "${2:key}": "${3:value}" + } + } + }, + { + "label": " New metadata property (array)", + "markdownDescription": "Defines a new key-value pair for the metadata where the value is an array.\n\n```yaml\nmetadataName:\n - firstValue\n - secondValue\n```", + "body": { + "${1:metadataName}": [ + "${2:firstValue}", + "${3:secondValue}" + ] + } + } + ] + } + }, + "definitions": { + "parameters": { + "dataTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/parameters/dataTypes.json", + "title": "Data Types", + "description": "Defines the data type for the parameter value.", + "type": "string", + "enum": [ + "string", + "secureString", + "int", + "bool", + "object", + "secureObject", + "array" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the data type for the parameter value.\n\nThe valid data types for a parameter are:\n\n- `array` for arrays\n- `bool` for booleans\n- `int` for integers\n- `object` for objects\n- `string` for strings\n- `secureObject` for secure objects\n- `secureString` for secure strings\n\nAccess parameters in a configuration using this syntax:\n\n```yaml\n\"[parameter('')]\"\n```\n\nIn YAML, the parameter syntax needs to be enclosed in double-quotes when used as an inline value.\nIf the syntax isn't quoted, YAML interprets the syntax as an array.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true\n", + "markdownEnumDescriptions": [ + "_Strings are an arbitrary set of text._\n\n> To define a long strings in YAML, use the folded block syntax or literal block syntax by\n> adding a `>` or `|` and a line break after the key. Then, indent the next line. Every line\n> in the string must start at the same level of indentation. You can trim the trailing\n> whitespace by using `>-` or `|-` instead.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#strings\n", + "_Secure strings are text that needs to be handled securely._\n\n> Secure strings are an arbitrary set of text that DSC and integrating tools shouldn't log or\n> record. If a secure data type parameter is used for a resource instance property that doesn't\n> expect a secure value, the resource may still log or record the value. If the resource has\n> independent logging or recording that isn't handled by DSC, the value may be stored\n> insecurely.\n>\n> Use secure strings for passwords and secrets. Never define a default value for secure string\n> parameters.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#secure-strings-and-objects\n", + "_Integer values are numbers without a fractional part._\n\n> Integer values may be limited by integrating tools or the DSC Resources they're used with.\n> DSC itself supports integer values between `-9223372036854775808` and `9223372036854775807`.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#integers\n", + "_Boolean values are either `true` or `false`._\n\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#booleans\n", + "_Objects define a set of key-value pairs._\n\n> The value for each key can be any valid data type. The values can be the same type or\n> different types.\n>\n> Access keys in the object using dot-notation. Dot-notation uses this syntax:\n>\n> ```yaml\n> \"[parameters('').]\n> ```\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#objects\n", + "_Secure objects are key-value pairs that need to be handled securely._\n\n> Secure objects define a set of key-value pairs that DSC and integrating tools shouldn't log\n> or record. If a secure data type parameter is used for a resource instance property that\n> doesn't expect a secure value, the resource may still log or record the value. If the\n> resource has independent logging or recording that isn't handled by DSC, the value may be\n> stored insecurely.\n>\n> Never define a default value for secure object parameters.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#secure-strings-and-objects\n", + "_Arrays are a list of one or more values._\n\n> The values in the array can be any valid data type. Values in the array can be the same type\n> or different types.\n>\n> For more information, see the [_Online Documentation_][01].\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/parameters/datatypes?view=dsc-3.0&preserve-view=true#arrays\n" + ] + }, + "validValueTypes.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/parameters/validValueTypes.json", + "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", + "type": [ + "string", + "integer", + "object", + "array", + "boolean" + ] + } + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + } + }, + "metadata": { + "Microsoft.DSC": { + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3/bundled/outputs/config/get.json b/schemas/v3/bundled/outputs/config/get.json new file mode 100644 index 00000000..96d9e822 --- /dev/null +++ b/schemas/v3/bundled/outputs/config/get.json @@ -0,0 +1,333 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/get.json", + "title": "DSC Configuration get command result", + "description": "Represents the data structure returned by the `dsc config get` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `get` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/message.json" + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } +} diff --git a/schemas/v3/bundled/outputs/config/get.vscode.json b/schemas/v3/bundled/outputs/config/get.vscode.json new file mode 100644 index 00000000..2ea5fd3d --- /dev/null +++ b/schemas/v3/bundled/outputs/config/get.vscode.json @@ -0,0 +1,368 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/get.json", + "title": "DSC Configuration get command result", + "description": "Represents the data structure returned by the `dsc config get` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `get` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json" + } + }, + "messages": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/messages.json" + }, + "hadErrors": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3": { + "metadata": { + "configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "Microsoft.DSC": { + "version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "markdownDescription": "Defines the version of DSC that ran the command. This value is always the semantic version of the\nDSC command, like `3.0.0-preview.7`.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "markdownDescription": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or\n`Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "markdownDescription": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf`\nmode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set`\noperations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the start date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the end date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "markdownDescription": "Defines whether the operation was for a configuration or a resource. If the value for this\nmetadata property is `configuration`, DSC was run through the `dsc config` command. If the value\nis `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + } + }, + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + } + }, + "outputs": { + "resource": { + "get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json" + } + } + }, + "get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json" + } + } + ] + }, + "get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + } + } + }, + "definitions": { + "messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/message.json" + } + }, + "hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3/bundled/outputs/config/set.json b/schemas/v3/bundled/outputs/config/set.json new file mode 100644 index 00000000..e4b26f03 --- /dev/null +++ b/schemas/v3/bundled/outputs/config/set.json @@ -0,0 +1,349 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/set.json", + "title": "DSC Configuration set command result", + "description": "Represents the data structure returned by the `dsc config set` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `set` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/message.json" + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } +} diff --git a/schemas/v3/bundled/outputs/config/set.vscode.json b/schemas/v3/bundled/outputs/config/set.vscode.json new file mode 100644 index 00000000..bfa06400 --- /dev/null +++ b/schemas/v3/bundled/outputs/config/set.vscode.json @@ -0,0 +1,384 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/set.json", + "title": "DSC Configuration set command result", + "description": "Represents the data structure returned by the `dsc config set` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `set` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json" + } + }, + "messages": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/messages.json" + }, + "hadErrors": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3": { + "metadata": { + "configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "Microsoft.DSC": { + "version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "markdownDescription": "Defines the version of DSC that ran the command. This value is always the semantic version of the\nDSC command, like `3.0.0-preview.7`.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "markdownDescription": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or\n`Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "markdownDescription": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf`\nmode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set`\noperations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the start date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the end date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "markdownDescription": "Defines whether the operation was for a configuration or a resource. If the value for this\nmetadata property is `configuration`, DSC was run through the `dsc config` command. If the value\nis `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + } + }, + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + } + }, + "outputs": { + "resource": { + "set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json" + } + } + }, + "set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json" + } + } + ] + }, + "set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/message.json" + } + }, + "hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3/bundled/outputs/config/test.json b/schemas/v3/bundled/outputs/config/test.json new file mode 100644 index 00000000..b12dd2c8 --- /dev/null +++ b/schemas/v3/bundled/outputs/config/test.json @@ -0,0 +1,355 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/test.json", + "title": "DSC Configuration test command result", + "description": "Represents the data structure returned by the `dsc config test` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `test` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/message.json" + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } +} diff --git a/schemas/v3/bundled/outputs/config/test.vscode.json b/schemas/v3/bundled/outputs/config/test.vscode.json new file mode 100644 index 00000000..a9bf861d --- /dev/null +++ b/schemas/v3/bundled/outputs/config/test.vscode.json @@ -0,0 +1,390 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/test.json", + "title": "DSC Configuration test command result", + "description": "Represents the data structure returned by the `dsc config test` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `test` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json" + } + }, + "messages": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/messages.json" + }, + "hadErrors": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3": { + "metadata": { + "configurationDocumentResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json" + } + } + } + } + }, + "Microsoft.DSC": { + "version.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "markdownDescription": "Defines the version of DSC that ran the command. This value is always the semantic version of the\nDSC command, like `3.0.0-preview.7`.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "operation.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "markdownDescription": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or\n`Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] + }, + "executionType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "markdownDescription": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf`\nmode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set`\noperations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] + }, + "startDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the start date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "endDatetime.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "markdownDescription": "Defines the end date and time for the DSC operation as a timestamp following the format defined\nin [RFC3339, section 5.6 (see `date-time`)][01].\n\nFor example: `2024-04-14T08:49:51.395686600-07:00`\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6", + "type": "string", + "format": "date-time" + }, + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + }, + "securityContext.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "markdownDescription": "Defines the security context that DSC was run under. If the value for this metadata property is\n`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator\nprivileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in\na non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] + }, + "context.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "markdownDescription": "Defines whether the operation was for a configuration or a resource. If the value for this\nmetadata property is `configuration`, DSC was run through the `dsc config` command. If the value\nis `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] + } + }, + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + } + }, + "outputs": { + "resource": { + "test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json" + } + } + }, + "test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json" + } + } + ] + }, + "test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "messages.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/message.json" + } + }, + "hadErrors.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "message.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3/bundled/outputs/resource/get.json b/schemas/v3/bundled/outputs/resource/get.json new file mode 100644 index 00000000..fcbd5710 --- /dev/null +++ b/schemas/v3/bundled/outputs/resource/get.json @@ -0,0 +1,130 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json" + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } +} diff --git a/schemas/v3/bundled/outputs/resource/get.vscode.json b/schemas/v3/bundled/outputs/resource/get.vscode.json new file mode 100644 index 00000000..6e1fb6da --- /dev/null +++ b/schemas/v3/bundled/outputs/resource/get.vscode.json @@ -0,0 +1,156 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json" + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3": { + "outputs": { + "resource": { + "get.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } + }, + "get.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json" + } + } + }, + "get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json" + } + } + ] + } + } + }, + "metadata": { + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "Microsoft.DSC": { + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } + }, + "definitions": { + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3/bundled/outputs/resource/list.json b/schemas/v3/bundled/outputs/resource/list.json new file mode 100644 index 00000000..9816219c --- /dev/null +++ b/schemas/v3/bundled/outputs/resource/list.json @@ -0,0 +1,1238 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/list.json", + "title": "dsc resource list result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource list` command.", + "type": "object", + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json" + }, + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "capabilities": { + "title": "Resource capabilities", + "description": "Defines the list of DSC operations the resource is compatible with. If the resource doesn't list a given operation, like `set` or `export`, the resource can't be used for those operations. The exception to this is `test` - DSC uses synthetic testing for resources that don't have the `test` capability.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "get", + "set", + "setHandlesExist", + "whatIf", + "test", + "delete", + "export", + "resolve" + ] + } + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "path": { + "title": "Path", + "description": "Indicates the path to the DSC Resource on the file system.", + "type": "string" + }, + "directory": { + "title": "Directory", + "description": "Indicates the path to the folder containing the DSC Resource on the file system.", + "type": "string" + }, + "implementedAs": { + "title": "Implemented as", + "description": "Indicates how the DSC Resource was implemented.", + "oneOf": [ + { + "title": "Standard implementation", + "description": "Indicates that the DSC Resource is implemented as one of the standard implementations built into DSC.", + "type": "string", + "enum": [ + "command" + ] + }, + { + "title": "Custom implementation", + "description": "Indicates that the DSC Resource uses a custom implementation.", + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "title": "Custom implementation name", + "description": "The name of the custom implementation.", + "type": "string" + } + } + } + ] + }, + "author": { + "title": "Author", + "description": "Indicates the name of the person or organization that developed and maintains the DSC Resource.", + "type": [ + "string", + "null" + ] + }, + "properties": { + "title": "Properties", + "description": "Defines the DSC Resource's property names.", + "type": "array", + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "requireAdapter": { + "title": "Required DSC Resource Adapter", + "description": "Defines the fully qualified type name of the DSC Resource Adapter the DSC Resource depends on.", + "oneOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + { + "type": "null" + } + ] + }, + "manifest": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.json" + } + }, + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ] + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "get": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json" + }, + "set": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json" + }, + "delete": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json" + }, + "export": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json" + }, + "validate": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] + }, + "schema": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources." + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource." + } + } + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": {}, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json" + } + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json" + } + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/purge.json" + } + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/rebootRequested.json" + } + } + } + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command." + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json", + "title": "Instance should exist", + "description": "Indicates whether the DSC Resource instance should exist.", + "type": "boolean", + "default": true, + "enum": [ + false, + true + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json", + "title": "Instance is in the Desired State", + "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/purge.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/purge.json", + "title": "Purge", + "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", + "type": [ + "boolean", + "null" + ], + "writeOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/rebootRequested.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/rebootRequested.json", + "title": "Reboot Requested", + "description": "Indicates that the set operation requires a reboot before it's fully complete.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + } + } +} diff --git a/schemas/v3/bundled/outputs/resource/list.vscode.json b/schemas/v3/bundled/outputs/resource/list.vscode.json new file mode 100644 index 00000000..c16ce89d --- /dev/null +++ b/schemas/v3/bundled/outputs/resource/list.vscode.json @@ -0,0 +1,2068 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/list.json", + "title": "dsc resource list result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource list` command.", + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "kind": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json" + }, + "version": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "capabilities": { + "title": "Resource capabilities", + "description": "Defines the list of DSC operations the resource is compatible with. If the resource doesn't list a given operation, like `set` or `export`, the resource can't be used for those operations. The exception to this is `test` - DSC uses synthetic testing for resources that don't have the `test` capability.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "get", + "set", + "setHandlesExist", + "whatIf", + "test", + "delete", + "export", + "resolve" + ] + } + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "path": { + "title": "Path", + "description": "Indicates the path to the DSC Resource on the file system.", + "type": "string" + }, + "directory": { + "title": "Directory", + "description": "Indicates the path to the folder containing the DSC Resource on the file system.", + "type": "string" + }, + "implementedAs": { + "title": "Implemented as", + "description": "Indicates how the DSC Resource was implemented.", + "oneOf": [ + { + "title": "Standard implementation", + "description": "Indicates that the DSC Resource is implemented as one of the standard implementations built into DSC.", + "type": "string", + "enum": [ + "command" + ] + }, + { + "title": "Custom implementation", + "description": "Indicates that the DSC Resource uses a custom implementation.", + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "title": "Custom implementation name", + "description": "The name of the custom implementation.", + "type": "string" + } + } + } + ] + }, + "author": { + "title": "Author", + "description": "Indicates the name of the person or organization that developed and maintains the DSC Resource.", + "type": [ + "string", + "null" + ] + }, + "properties": { + "title": "Properties", + "description": "Defines the DSC Resource's property names.", + "type": "array", + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "requireAdapter": { + "title": "Required DSC Resource Adapter", + "description": "Defines the fully qualified type name of the DSC Resource Adapter the DSC Resource depends on.", + "oneOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + { + "type": "null" + } + ] + }, + "manifest": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.json" + } + }, + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3": { + "definitions": { + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the resource is a normal DSC Resource, a group resource, or an adapter\nresource. This property is only required for group resources.\n\nDSC infers the default value for this property based on whether the [adapter][02] property is\ndefined in the manifest:\n\n- If the `adapter` property is defined in the manifest, the default `kind` is `Adapter`.\n- If the `adapter` property is not defined in the manifest, the default `kind` is `Resource`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "markdownEnumDescriptions": [ + "\n\nIndicates that the manifest is for a standard command-based DSC Resource.\n", + "\n\nIndicates that the manifest is for an adapter resource that enables the use of\nnon-command-based resources with DSC.\n", + "\n\nIndicates that the manifest is for a group resource that processes an array of nested\nresource instances.\n", + "\n\nIndicates that the manifest is for an import resource that resolves an external source to DSC\nresource instances. The resolved instances are processed as nested instances for the import\nresource.\n" + ] + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "defaultSnippets": [ + { + "label": "String argument", + "markdownDescription": "Add a string argument to the command, like `config` or `--config`.", + "body": "${1:argument_name}" + }, + { + "label": "JSON input argument", + "markdownDescription": "Add a JSON input argument to the command. A command can only define one JSON input argument\nin the `args` list. When you define a JSON input argument, DSC passes the input data for\nthe command to the specified argument as a string representing the data as a compressed\nJSON object. The compressed JSON object doesn't have any spaces or newlines between the\nobject properties and values.\n\nIf the command doesn't define the `input` property, it must define a JSON input argument.\n\nIf the command defines both the `input` property and a JSON input argument, DSC sends the\ninput data to the command in both ways. For example, if the command defines `input` as\n`stdin` and has a JSON input argument in `args`, DSC sends the input data as a compressed\nJSON object over stdin and to the the specified argument.", + "body": { + "jsonInputArg": "${1:argument_name}", + "mandatory": "^$2" + } + } + ], + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command.", + "markdownDescription": "Any item in the argument array can be a string representing a static argument to pass to\nthe command.\n" + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "markdownDescription": "Defines an argument for the command that accepts the JSON input object as a string. DSC\npasses the JSON input to the named argument when available. You can define the `mandatory`\nproperty to indicate whether DSC should always pass the argument to the command, even when\nthere's no JSON input for the command. In that case, DSC passes an empty string to the\nJSON input argument. You can only define one JSON input argument per arguments array.\n\nIf you define a JSON input argument and an `input` kind for a command, DSC sends the JSON\ndata both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "markdownDescription": "Defines the argument that accepts the JSON property bag for the resource as input.\n", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "markdownDescription": "Defines whether the argument is mandatory. If this property is set to `true`, DSC\npasses an empty string when no JSON input is provided. The default value is `false`.\n", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ], + "markdownEnumDescriptions": [ + "_Environment variables_\n\n> Indicates that the resource expects the properties of an instance to be specified as\n> environment variables with the same names and casing.\n>\n> This option only supports the following data types for instance properties:\n>\n> - `boolean`\n> - `integer`\n> - `number`\n> - `string`\n> - `array` of `integer` values\n> - `array` of `number` values\n> - `array` of `string` values\n>\n> For non-array values, DSC sets the environment variable to the specified value as-is. When\n> the data type is an array of values, DSC sets the environment variable as a comma-delimited\n> string. For example, the property `foo` with a value of `[1, 2, 3]` is saved in the `foo`\n> environment variable as `\"1,2,3\"`.\n>\n> If the resource needs to support complex properties with an `object` value or multi-type\n> arrays, set this to `stdin` instead.\n", + "_JSON over `stdin`_\n\n> Indicates that the resource expects a JSON blob representing an instance from `stdin`.\n> The JSON must adhere to the instance schema.\n" + ] + }, + "returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + } + }, + "resource": { + "manifest.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the information DSC and integrating require to process and call a command-based DSC\nResource. For DSC to use a manifest on a system, the manifest file must:\n\n1. Be discoverable in the `PATH` environment variable.\n1. Follow the naming convention `.dsc.resource.json`.\n1. Be valid for this schema.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define a resource", + "markdownDescription": "Defines a standard resource that:\n\n- Can get the current state of an instance\n- Can set an instance to the desired state\n- Relies on DSC's synthetic testing to determine whether an instance is in the desired state\n- Defines an embedded JSON schema.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "set": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "implementsPretest": "^${11:false}", + "return": "${12:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (group)", + "markdownDescription": "Defines a group resource that expects a list of resource instances and operates on them.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "group", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${18|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${19:Resources}", + "description": "${20:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.resource.json" + } + }, + "${21:name}": { + "title": "${22:property title}", + "description": "${23:explanation of property purpose and usage}", + "type": "${24|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (adapter)", + "markdownDescription": "Defines an adapter resource that enables users to define non-command-based DSC Resources in\nthe configuration.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "adapter", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "adapter": { + "config": "${18|full,sequence|}", + "list": { + "executable": "${19:executable name}", + "args": [ + "${20:argument}" + ] + } + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${23|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${24:Resources}", + "description": "${25:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.resource.json" + } + }, + "${26:name}": { + "title": "${27:property title}", + "description": "${28:explanation of property purpose and usage}", + "type": "${29|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (importer)", + "markdownDescription": "Defines an importer resource that can resolve an external source to nested resource\ninstances.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "importer", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "resolve": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (assertion-only)", + "markdownDescription": "Defines an assertion resource that can get the current state of an instance but not configure\nit. By default, the resource relies on DSC's synthetic testing feature. If the resource\nimplements the `test` operation itself, define the `test` property.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + } + ], + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property must be one of the canonical URLs for the version of the Command-based DSC\nResource Manifest schema that the manifest is implemented for.\n\nFor every version of the schema, there are three valid urls:\n\n```yaml\n.../resource/manifest.json\n```\n\n> The URL to the canonical non-bundled schema. When it's used for validation, the validating\n> client needs to retrieve this schema and every schema it references.\n\n```yaml\n.../bundled/resource/manifest.json\n```\n\n> The URL to the bundled schema. When it's used for validation, the validating client only\n> needs to retrieve this schema.\n> \n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n\n```yaml\n.../bundled/resource/manifest.vscode.json\n```\n\n> The URL to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and snippets\n> that the others don't include.\n> \n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#schema\n", + "markdownEnumDescriptions": [ + "\n\n> #### `v3` non-bundled\n>\n> Indicates that the resource manifest adheres to the `v3` schema. This URL\n> points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `v3` bundled\n>\n> Indicates that the resource manifest adheres to the `v3` schema. This URL\n> points to the bundled schema. When it's used for validation, the validating client\n> only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `v3` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `v3` schema. This URL\n> points to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/10` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/10` bundled\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3` of the schema.\n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/10` enhanced authoring\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3` of the schema.\n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/08` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/08` bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/08` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n" + ] + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe semantic version ([semver][02]) of the DSC Resource. This version identifies the DSC\nResource, not the version of the application it manages.\n\nThis value uses the [suggested regular expression][03] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#version\n[02]: https://semver.org/\n[03]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a short synopsis of the DSC Resource's purpose.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#description-1\n" + }, + "kind": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of searchable terms for the resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#tags\n", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$", + "patternErrorMessage": "Invalid tag. Tags must be a string of alphanumeric characters and underscores. No other\ncharacters are permitted.\n" + } + }, + "get": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json" + }, + "set": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json" + }, + "delete": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json" + }, + "export": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json" + }, + "validate": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$", + "patternErrorMessage": "Invalid exit code. Must be a string representing a 32-bit signed integer.\n" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property defines a map of valid exit codes for the DSC Resource. DSC always interprets\nexit code `0` as a successful operation and any other exit code as an error. Use this\nproperty to indicate human-readable semantic meanings for the DSC Resource's exit codes.\n\nDefine the keys in this property as strings representing a valid 32-bit signed integer. You\ncan't use alternate formats for the exit code. For example, instead of the hexadecimal value\n`0x80070005` for \"Access denied\", specify the exit code as `-2147024891`. If you're authoring\nyour resource manifest in yaml, be sure to wrap the exit code in single quotes, like\n`'0': Success` instead of `0: Success` to ensure the YAML file can be parsed correctly.\n\nDefine the value for each key as a string explaining what the exit code indicates.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#exitcodes\n", + "defaultSnippets": [ + { + "label": " Defined exit codes", + "description": "Defines exit codes with semantic meaning for the resource.", + "body": { + "0": "Success", + "${1:first exit code number}": "${2:first exit code meaning}", + "${3:second exit code number}": "${4:second exit code meaning}" + } + } + ] + }, + "schema": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ] + }, + "manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of an instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"get\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property. When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"get\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `get` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `get` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `get` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `get` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `get` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to set the desired state of an instance and how to\nprocess the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set` command. Set this value to `true` if the DSC Resource tests input before modifying\nsystem state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set` command where the instance defines the `_exist` property as `false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's state after the set\noperation or the state and an array of the properties the DSC Resource modified.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's final state after the set\n> operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's final state and an array of property\n> names that the resource modified.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `set` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `set` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `set` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `set` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `set` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to indicate whether and how the set command will\nmodify an instance and how to process the output from the DSC Resource. If a resource doesn't\ndefine this method in the manifest, DSC synthesizes this behavior by converting the result of\nthe test operation for the resource into the [set result][02].\n\nThis method definition has the same structure as the [set method][03] in the resource manifest.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/outputs/resource/set?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\", \"--what-if\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n \"--what-if\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set --what-if` command . Set this value to `true` if the DSC Resource tests input before\nprocessing how it will modify system state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set --what-if` command where the instance defines the `_exist` property as\n`false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's expected state after a\nset operation in what-if mode or the state and an array of the properties the DSC Resource\nwould modify.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's expected final state after the\n> set operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's expected final state and an array of\n> property names that the resource would modify.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `whatIf` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `whatIf` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `whatIf` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `whatIf` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `whatIf` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to test if an instance is in the desired state and how\nto process the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"test\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"test\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#input\n" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's current state or the\nstate and an array of the properties that are out of the desired state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Actual state only_\n\n> Indicates that the resource returns only the instance's actual state as a JSON blob.\n", + "_Actual state and differing properties_\n\n> Indicates that the resource returns the instance's actual state and an array of\n> property names that are out of the desired state.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `test` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `test` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `test` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `test` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + "${4:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `test` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "return": "${1|state,stateAndDiff|}", + "executable": "${2:executable_name}", + "args": [ + { + "jsonInputArg": "${3:argument_name}", + "mandatory": "^$4" + } + ] + } + } + ] + }, + "manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to delete an instance. Define this method for\nresources as an alternative to handling the [`_exist`][02] property in a `set` operation, which\ncan lead to highly complex code. If the `set` method for the resource is able to handle deleting\nan instance when `_exist` is `false`, set the [`handlesExist`][03] property of the set method\ndefinition to `true` instead.\n\nIf you define the delete method in a resource manifest, ensure that you also define the\n[`_exist`][02] property in the [JSON schema for the resource's properties][04].\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[04]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"delete\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config delete\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `delete` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `delete` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `delete` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `delete` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `delete` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of every instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"export\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"export\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `export` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `export` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `export` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `export` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `export` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^3" + } + ] + } + } + ] + }, + "manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to validate the state of an instance. This method is\nmandatory for DSC Group Resources. It's ignored for all other DSC Resources.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"validate\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"validate\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `validate` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `validate` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `validate` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `validate` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `validate` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to resolve an external source to nested DSC\nConfiguration Document. Define this method for [importer resources][02] and set the [kind][03]\nproperty in the manifest root to `Import`.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourceKind?view=dsc-3.0&preserve-view=true#importer-resources\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"resolve\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"resolve\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `resolve` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `resolve` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `resolve` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `resolve` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `resolve` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to\nmanage resources that don't have their own manifests with DSC.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#list\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"registry\",\n \"args\": [\"resources\", \"list\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nregistry resources list\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#args\n" + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the adapter expects to receive a full and unprocessed configuration as a\nsingle JSON blob over stdin or a sequence of JSON Lines for each child resource's\nconfigurations.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#config\n", + "markdownEnumDescriptions": [ + "_Full and unprocessed config as a JSON blob_\n\n> Indicates that the adapter expects a JSON blob containing the full and unprocessed\n> configuration as a single JSON blob over `stdin`.\n", + "_Resource instances as JSON Lines_\n\n> Indicates that the adapter expects each resource's configuration as a [JSON Line][01]\n> over `stdin`.\n\n[01]: https://jsonlines.org/\n" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when no arguments are\nrequired.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}" + } + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when at least one\nargument is required.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + } + } + ] + }, + "manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"schema\", \"show\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource schema show\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#args\n" + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob\nrepresenting an instance of the DSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `schema` command for the resource when no arguments are required.\n", + "body": { + "executable": "${1:executable_name}" + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the `schema` command for the resource when at least one argument is required.\n", + "body": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + ] + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON Schema DSC must use to validate a JSON blob representing an instance of the\nDSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type. DSC only supports JSON Schema Draft 07 and later.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n", + "markdownEnumDescriptions": [ + "_Draft 2020-12 (recommended)_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2020-12][01].\n>\n> This is the latest published draft of JSON Schema and is the draft future drafts\n> will be most compatible with.\n\n[01]: https://json-schema.org/specification-links.html#2020-12\n", + "_Draft 2019-09_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2019-09][01].\n>\n> This is the previous published draft of JSON Schema. It's mostly compatible with\n> 2020-12, but less extensible and can't be bundled.\n\n[01]: https://json-schema.org/specification-links.html#draft-2019-09-formerly-known-as-draft-8\n", + "_Draft 07_\n\n> Indicates that the resource instance schema adheres to [JSON Schema Draft 07][01].\n>\n> This is an older published draft of JSON Schema. It's widely used, but incompatible\n> with 2019-09 and later. It's less expressive, extensible, maintainable, and isn't\n> recommended for new schema definitions.\n\n[01]: https://json-schema.org/specification-links.html#draft-7\n" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the unique ID for the DSC Resource's instance schema. If the instance schema is\npublished to its own public URI, set this keyword to that URI.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#id\n" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the properties that DSC can retrieve and manage for the resource's instances.\nThis keyword must define at least one property as a key-value pair. The key is the\nproperty's name. The value is a subschema that validates the property.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#properties\n", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": { + "defaultSnippets": [ + { + "label": " Define a property", + "markdownDescription": "Define a new property for the resource instance schema.", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + }, + { + "label": " Define a property (boolean)", + "markdownDescription": "Define a new [boolean][01] property for the resource instance schema, requiring the\nvalue to be either `true` or `false`.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/boolean.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "boolean" + } + }, + { + "label": " Define a property (string)", + "markdownDescription": "Define a new [string][01] property for the resource instance schema, requiring the\nvalue to be a blob of text.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/string.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "string" + } + }, + { + "label": " Define a property (integer)", + "markdownDescription": "Define a new [integer][01] property for the resource instance schema, requiring the\nvalue to be a number without a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "integer" + } + }, + { + "label": " Define a property (number)", + "markdownDescription": "Define a new [number][01] property for the resource instance schema, requiring the\nvalue to be a number that may include a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "number" + } + }, + { + "label": " Define a property (array)", + "markdownDescription": "Define a new [array][01] property for the resource instance schema, requiring the\nvalue to be a list of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/array.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "array", + "items": { + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + } + }, + { + "label": " Define a property (object)", + "markdownDescription": "Define a new [object][01] property for the resource instance schema, requiring the\nvalue to be a set of key-value pairs.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/object.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "object", + "properties": { + "${3:propertyName}": { + "title": "${4:propertyTitle}", + "description": "${5:explanation of property purpose and usage}", + "type": "${6|string,integer,number,array,object,null|}" + } + } + } + }, + { + "label": " Define a property (enum)", + "markdownDescription": "Define a new [enum][01] property for the resource instance schema that only accepts\na defined set of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "enum": [ + "^${3:\"first value\"}", + "^${4:\"second value\"}" + ] + } + }, + { + "label": " Define a property (const)", + "markdownDescription": "Define a new [const][01] property for the resource instance schema that only\naccepts a specific value.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#constant-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "const": "^${3:\"constant value\"}" + } + } + ] + }, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the resource can enforce whether instances exist, handling whether an\ninstance should be added, updated, or removed during a set operation. The default\nvalue is `true`.\n\nResources that define this property declare that the implementation adheres to the\nfollowing behavior contract:\n\n1. When the desired state for `_exist` is `true`, the resource expects the instance\n to exist. If it doesn't exist, the resource creates or adds the instance during\n the set operation.\n1. When the desired state for `_exist` is `false`, the resource expects the instance\n to not exist. If it does exist, the resource deletes or removes the instance\n during the set operation.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource returns this value for it's own `test` method. This\nproperty is mandatory when the manifest defines the `test` property. It shouldn't\nbe included if the DSC Resource relies on DSC's synthetic testing.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/indesiredstate?view=dsc-3.0&preserve-view=true\n" + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/purge.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_purge` property to specify\nwhether the DSC Resource should remove all non-specified members when it manages\nan array of members or values.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/purge?view=dsc-3.0&preserve-view=true\n" + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/rebootRequested.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_rebootRequested` property to\nreport whether the machine should be rebooted after the `set` method executes.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/rebootrequested?view=dsc-3.0&preserve-view=true\n" + } + }, + "defaultSnippets": [ + { + "label": " Define an instance property", + "markdownDescription": "Define a property for the resource instance schema.", + "body": { + "${1:propertyName}": { + "title": "${2:property title}", + "description": "${3:explanation of property purpose and usage}", + "type": "${4|string,integer,number,array,object,null|}" + } + } + } + ] + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must validate a JSON blob representing an instance of the DSC Resource.\n\nThe JSON schema can be defined dynamically with the `command` property or statically with the\n`embedded` property.\n\nFor development purposes, it can be more convenient to use the `command` property and avoid\nneeding to adjust both the code and the schema.\n\nMicrosoft recommends using the `embedded` property when publishing a resource publicly. When the\nmanifest declares the schema with the `command` property, DSC calls the command at the beginning\nof any operation using the resource, possibly impacting performance. The schema is also\nunavailable to integrating tools when the resource isn't installed locally. When the schema is\nembedded in the manifest, DSC and integrating tools only need the manifest itself.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define as command without arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when no arguments are required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}" + } + } + }, + { + "label": " Define as command with arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when at least one argument is required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + }, + { + "label": " Define as an embedded schema", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema embedded in the manifest. This is the preferred option\nfor publicly published resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "body": { + "embedded": { + "${escape_dollar:$}schema": "${1|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${2:name}": { + "title": "${3:property title}", + "description": "${4:explanation of property purpose and usage}", + "type": "${5|string,integer,number,array,object,null|}" + } + } + } + } + } + ] + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3/bundled/outputs/resource/schema.json b/schemas/v3/bundled/outputs/resource/schema.json new file mode 100644 index 00000000..53c32d5f --- /dev/null +++ b/schemas/v3/bundled/outputs/resource/schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3/bundled/outputs/resource/schema.vscode.json b/schemas/v3/bundled/outputs/resource/schema.vscode.json new file mode 100644 index 00000000..53c32d5f --- /dev/null +++ b/schemas/v3/bundled/outputs/resource/schema.vscode.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3/bundled/outputs/resource/set.json b/schemas/v3/bundled/outputs/resource/set.json new file mode 100644 index 00000000..b88d4cd0 --- /dev/null +++ b/schemas/v3/bundled/outputs/resource/set.json @@ -0,0 +1,146 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json" + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } +} diff --git a/schemas/v3/bundled/outputs/resource/set.vscode.json b/schemas/v3/bundled/outputs/resource/set.vscode.json new file mode 100644 index 00000000..3cd37ab8 --- /dev/null +++ b/schemas/v3/bundled/outputs/resource/set.vscode.json @@ -0,0 +1,172 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json" + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3": { + "outputs": { + "resource": { + "set.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "set.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json" + } + } + }, + "set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json" + } + } + ] + } + } + }, + "metadata": { + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "Microsoft.DSC": { + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } + }, + "definitions": { + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3/bundled/outputs/resource/test.json b/schemas/v3/bundled/outputs/resource/test.json new file mode 100644 index 00000000..1cf74637 --- /dev/null +++ b/schemas/v3/bundled/outputs/resource/test.json @@ -0,0 +1,152 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json" + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json" + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json" + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } +} diff --git a/schemas/v3/bundled/outputs/resource/test.vscode.json b/schemas/v3/bundled/outputs/resource/test.vscode.json new file mode 100644 index 00000000..1340fd24 --- /dev/null +++ b/schemas/v3/bundled/outputs/resource/test.vscode.json @@ -0,0 +1,178 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json" + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3": { + "outputs": { + "resource": { + "test.simple.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } + }, + "test.full.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json" + } + } + }, + "test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json" + } + } + ] + } + } + }, + "metadata": { + "resourceInstanceResult.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } + }, + "Microsoft.DSC": { + "duration.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" + } + } + }, + "definitions": { + "instanceName.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserve-view=true#name\n" + }, + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3/bundled/outputs/schema.json b/schemas/v3/bundled/outputs/schema.json new file mode 100644 index 00000000..646a2f66 --- /dev/null +++ b/schemas/v3/bundled/outputs/schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3/bundled/outputs/schema.vscode.json b/schemas/v3/bundled/outputs/schema.vscode.json new file mode 100644 index 00000000..646a2f66 --- /dev/null +++ b/schemas/v3/bundled/outputs/schema.vscode.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", + "type": "object", + "$defs": {} +} diff --git a/schemas/v3/bundled/resource/manifest.json b/schemas/v3/bundled/resource/manifest.json new file mode 100644 index 00000000..60b17bd1 --- /dev/null +++ b/schemas/v3/bundled/resource/manifest.json @@ -0,0 +1,1126 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ] + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "get": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json" + }, + "set": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json" + }, + "delete": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json" + }, + "export": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json" + }, + "validate": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] + }, + "schema": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ], + "$defs": { + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources." + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource." + } + } + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": {}, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json" + } + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json" + } + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/purge.json" + } + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/rebootRequested.json" + } + } + } + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command." + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json", + "title": "Instance should exist", + "description": "Indicates whether the DSC Resource instance should exist.", + "type": "boolean", + "default": true, + "enum": [ + false, + true + ] + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json", + "title": "Instance is in the Desired State", + "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/purge.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/purge.json", + "title": "Purge", + "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", + "type": [ + "boolean", + "null" + ], + "writeOnly": true + }, + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/rebootRequested.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/rebootRequested.json", + "title": "Reboot Requested", + "description": "Indicates that the set operation requires a reboot before it's fully complete.", + "type": [ + "boolean", + "null" + ], + "readOnly": true + } + } +} diff --git a/schemas/v3/bundled/resource/manifest.vscode.json b/schemas/v3/bundled/resource/manifest.vscode.json new file mode 100644 index 00000000..0ac74950 --- /dev/null +++ b/schemas/v3/bundled/resource/manifest.vscode.json @@ -0,0 +1,1956 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the information DSC and integrating require to process and call a command-based DSC\nResource. For DSC to use a manifest on a system, the manifest file must:\n\n1. Be discoverable in the `PATH` environment variable.\n1. Follow the naming convention `.dsc.resource.json`.\n1. Be valid for this schema.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define a resource", + "markdownDescription": "Defines a standard resource that:\n\n- Can get the current state of an instance\n- Can set an instance to the desired state\n- Relies on DSC's synthetic testing to determine whether an instance is in the desired state\n- Defines an embedded JSON schema.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "set": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "implementsPretest": "^${11:false}", + "return": "${12:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (group)", + "markdownDescription": "Defines a group resource that expects a list of resource instances and operates on them.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "group", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${18|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${19:Resources}", + "description": "${20:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.resource.json" + } + }, + "${21:name}": { + "title": "${22:property title}", + "description": "${23:explanation of property purpose and usage}", + "type": "${24|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (adapter)", + "markdownDescription": "Defines an adapter resource that enables users to define non-command-based DSC Resources in\nthe configuration.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "adapter", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "test": { + "executable": "${8:executable name}", + "args": [ + "${9:argument}" + ], + "input": "${10:stdin}", + "return": "${12:state}" + }, + "set": { + "executable": "${13:executable name}", + "args": [ + "${14:argument}" + ], + "input": "${15:stdin}", + "implementsPretest": "^${16:false}", + "return": "${17:state}" + }, + "adapter": { + "config": "${18|full,sequence|}", + "list": { + "executable": "${19:executable name}", + "args": [ + "${20:argument}" + ] + } + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${23|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "resources": { + "title": "${24:Resources}", + "description": "${25:Defines a list of resource instances to process}", + "type": "array", + "items": { + "${escape_dollar:$}ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.resource.json" + } + }, + "${26:name}": { + "title": "${27:property title}", + "description": "${28:explanation of property purpose and usage}", + "type": "${29|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (importer)", + "markdownDescription": "Defines an importer resource that can resolve an external source to nested resource\ninstances.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "kind": "importer", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "resolve": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + }, + { + "label": " Define a resource (assertion-only)", + "markdownDescription": "Defines an assertion resource that can get the current state of an instance but not configure\nit. By default, the resource relies on DSC's synthetic testing feature. If the resource\nimplements the `test` operation itself, define the `test` property.", + "body": { + "${escape_dollar:$}schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "type": "${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\\.]dsc[\\.]resource/$1/}}", + "version": "${3:0.1.0}", + "description": "${4:Synopsis for the resource's purpose}", + "get": { + "executable": "${5:executable name}", + "args": [ + "${6:argument}" + ], + "input": "${7:stdin}" + }, + "schema": { + "embedded": { + "${escape_dollar:$}schema": "${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${14:name}": { + "title": "${15:property title}", + "description": "${16:explanation of property purpose and usage}", + "type": "${17|string,integer,number,array,object,null|}" + } + } + } + } + } + } + ], + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property must be one of the canonical URLs for the version of the Command-based DSC\nResource Manifest schema that the manifest is implemented for.\n\nFor every version of the schema, there are three valid urls:\n\n```yaml\n.../resource/manifest.json\n```\n\n> The URL to the canonical non-bundled schema. When it's used for validation, the validating\n> client needs to retrieve this schema and every schema it references.\n\n```yaml\n.../bundled/resource/manifest.json\n```\n\n> The URL to the bundled schema. When it's used for validation, the validating client only\n> needs to retrieve this schema.\n> \n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n\n```yaml\n.../bundled/resource/manifest.vscode.json\n```\n\n> The URL to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and snippets\n> that the others don't include.\n> \n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#schema\n", + "markdownEnumDescriptions": [ + "\n\n> #### `v3` non-bundled\n>\n> Indicates that the resource manifest adheres to the `v3` schema. This URL\n> points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `v3` bundled\n>\n> Indicates that the resource manifest adheres to the `v3` schema. This URL\n> points to the bundled schema. When it's used for validation, the validating client\n> only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `v3` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `v3` schema. This URL\n> points to the enhanced authoring schema. This schema is much larger than the other\n> schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/10` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/10` bundled\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3` of the schema.\n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/10` enhanced authoring\n>\n>Indicates that the resource manifest adheres to the `2023/10` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.5` and earlier.\n> Migrate to using the `v3` of the schema.\n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n", + "\n\n> #### `2023/08` non-bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the canonical non-bundled schema. When it's used for validation, the\n> validating client needs to retrieve this schema and every schema it references.\n", + "\n\n> #### `2023/08` bundled\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the bundled schema. When it's used for validation, the validating\n> client only needs to retrieve this schema.\n>\n> This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can\n> still validate the document when it uses this schema, other tools may error or behave\n> in unexpected ways.\n", + "\n\n> #### `2023/08` enhanced authoring\n>\n> Indicates that the resource manifest adheres to the `2023/08` schema. This version\n> is deprecated, and should only be used for compatibility with `alpha.3` and earlier.\n> Migrate to using the `v3` of the schema \n>\n> This URL points to the enhanced authoring schema. This schema is much larger than the\n> other schemas, as it includes additional definitions that provide contextual help and\n> snippets that the others don't include.\n>\n> This schema uses keywords that are only recognized by VS Code. While DSC can still\n> validate the document when it uses this schema, other tools may error or behave in\n> unexpected ways.\n" + ] + }, + "type": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe semantic version ([semver][02]) of the DSC Resource. This version identifies the DSC\nResource, not the version of the application it manages.\n\nThis value uses the [suggested regular expression][03] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#version\n[02]: https://semver.org/\n[03]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a short synopsis of the DSC Resource's purpose.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#description-1\n" + }, + "kind": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines a list of searchable terms for the resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#tags\n", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$", + "patternErrorMessage": "Invalid tag. Tags must be a string of alphanumeric characters and underscores. No other\ncharacters are permitted.\n" + } + }, + "get": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json" + }, + "set": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json" + }, + "delete": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json" + }, + "export": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json" + }, + "validate": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$", + "patternErrorMessage": "Invalid exit code. Must be a string representing a 32-bit signed integer.\n" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThis property defines a map of valid exit codes for the DSC Resource. DSC always interprets\nexit code `0` as a successful operation and any other exit code as an error. Use this\nproperty to indicate human-readable semantic meanings for the DSC Resource's exit codes.\n\nDefine the keys in this property as strings representing a valid 32-bit signed integer. You\ncan't use alternate formats for the exit code. For example, instead of the hexadecimal value\n`0x80070005` for \"Access denied\", specify the exit code as `-2147024891`. If you're authoring\nyour resource manifest in yaml, be sure to wrap the exit code in single quotes, like\n`'0': Success` instead of `0: Success` to ensure the YAML file can be parsed correctly.\n\nDefine the value for each key as a string explaining what the exit code indicates.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#exitcodes\n", + "defaultSnippets": [ + { + "label": " Defined exit codes", + "description": "Defines exit codes with semantic meaning for the resource.", + "body": { + "0": "Success", + "${1:first exit code number}": "${2:first exit code meaning}", + "${3:second exit code number}": "${4:second exit code meaning}" + } + } + ] + }, + "schema": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ], + "$defs": { + "PowerShell": { + "DSC": { + "main": { + "schemas": { + "v3": { + "definitions": { + "resourceType.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n", + "patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n" + }, + "semver.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "patternErrorMessage": "Invalid value, must be a semantic version like `..`, such as `1.2.3`.\n\nThe value may also include pre-release version information and build metadata.\n", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" + }, + "resourceKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the resource is a normal DSC Resource, a group resource, or an adapter\nresource. This property is only required for group resources.\n\nDSC infers the default value for this property based on whether the [adapter][02] property is\ndefined in the manifest:\n\n- If the `adapter` property is defined in the manifest, the default `kind` is `Adapter`.\n- If the `adapter` property is not defined in the manifest, the default `kind` is `Resource`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "markdownEnumDescriptions": [ + "\n\nIndicates that the manifest is for a standard command-based DSC Resource.\n", + "\n\nIndicates that the manifest is for an adapter resource that enables the use of\nnon-command-based resources with DSC.\n", + "\n\nIndicates that the manifest is for a group resource that processes an array of nested\nresource instances.\n", + "\n\nIndicates that the manifest is for an import resource that resolves an external source to DSC\nresource instances. The resolved instances are processed as nested instances for the import\nresource.\n" + ] + }, + "commandExecutable.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" + }, + "commandArgs.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "defaultSnippets": [ + { + "label": "String argument", + "markdownDescription": "Add a string argument to the command, like `config` or `--config`.", + "body": "${1:argument_name}" + }, + { + "label": "JSON input argument", + "markdownDescription": "Add a JSON input argument to the command. A command can only define one JSON input argument\nin the `args` list. When you define a JSON input argument, DSC passes the input data for\nthe command to the specified argument as a string representing the data as a compressed\nJSON object. The compressed JSON object doesn't have any spaces or newlines between the\nobject properties and values.\n\nIf the command doesn't define the `input` property, it must define a JSON input argument.\n\nIf the command defines both the `input` property and a JSON input argument, DSC sends the\ninput data to the command in both ways. For example, if the command defines `input` as\n`stdin` and has a JSON input argument in `args`, DSC sends the input data as a compressed\nJSON object over stdin and to the the specified argument.", + "body": { + "jsonInputArg": "${1:argument_name}", + "mandatory": "^$2" + } + } + ], + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command.", + "markdownDescription": "Any item in the argument array can be a string representing a static argument to pass to\nthe command.\n" + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "markdownDescription": "Defines an argument for the command that accepts the JSON input object as a string. DSC\npasses the JSON input to the named argument when available. You can define the `mandatory`\nproperty to indicate whether DSC should always pass the argument to the command, even when\nthere's no JSON input for the command. In that case, DSC passes an empty string to the\nJSON input argument. You can only define one JSON input argument per arguments array.\n\nIf you define a JSON input argument and an `input` kind for a command, DSC sends the JSON\ndata both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "markdownDescription": "Defines the argument that accepts the JSON property bag for the resource as input.\n", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "markdownDescription": "Defines whether the argument is mandatory. If this property is set to `true`, DSC\npasses an empty string when no JSON input is provided. The default value is `false`.\n", + "type": "boolean", + "default": false + } + } + } + ] + } + }, + "inputKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ], + "markdownEnumDescriptions": [ + "_Environment variables_\n\n> Indicates that the resource expects the properties of an instance to be specified as\n> environment variables with the same names and casing.\n>\n> This option only supports the following data types for instance properties:\n>\n> - `boolean`\n> - `integer`\n> - `number`\n> - `string`\n> - `array` of `integer` values\n> - `array` of `number` values\n> - `array` of `string` values\n>\n> For non-array values, DSC sets the environment variable to the specified value as-is. When\n> the data type is an array of values, DSC sets the environment variable as a comma-delimited\n> string. For example, the property `foo` with a value of `[1, 2, 3]` is saved in the `foo`\n> environment variable as `\"1,2,3\"`.\n>\n> If the resource needs to support complex properties with an `object` value or multi-type\n> arrays, set this to `stdin` instead.\n", + "_JSON over `stdin`_\n\n> Indicates that the resource expects a JSON blob representing an instance from `stdin`.\n> The JSON must adhere to the instance schema.\n" + ] + }, + "returnKind.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." + } + }, + "resource": { + "manifest.get.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of an instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"get\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property. When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"get\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config get --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `get` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `get` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/get?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `get` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `get` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `get` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.set.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to set the desired state of an instance and how to\nprocess the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set` command. Set this value to `true` if the DSC Resource tests input before modifying\nsystem state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set` command where the instance defines the `_exist` property as `false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's state after the set\noperation or the state and an array of the properties the DSC Resource modified.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's final state after the set\n> operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's final state and an array of property\n> names that the resource modified.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `set` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `set` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `set` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `set` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `set` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.whatIf.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to indicate whether and how the set command will\nmodify an instance and how to process the output from the DSC Resource. If a resource doesn't\ndefine this method in the manifest, DSC synthesizes this behavior by converting the result of\nthe test operation for the resource into the [set result][02].\n\nThis method definition has the same structure as the [set method][03] in the resource manifest.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/outputs/resource/set?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"set\", \"--what-if\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n \"--what-if\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --what-if --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#input\n" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set --what-if` command . Set this value to `true` if the DSC Resource tests input before\nprocessing how it will modify system state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#implementspretest\n" + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource has its own built-in handling for the [`_exist`][02] common\nproperty. Set this value to `true` if the DSC Resource handles instance deletion internally\nwhen receiving a `set --what-if` command where the instance defines the `_exist` property as\n`false`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#handlesExist\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's expected state after a\nset operation in what-if mode or the state and an array of the properties the DSC Resource\nwould modify.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Final state only_\n\n> Indicates that the resource returns only the instance's expected final state after the\n> set operation as a JSON blob.\n", + "_Final state and changed properties_\n\n> Indicates that the resource returns the instance's expected final state and an array of\n> property names that the resource would modify.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `whatIf` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `whatIf` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/whatif?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `whatIf` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `whatIf` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "implementsPretest": "^${2|true,false|}", + "return": "${3|state,stateAndDiff|}", + "executable": "${4:executable_name}", + "args": [ + "${5:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `whatIf` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "implementsPretest": "^${1|true,false|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + { + "jsonInputArg": "${4:argument_name}", + "mandatory": "^$5" + } + ] + } + } + ] + }, + "manifest.test.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to test if an instance is in the desired state and how\nto process the output from the DSC Resource.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"test\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"test\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config test --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#input\n" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the command returns a JSON blob of the DSC Resource's current state or the\nstate and an array of the properties that are out of the desired state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true#return\n", + "markdownEnumDescriptions": [ + "_Actual state only_\n\n> Indicates that the resource returns only the instance's actual state as a JSON blob.\n", + "_Actual state and differing properties_\n\n> Indicates that the resource returns the instance's actual state and an array of\n> property names that are out of the desired state.\n" + ] + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `test` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `test` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/test?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `test` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `test` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "return": "${2|state,stateAndDiff|}", + "executable": "${3:executable_name}", + "args": [ + "${4:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `test` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "return": "${1|state,stateAndDiff|}", + "executable": "${2:executable_name}", + "args": [ + { + "jsonInputArg": "${3:argument_name}", + "mandatory": "^$4" + } + ] + } + } + ] + }, + "manifest.delete.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to delete an instance. Define this method for\nresources as an alternative to handling the [`_exist`][02] property in a `set` operation, which\ncan lead to highly complex code. If the `set` method for the resource is able to handle deleting\nan instance when `_exist` is `false`, set the [`handlesExist`][03] property of the set method\ndefinition to `true` instead.\n\nIf you define the delete method in a resource manifest, ensure that you also define the\n[`_exist`][02] property in the [JSON schema for the resource's properties][04].\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#handlesExist\n[04]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"delete\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config delete\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"set\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config set --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `delete` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `delete` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/delete?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `delete` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `delete` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `delete` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.export.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the current state of every instance.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"export\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"export\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config export --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `export` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `export` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/export?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `export` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `export` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `export` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^3" + } + ] + } + } + ] + }, + "manifest.validate.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to validate the state of an instance. This method is\nmandatory for DSC Group Resources. It's ignored for all other DSC Resources.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"validate\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"validate\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config validate --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `validate` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `validate` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/validate?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `validate` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `validate` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `validate` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.resolve.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to resolve an external source to nested DSC\nConfiguration Document. Define this method for [importer resources][02] and set the [kind][03]\nproperty in the manifest root to `Import`.\n\nDSC sends data to the command in three ways:\n\n1. When `input` is `stdin`, DSC sends the data as a string representing the data as a compressed\n JSON object without spaces or newlines between the object properties.\n1. When `input` is `env`, DSC sends the data as environment variables. It creates an environment\n variable for each property in the input data object, using the name and value of the property.\n1. When the `args` array includes a JSON input argument definition, DSC sends the data as a string\n representing the data as a compressed JSON object to the specified argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't pass\nthe input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or\nboth.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true\n[02]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourceKind?view=dsc-3.0&preserve-view=true#importer-resources\n[03]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/root?view=dsc-3.0&preserve-view=true#kind\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"config\", \"resolve\"]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve\n```\n\nIf you want to pass the JSON object representing the property bag for a resource instance to\nan argument, you can define a single item in the array as a JSON object. Indicate the name of\nthe argument with the `jsonInputArg` string property and whether the argument is mandatory\nfor the command with the `mandatory` boolean property.` When the `mandatory` property is\ndefined as `true`, DSC passes an empty string to the argument when no JSON input is\navailable. When the `mandatory` property is undefined or defined as `false`, DSC doesn't pass\nthe argument at all when no JSON input is available. The default value for the `mandatory`\nproperty is `false`.\n\nFor example, given the following definition:\n\n```json\n{\n \"executable\": \"myresource\"\n \"args\": [\n \"config\",\n \"resolve\",\n { \"jsonInputArg\": \"--properties\" }\n ]\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource config resolve --properties \n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#args\n" + }, + "input": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as environment variables or JSON\nover `stdin`. This property is optional when you define an object in the `args` list. If\nyou define a JSON input argument and an `input`, DSC sends the JSON data both ways:\n\n- If you define `input` as `env` and a JSON input argument, DSC sets an environment variable\n for each property in the JSON input and passes the JSON input object as a string to the\n defined argument.\n- If you define `input` as `stdin` and a JSON input argument, DSC passes the JSON input over\n stdin and as a string to the defined argument.\n- If you define a JSON input argument without defining the `input` property, DSC only passes\n the JSON input as a string to the defined argument.\n\nIf you don't define the `input` property and don't define a JSON input argument, DSC can't\npass the input JSON to the resource. This makes the manifest invalid. You must define the\n`input` property, a JSON input argument in the `args` property array, or both.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true#input\n" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "errorMessage": "The `resolve` command doesn't define either the `input` property or a JSON input argument, or it defines more than one JSON input argument. If you don't define the `input` property and don't define a JSON input argument, DSC can't pass the input JSON to the resource. You can only define one JSON input argument for a command.\n\nYou must define the `input` property, one JSON input argument in the `args` property array, or both. For more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "errorMessage": "You can only specify one JSON input argument for the `resolve` command. Remove the extra JSON input argument. When you use the JSON input argument, DSC sends the full JSON object as a string to the named argument.\n\nFor more information, see:\n\nhttps://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/resolve?view=dsc-3.0&preserve-view=true", + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `resolve` command for the resource when no arguments are required and the JSON\ninput is sent over stdin or as environment variables.\n", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}" + } + }, + { + "label": " Define with string arguments", + "markdownDescription": "Define the `resolve` command for the resource when at least one argument is required and the\nJSON input is sent over stdin or as environment variables.", + "body": { + "input": "${1|stdin,env|}", + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + }, + { + "label": " Define with a JSON input argument", + "markdownDescription": "Define the `resolve` command for the resource where the JSON input is passed as a one-line\nJSON object string to the specified argument.", + "body": { + "executable": "${1:executable_name}", + "args": [ + { + "jsonInputArg": "${2:argument_name}", + "mandatory": "^$3" + } + ] + } + } + ] + }, + "manifest.adapter.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to\nmanage resources that don't have their own manifests with DSC.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#list\n", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"registry\",\n \"args\": [\"resources\", \"list\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nregistry resources list\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#args\n" + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the adapter expects to receive a full and unprocessed configuration as a\nsingle JSON blob over stdin or a sequence of JSON Lines for each child resource's\nconfigurations.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0&preserve-view=true#config\n", + "markdownEnumDescriptions": [ + "_Full and unprocessed config as a JSON blob_\n\n> Indicates that the adapter expects a JSON blob containing the full and unprocessed\n> configuration as a single JSON blob over `stdin`.\n", + "_Resource instances as JSON Lines_\n\n> Indicates that the adapter expects each resource's configuration as a [JSON Line][01]\n> over `stdin`.\n\n[01]: https://jsonlines.org/\n" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ], + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when no arguments are\nrequired.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}" + } + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the adapter config kind and `list` command for the resource when at least one\nargument is required.\n", + "body": { + "config": "${1|full,sequence}", + "list": { + "executable": "${2:executable_name}", + "args": [ + "${3:--first-argument}" + ] + } + } + } + ] + }, + "manifest.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "#/$defs/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the name of the command to run. The value must be the name of a command discoverable\nin the system's `PATH` environment variable or the full path to the command. A file extension\nis only required when the command isn't recognizable by the operating system as an\nexecutable.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#executable\n" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines an array of strings to pass as arguments to the command. DSC passes the arguments to\nthe command in the order they're specified.\n\nFor example, the given the following definition:\n\n```json\n{\n \"executable\": \"myresource\",\n \"args\": [\"schema\", \"show\"],\n}\n```\n\nDSC invokes the command for the resource as:\n\n```bash\nmyresource schema show\n```\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#args\n" + } + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob\nrepresenting an instance of the DSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "defaultSnippets": [ + { + "label": " Define without arguments", + "markdownDescription": "Define the `schema` command for the resource when no arguments are required.\n", + "body": { + "executable": "${1:executable_name}" + } + }, + { + "label": " Define with arguments", + "markdownDescription": "Define the `schema` command for the resource when at least one argument is required.\n", + "body": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + ] + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON Schema DSC must use to validate a JSON blob representing an instance of the\nDSC Resource.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the JSON type for an instance of the DSC Resource. DSC Resource instances always\nhave the `object` type. DSC only supports JSON Schema Draft 07 and later.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true#type\n", + "markdownEnumDescriptions": [ + "_Draft 2020-12 (recommended)_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2020-12][01].\n>\n> This is the latest published draft of JSON Schema and is the draft future drafts\n> will be most compatible with.\n\n[01]: https://json-schema.org/specification-links.html#2020-12\n", + "_Draft 2019-09_\n\n> Indicates that the resource instance schema adheres to\n> [JSON Schema Draft 2019-09][01].\n>\n> This is the previous published draft of JSON Schema. It's mostly compatible with\n> 2020-12, but less extensible and can't be bundled.\n\n[01]: https://json-schema.org/specification-links.html#draft-2019-09-formerly-known-as-draft-8\n", + "_Draft 07_\n\n> Indicates that the resource instance schema adheres to [JSON Schema Draft 07][01].\n>\n> This is an older published draft of JSON Schema. It's widely used, but incompatible\n> with 2019-09 and later. It's less expressive, extensible, maintainable, and isn't\n> recommended for new schema definitions.\n\n[01]: https://json-schema.org/specification-links.html#draft-7\n" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the unique ID for the DSC Resource's instance schema. If the instance schema is\npublished to its own public URI, set this keyword to that URI.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#id\n" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines the properties that DSC can retrieve and manage for the resource's instances.\nThis keyword must define at least one property as a key-value pair. The key is the\nproperty's name. The value is a subschema that validates the property.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#properties\n", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": { + "defaultSnippets": [ + { + "label": " Define a property", + "markdownDescription": "Define a new property for the resource instance schema.", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + }, + { + "label": " Define a property (boolean)", + "markdownDescription": "Define a new [boolean][01] property for the resource instance schema, requiring the\nvalue to be either `true` or `false`.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/boolean.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "boolean" + } + }, + { + "label": " Define a property (string)", + "markdownDescription": "Define a new [string][01] property for the resource instance schema, requiring the\nvalue to be a blob of text.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/string.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "string" + } + }, + { + "label": " Define a property (integer)", + "markdownDescription": "Define a new [integer][01] property for the resource instance schema, requiring the\nvalue to be a number without a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "integer" + } + }, + { + "label": " Define a property (number)", + "markdownDescription": "Define a new [number][01] property for the resource instance schema, requiring the\nvalue to be a number that may include a fractional part.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/numeric.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "number" + } + }, + { + "label": " Define a property (array)", + "markdownDescription": "Define a new [array][01] property for the resource instance schema, requiring the\nvalue to be a list of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/array.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "array", + "items": { + "type": "${3|boolean,string,integer,number,array,object,null|}" + } + } + }, + { + "label": " Define a property (object)", + "markdownDescription": "Define a new [object][01] property for the resource instance schema, requiring the\nvalue to be a set of key-value pairs.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/object.html", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "type": "object", + "properties": { + "${3:propertyName}": { + "title": "${4:propertyTitle}", + "description": "${5:explanation of property purpose and usage}", + "type": "${6|string,integer,number,array,object,null|}" + } + } + } + }, + { + "label": " Define a property (enum)", + "markdownDescription": "Define a new [enum][01] property for the resource instance schema that only accepts\na defined set of values.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "enum": [ + "^${3:\"first value\"}", + "^${4:\"second value\"}" + ] + } + }, + { + "label": " Define a property (const)", + "markdownDescription": "Define a new [const][01] property for the resource instance schema that only\naccepts a specific value.\n\n[01]: https://json-schema.org/understanding-json-schema/reference/generic.html#constant-values", + "body": { + "title": "${1:property title}", + "description": "${2:explanation of property purpose and usage}", + "const": "^${3:\"constant value\"}" + } + } + ] + }, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the resource can enforce whether instances exist, handling whether an\ninstance should be added, updated, or removed during a set operation. The default\nvalue is `true`.\n\nResources that define this property declare that the implementation adheres to the\nfollowing behavior contract:\n\n1. When the desired state for `_exist` is `true`, the resource expects the instance\n to exist. If it doesn't exist, the resource creates or adds the instance during\n the set operation.\n1. When the desired state for `_exist` is `false`, the resource expects the instance\n to not exist. If it does exist, the resource deletes or removes the instance\n during the set operation.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/exist?view=dsc-3.0&preserve-view=true\n" + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource returns this value for it's own `test` method. This\nproperty is mandatory when the manifest defines the `test` property. It shouldn't\nbe included if the DSC Resource relies on DSC's synthetic testing.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/indesiredstate?view=dsc-3.0&preserve-view=true\n" + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/purge.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_purge` property to specify\nwhether the DSC Resource should remove all non-specified members when it manages\nan array of members or values.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/purge?view=dsc-3.0&preserve-view=true\n" + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/rebootRequested.json" + }, + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nIndicates that the DSC Resource uses the standard `_rebootRequested` property to\nreport whether the machine should be rebooted after the `set` method executes.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/properties/rebootrequested?view=dsc-3.0&preserve-view=true\n" + } + }, + "defaultSnippets": [ + { + "label": " Define an instance property", + "markdownDescription": "Define a property for the resource instance schema.", + "body": { + "${1:propertyName}": { + "title": "${2:property title}", + "description": "${3:explanation of property purpose and usage}", + "type": "${4|string,integer,number,array,object,null|}" + } + } + } + ] + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ], + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC must validate a JSON blob representing an instance of the DSC Resource.\n\nThe JSON schema can be defined dynamically with the `command` property or statically with the\n`embedded` property.\n\nFor development purposes, it can be more convenient to use the `command` property and avoid\nneeding to adjust both the code and the schema.\n\nMicrosoft recommends using the `embedded` property when publishing a resource publicly. When the\nmanifest declares the schema with the `command` property, DSC calls the command at the beginning\nof any operation using the resource, possibly impacting performance. The schema is also\nunavailable to integrating tools when the resource isn't installed locally. When the schema is\nembedded in the manifest, DSC and integrating tools only need the manifest itself.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true\n", + "defaultSnippets": [ + { + "label": " Define as command without arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when no arguments are required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}" + } + } + }, + { + "label": " Define as command with arguments", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema as a command when at least one argument is required.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/property?view=dsc-3.0&preserve-view=true#command\n", + "body": { + "command": { + "executable": "${1:executable_name}", + "args": [ + "${2:--first-argument}" + ] + } + } + }, + { + "label": " Define as an embedded schema", + "markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefine the resource instance schema embedded in the manifest. This is the preferred option\nfor publicly published resources.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/schema/embedded?view=dsc-3.0&preserve-view=true\n", + "body": { + "embedded": { + "${escape_dollar:$}schema": "${1|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}", + "type": "object", + "properties": { + "${2:name}": { + "title": "${3:property title}", + "description": "${4:explanation of property purpose and usage}", + "type": "${5|string,integer,number,array,object,null|}" + } + } + } + } + } + ] + } + } + } + } + } + } + } + } +} diff --git a/schemas/v3/config/document.json b/schemas/v3/config/document.json new file mode 100644 index 00000000..afbf6fd0 --- /dev/null +++ b/schemas/v3/config/document.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json", + "title": "DSC Configuration Document schema", + "description": "Describes a valid DSC Configuration Document.", + "type": "object", + "required": [ + "$schema", + "resources" + ], + "properties": { + "$schema": { + "title": "Schema", + "description": "This property must be the canonical URL of the DSC Configuration Document schema that the document is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json" + ] + }, + "parameters": { + "title": "DSC Configuration document parameters", + "description": "Defines runtime options for the configuration. Users and integrating tools can override use the defined parameters to pass alternate values to the configuration.", + "type": "object", + "additionalProperties": { + "$ref": "/PowerShell/DSC/main/schemas/v3/config/document.parameter.json" + } + }, + "variables": { + "title": "Configuration variables", + "description": "Defines a set of reusable values for the configuration document. The names of this value's properties are the strings used to reference a variable's value.", + "type": "object" + }, + "resources": { + "title": "DSC Configuration document resources", + "description": "Defines a list of DSC Resource instances for the configuration to manage.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/config/document.resource.json" + } + }, + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/config/document.metadata.json" + } + } +} diff --git a/schemas/v3/config/document.metadata.json b/schemas/v3/config/document.metadata.json new file mode 100644 index 00000000..c1e1e8e4 --- /dev/null +++ b/schemas/v3/config/document.metadata.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.metadata.json", + "title": "Configuration metadata", + "description": "Defines a set of key-value pairs for the configuration. Except for the `Microsoft.DSC` property, this metadata isn't validated. You can pass any data into this property of a configuration document.", + "type": "object", + "properties": { + "Microsoft.DSC": { + "type": "object", + "title": "DSC metadata", + "description": "The `Microsoft.DSC` metadata property contains directives and information that DSC itself uses when processing a configuration document. Unlike other metadata key-value pairs, DSC validates these properties.", + "unevaluatedProperties": false, + "properties": { + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "default": "Current", + "description": "This property defines the security context a configuration requires. If you invoke a DSC operation against the configuration document in a security context that conflicts with this metadata, DSC raises an error when it validates the configuration document.\nThe default security context is `Current`." + } + } + } + } +} diff --git a/schemas/v3/config/document.parameter.json b/schemas/v3/config/document.parameter.json new file mode 100644 index 00000000..735b1395 --- /dev/null +++ b/schemas/v3/config/document.parameter.json @@ -0,0 +1,228 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.parameter.json", + "title": "Parameter", + "description": "Defines a runtime option for a DSC Configuration Document.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/parameters/dataTypes.json" + }, + "defaultValue": { + "title": "Default value", + "description": "Defines the default value for the parameter.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/parameters/validValueTypes.json" + }, + "allowedValues": { + "title": "Allowed values", + "description": "Defines a list of valid values for the parameter. If the parameter is defined with any other values, it's invalid.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/parameters/validValueTypes.json" + } + }, + "description": { + "title": "Parameter description", + "description": "Defines a synopsis for the parameter explaining its purpose.", + "type": "string" + }, + "metadata": { + "title": "Parameter metadata", + "description": "Defines a set of key-value pairs for the parameter. This metadata isn't validated.", + "type": "object" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "minValue": { + "title": "Minimum value", + "description": "The minimum valid value for an integer type. If defined with the `maxValue` property, this value must be less than the value of `maxValue`.", + "type": "integer" + }, + "maxValue": { + "title": "Maximum value", + "description": "The maximum valid value for an integer type. If defined with the `minValue` property, this value must be greater than the value of `minValue`.", + "type": "integer" + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + }, + { + "properties": { + "type": { + "const": "array" + } + } + } + ] + }, + "then": { + "properties": { + "minLength": { + "title": "Minimum length", + "description": "The minimum valid length for a `string`, `secureString`, or `array`. If defined with the `maxLength` property, this value must be less than the value of `maxLength`.", + "type": "integer", + "minimum": 0 + }, + "maxLength": { + "title": "Maximum length", + "description": "The maximum valid length for a `string`, `secureString`, or `array`. If defined with the `minLength` property, this value must be less than the value of `minLength`.", + "type": "integer", + "minimum": 0 + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + } + } + }, + { + "properties": { + "type": { + "const": "secureString" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "string" + }, + "allowedValues": { + "items": { + "type": "string" + } + } + } + } + }, + { + "if": { + "oneOf": [ + { + "properties": { + "type": { + "const": "object" + } + } + }, + { + "properties": { + "type": { + "const": "secureObject" + } + } + } + ] + }, + "then": { + "properties": { + "defaultValue": { + "type": "object" + }, + "allowedValues": { + "items": { + "type": "object" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "int" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "integer" + }, + "allowedValues": { + "items": { + "type": "integer" + } + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "array" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "bool" + } + } + }, + "then": { + "properties": { + "defaultValue": { + "type": "boolean" + }, + "allowedValues": { + "items": { + "type": "boolean" + } + } + } + } + } + ] +} diff --git a/schemas/v3/config/document.resource.json b/schemas/v3/config/document.resource.json new file mode 100644 index 00000000..70f55e64 --- /dev/null +++ b/schemas/v3/config/document.resource.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.resource.json", + "title": "DSC Resource instance", + "description": "Defines an instance of a DSC Resource in a configuration.", + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "dependsOn": { + "title": "Instance depends on", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", + "type": "array", + "items": { + "type": "string", + "uniqueItems": true, + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$" + } + }, + "properties": { + "title": "Managed instance properties", + "description": "Defines the properties of the DSC Resource this instance manages. This property's value must be an object. DSC validates the property's value against the DSC Resource's schema.", + "type": "object" + } + } +} diff --git a/schemas/v3/definitions/commandArgs.json b/schemas/v3/definitions/commandArgs.json new file mode 100644 index 00000000..a79595bb --- /dev/null +++ b/schemas/v3/definitions/commandArgs.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json", + "title": "Executable Command Arguments", + "description": "The list of arguments to pass to the command. The arguments can be any number of strings. If you want to pass the JSON object representing the property bag for the resource to an argument, you can define a single item in the array as a JSON object, indicating the name of the argument with the `jsonInputArg` string property and whether the argument is mandatory for the command with the `mandatory` boolean property.", + "type": "array", + "items": { + "oneOf": [ + { + "type": "string", + "title": "String argument", + "description": "Any item in the argument array can be a string representing a static argument to pass to the command." + }, + { + "type": "object", + "title": "JSON input argument", + "description": "Defines an argument for the command that accepts the JSON input object as a string. DSC passes the JSON input to the named argument when available. You can define the `mandatory` property to indicate whether DSC should always pass the argument to the command, even when there's no JSON input for the command. In that case, DSC passes an empty string to the JSON input argument. You can only define one JSON input argument per arguments array.", + "required": [ + "jsonInputArg" + ], + "unevaluatedProperties": false, + "properties": { + "jsonInputArg": { + "title": "JSON input argument name", + "description": "Defines the argument that accepts the JSON property bag for the resource as input.", + "type": "string" + }, + "mandatory": { + "title": "Mandatory argument", + "description": "Defines whether the argument is mandatory. If this property is set to `true`, DSC passes an empty string when no JSON input is provided. The default value is `false`.", + "type": "boolean", + "default": false + } + } + } + ] + } +} diff --git a/schemas/v3/definitions/commandExecutable.json b/schemas/v3/definitions/commandExecutable.json new file mode 100644 index 00000000..d0c42ae6 --- /dev/null +++ b/schemas/v3/definitions/commandExecutable.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json", + "title": "Executable Command Name", + "description": "The name of the command to run.", + "type": "string" +} diff --git a/schemas/v3/definitions/hadErrors.json b/schemas/v3/definitions/hadErrors.json new file mode 100644 index 00000000..5ec59b4a --- /dev/null +++ b/schemas/v3/definitions/hadErrors.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json", + "title": "Had Errors", + "description": "Indicates whether any of the DSC Resources returned a non-zero exit code.", + "type": "boolean" +} diff --git a/schemas/v3/definitions/inputKind.json b/schemas/v3/definitions/inputKind.json new file mode 100644 index 00000000..5a8add38 --- /dev/null +++ b/schemas/v3/definitions/inputKind.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json", + "title": "Executable Command Input Type", + "description": "Defines how DSC should pass input to the command, either as environment variables or JSON over stdin. When this value isn't defined, DSC doesn't send the resource any input.", + "type": "string", + "enum": [ + "env", + "stdin" + ] +} diff --git a/schemas/v3/definitions/instanceName.json b/schemas/v3/definitions/instanceName.json new file mode 100644 index 00000000..93bd80fa --- /dev/null +++ b/schemas/v3/definitions/instanceName.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json", + "title": "Instance name", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 +} diff --git a/schemas/v3/definitions/message.json b/schemas/v3/definitions/message.json new file mode 100644 index 00000000..2f8c640a --- /dev/null +++ b/schemas/v3/definitions/message.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/message.json", + "title": "Message", + "description": "A message emitted by a DSC Resource with associated metadata.", + "type": "object", + "required": [ + "name", + "type", + "message", + "level" + ], + "properties": { + "name": { + "title": "Message source instance name", + "description": "The short, human-readable name for the instance that emitted the message, as defined in the DSC Configuration Document.", + "type": "string" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "message": { + "title": "Message content", + "description": "The actual content of the message as emitted by the DSC Resource.", + "type": "string", + "minLength": 1 + }, + "level": { + "title": "Message level", + "description": "Indicates the severity of the message.", + "type": "string", + "enum": [ + "error", + "warning", + "information" + ] + } + } +} diff --git a/schemas/v3/definitions/messages.json b/schemas/v3/definitions/messages.json new file mode 100644 index 00000000..8158a2b5 --- /dev/null +++ b/schemas/v3/definitions/messages.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/messages.json", + "title": "Messages", + "description": "A list of structured messages emitted by the DSC Resources during an operation.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/message.json" + } +} diff --git a/schemas/v3/definitions/parameters/dataTypes.json b/schemas/v3/definitions/parameters/dataTypes.json new file mode 100644 index 00000000..298ecee1 --- /dev/null +++ b/schemas/v3/definitions/parameters/dataTypes.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/parameters/dataTypes.json", + "title": "Data Types", + "description": "Defines the data type for the parameter value.", + "type": "string", + "enum": [ + "string", + "secureString", + "int", + "bool", + "object", + "secureObject", + "array" + ] +} diff --git a/schemas/v3/definitions/parameters/validValueTypes.json b/schemas/v3/definitions/parameters/validValueTypes.json new file mode 100644 index 00000000..e88ab9cc --- /dev/null +++ b/schemas/v3/definitions/parameters/validValueTypes.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/parameters/validValueTypes.json", + "$comment": "This schema fragment makes it a little easier to compose the valid properties\nfor DSC Configuration document parameters. As-written, values must be one of\nthose on this list - the schema definition for dataType excludes `null` and\nnumbers with fractional parts, like `3.5`.\n", + "type": [ + "string", + "integer", + "object", + "array", + "boolean" + ] +} diff --git a/schemas/v3/definitions/resourceKind.json b/schemas/v3/definitions/resourceKind.json new file mode 100644 index 00000000..c74d4690 --- /dev/null +++ b/schemas/v3/definitions/resourceKind.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json", + "title": "Resource kind", + "description": "Defines whether the resource is a normal DSC Resource, a group resource, or an adapter resource. This property is only required for group resources.", + "type": "string", + "enum": [ + "Resource", + "Adapter", + "Group", + "Import" + ] +} diff --git a/schemas/v3/definitions/resourceType.json b/schemas/v3/definitions/resourceType.json new file mode 100644 index 00000000..e121ab46 --- /dev/null +++ b/schemas/v3/definitions/resourceType.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json", + "title": "DSC Resource fully qualified type name", + "description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n", + "type": "string", + "pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$" +} diff --git a/schemas/v3/definitions/returnKind.json b/schemas/v3/definitions/returnKind.json new file mode 100644 index 00000000..dacfc126 --- /dev/null +++ b/schemas/v3/definitions/returnKind.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json", + "title": "Return Kind", + "type": "string", + "enum": [ + "state", + "stateAndDiff" + ], + "default": "state", + "$comment": "While the enumeration for return kind is the same for the `set` and `test`\nmethod, the way it changes the behavior of the command isn't. The description\nkeyword isn't included here because the respective schemas for those methods\ndocument the behavior themselves." +} diff --git a/schemas/v3/definitions/semver.json b/schemas/v3/definitions/semver.json new file mode 100644 index 00000000..9d985653 --- /dev/null +++ b/schemas/v3/definitions/semver.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/definitions/semver.json", + "type": "string", + "title": "Semantic Version", + "description": "A valid semantic version (semver) string.\n\nFor reference, see https://semver.org/\n", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "$comment": "A valid semantic version ([semver][01]) string.\n\nThis value uses the [suggested regular expression][02] to validate whether the string is valid\nsemver. This is the same pattern, made multi-line for easier readability:\n\n```regex\n^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\n(?:-(\n (?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)\n (?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))\n*))?\n(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$\n```\n\nThe first line matches the `major.minor.patch` components of the version. The middle lines match\nthe pre-release components. The last line matches the build metadata component.\n\n[01]: https://semver.org/\n[02]: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n" +} diff --git a/schemas/v3/metadata/Microsoft.DSC/context.json b/schemas/v3/metadata/Microsoft.DSC/context.json new file mode 100644 index 00000000..4cd05fd9 --- /dev/null +++ b/schemas/v3/metadata/Microsoft.DSC/context.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json", + "title": "Operation context", + "description": "Defines whether the operation was for a configuration or a resource. If the value for this metadata property is `configuration`, DSC was run through the `dsc config` command. If the value is `resource`, DSC was run with the `dsc resource` command.", + "type": "string", + "enum": [ + "resource", + "configuration" + ] +} diff --git a/schemas/v3/metadata/Microsoft.DSC/duration.json b/schemas/v3/metadata/Microsoft.DSC/duration.json new file mode 100644 index 00000000..5b24f9cf --- /dev/null +++ b/schemas/v3/metadata/Microsoft.DSC/duration.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json", + "title": "Duration", + "description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A", + "type": "string", + "format": "duration" +} diff --git a/schemas/v3/metadata/Microsoft.DSC/endDatetime.json b/schemas/v3/metadata/Microsoft.DSC/endDatetime.json new file mode 100644 index 00000000..3821665b --- /dev/null +++ b/schemas/v3/metadata/Microsoft.DSC/endDatetime.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json", + "title": "Start date and time", + "description": "Defines the end date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" +} diff --git a/schemas/v3/metadata/Microsoft.DSC/executionType.json b/schemas/v3/metadata/Microsoft.DSC/executionType.json new file mode 100644 index 00000000..fb597317 --- /dev/null +++ b/schemas/v3/metadata/Microsoft.DSC/executionType.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json", + "title": "Execution type", + "description": "Defines whether DSC actually applied an operation to the configuration or was run in `WhatIf` mode. This property is always `Actual` for `Get`, `Test`, and `Export` operations. For `Set` operations, this value is `WhatIf` when DSC is invoked with the `--whatIf` argument.", + "type": "string", + "enum": [ + "actual", + "whatIf" + ] +} diff --git a/schemas/v3/metadata/Microsoft.DSC/operation.json b/schemas/v3/metadata/Microsoft.DSC/operation.json new file mode 100644 index 00000000..2494a4af --- /dev/null +++ b/schemas/v3/metadata/Microsoft.DSC/operation.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json", + "title": "Operation", + "description": "Defines the operation that DSC applied to the configuration document: `Get`, `Set`, `Test`, or `Export`.", + "type": "string", + "enum": [ + "get", + "set", + "test", + "export" + ] +} diff --git a/schemas/v3/metadata/Microsoft.DSC/securityContext.json b/schemas/v3/metadata/Microsoft.DSC/securityContext.json new file mode 100644 index 00000000..f2316219 --- /dev/null +++ b/schemas/v3/metadata/Microsoft.DSC/securityContext.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json", + "title": "Security context", + "description": "Defines the security context that DSC was run under. If the value for this metadata property is `elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in a non-elevated session.", + "type": "string", + "enum": [ + "current", + "elevated", + "restricted" + ] +} diff --git a/schemas/v3/metadata/Microsoft.DSC/startDatetime.json b/schemas/v3/metadata/Microsoft.DSC/startDatetime.json new file mode 100644 index 00000000..d7f0785c --- /dev/null +++ b/schemas/v3/metadata/Microsoft.DSC/startDatetime.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json", + "title": "Start date and time", + "description": "Defines the start date and time for the DSC operation as a timestamp following the format defined in RFC3339, section 5.6 as `date-time`, like `2024-04-14T08:49:51.395686600-07:00`.", + "type": "string", + "format": "date-time" +} diff --git a/schemas/v3/metadata/Microsoft.DSC/version.json b/schemas/v3/metadata/Microsoft.DSC/version.json new file mode 100644 index 00000000..1877f191 --- /dev/null +++ b/schemas/v3/metadata/Microsoft.DSC/version.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json", + "title": "DSC Version", + "description": "Defines the version of DSC that ran the command. This value is always the semantic version of the DSC command, like `3.0.0-preview.7`.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/semver.json" +} diff --git a/schemas/v3/metadata/configurationDocumentResult.json b/schemas/v3/metadata/configurationDocumentResult.json new file mode 100644 index 00000000..adacb09a --- /dev/null +++ b/schemas/v3/metadata/configurationDocumentResult.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json", + "title": "Configuration result metadata", + "description": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of a DSC operation, including the version of DSC used, when the operation started and ended, and the security context the operation was invoked under.", + "type": "object", + "required": [ + "version", + "operation", + "executionType", + "startDatetime", + "endDatetime", + "duration", + "securityContext", + "context" + ], + "properties": { + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/version.json" + }, + "operation": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/operation.json" + }, + "executionType": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/executionType.json" + }, + "startDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/startDatetime.json" + }, + "endDatetime": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/endDatetime.json" + }, + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + }, + "securityContext": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/securityContext.json" + }, + "context": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/context.json" + } + } + } + } +} diff --git a/schemas/v3/metadata/resourceInstanceResult.json b/schemas/v3/metadata/resourceInstanceResult.json new file mode 100644 index 00000000..947f3b14 --- /dev/null +++ b/schemas/v3/metadata/resourceInstanceResult.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json", + "title": "Resource instance result metadata", + "description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.", + "type": "object", + "required": [ + "Microsoft.DSC" + ], + "properties": { + "Microsoft.DSC": { + "title": "DSC context metadata", + "description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.", + "type": "object", + "required": [ + "duration" + ], + "properties": { + "duration": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/Microsoft.DSC/duration.json" + } + } + } + } +} diff --git a/schemas/v3/outputs/config/get.json b/schemas/v3/outputs/config/get.json new file mode 100644 index 00000000..e0a017d1 --- /dev/null +++ b/schemas/v3/outputs/config/get.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/get.json", + "title": "DSC Configuration get command result", + "description": "Represents the data structure returned by the `dsc config get` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `get` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json" + } + } +} diff --git a/schemas/v3/outputs/config/set.json b/schemas/v3/outputs/config/set.json new file mode 100644 index 00000000..93b545b2 --- /dev/null +++ b/schemas/v3/outputs/config/set.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/set.json", + "title": "DSC Configuration set command result", + "description": "Represents the data structure returned by the `dsc config set` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `set` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json" + } + } +} diff --git a/schemas/v3/outputs/config/test.json b/schemas/v3/outputs/config/test.json new file mode 100644 index 00000000..556d1a0f --- /dev/null +++ b/schemas/v3/outputs/config/test.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/test.json", + "title": "DSC Configuration test command result", + "description": "Represents the data structure returned by the `dsc config test` command.", + "type": "object", + "required": [ + "metadata", + "results", + "messages", + "hadErrors" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/configurationDocumentResult.json" + }, + "results": { + "title": "Results", + "description": "The results of the `test` method for every DSC Resource instance in the DSC Configuration Document with the instance's name and type.", + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json" + } + }, + "messages": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/messages.json" + }, + "hadErrors": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/hadErrors.json" + } + } +} diff --git a/schemas/v3/outputs/resource/get.full.json b/schemas/v3/outputs/resource/get.full.json new file mode 100644 index 00000000..82dfd0c6 --- /dev/null +++ b/schemas/v3/outputs/resource/get.full.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json", + "title": "dsc resource get result (full)", + "description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json" + } + } +} diff --git a/schemas/v3/outputs/resource/get.json b/schemas/v3/outputs/resource/get.json new file mode 100644 index 00000000..0d4ea6c9 --- /dev/null +++ b/schemas/v3/outputs/resource/get.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json", + "title": "dsc resource get result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/get.full.json" + } + } + ] +} diff --git a/schemas/v3/outputs/resource/get.simple.json b/schemas/v3/outputs/resource/get.simple.json new file mode 100644 index 00000000..dc936104 --- /dev/null +++ b/schemas/v3/outputs/resource/get.simple.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.simple.json", + "title": "dsc resource get result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "actualState" + ], + "properties": { + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + } + } +} diff --git a/schemas/v3/outputs/resource/list.json b/schemas/v3/outputs/resource/list.json new file mode 100644 index 00000000..62a2ad81 --- /dev/null +++ b/schemas/v3/outputs/resource/list.json @@ -0,0 +1,112 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/list.json", + "title": "dsc resource list result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource list` command.", + "type": "object", + "properties": { + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json" + }, + "version": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "capabilities": { + "title": "Resource capabilities", + "description": "Defines the list of DSC operations the resource is compatible with. If the resource doesn't list a given operation, like `set` or `export`, the resource can't be used for those operations. The exception to this is `test` - DSC uses synthetic testing for resources that don't have the `test` capability.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "get", + "set", + "setHandlesExist", + "whatIf", + "test", + "delete", + "export", + "resolve" + ] + } + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "path": { + "title": "Path", + "description": "Indicates the path to the DSC Resource on the file system.", + "type": "string" + }, + "directory": { + "title": "Directory", + "description": "Indicates the path to the folder containing the DSC Resource on the file system.", + "type": "string" + }, + "implementedAs": { + "title": "Implemented as", + "description": "Indicates how the DSC Resource was implemented.", + "oneOf": [ + { + "title": "Standard implementation", + "description": "Indicates that the DSC Resource is implemented as one of the standard implementations built into DSC.", + "type": "string", + "enum": [ + "command" + ] + }, + { + "title": "Custom implementation", + "description": "Indicates that the DSC Resource uses a custom implementation.", + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "title": "Custom implementation name", + "description": "The name of the custom implementation.", + "type": "string" + } + } + } + ] + }, + "author": { + "title": "Author", + "description": "Indicates the name of the person or organization that developed and maintains the DSC Resource.", + "type": [ + "string", + "null" + ] + }, + "properties": { + "title": "Properties", + "description": "Defines the DSC Resource's property names.", + "type": "array", + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "requireAdapter": { + "title": "Required DSC Resource Adapter", + "description": "Defines the fully qualified type name of the DSC Resource Adapter the DSC Resource depends on.", + "oneOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + { + "type": "null" + } + ] + }, + "manifest": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.json" + } + } +} diff --git a/schemas/v3/outputs/resource/schema.json b/schemas/v3/outputs/resource/schema.json new file mode 100644 index 00000000..5d250efe --- /dev/null +++ b/schemas/v3/outputs/resource/schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc resource schema` command. This command always returns the DSC Resource's JSON schema document.", + "type": "object" +} diff --git a/schemas/v3/outputs/resource/set.full.json b/schemas/v3/outputs/resource/set.full.json new file mode 100644 index 00000000..017b9ad1 --- /dev/null +++ b/schemas/v3/outputs/resource/set.full.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json", + "title": "dsc resource set result (full)", + "description": "Describes the return data for the full result of the `set` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config set` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource set` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json" + } + } +} diff --git a/schemas/v3/outputs/resource/set.json b/schemas/v3/outputs/resource/set.json new file mode 100644 index 00000000..1265c40d --- /dev/null +++ b/schemas/v3/outputs/resource/set.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json", + "title": "dsc resource set result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. The return data is either a single object that describes the enforced state of a non-nested instance or an array of objects that describe the enforced state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/set.full.json" + } + } + ] +} diff --git a/schemas/v3/outputs/resource/set.simple.json b/schemas/v3/outputs/resource/set.simple.json new file mode 100644 index 00000000..68258491 --- /dev/null +++ b/schemas/v3/outputs/resource/set.simple.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.simple.json", + "title": "dsc resource set result (simple)", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource set` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource set` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "beforeState", + "afterState", + "changedProperties" + ], + "properties": { + "beforeState": { + "title": "State before enforcing", + "description": "This property always represents the desired state of the DSC Resource instance before the `set` method runs. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "afterState": { + "title": "State after enforcing", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `set` method after enforcing the desired state. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "changedProperties": { + "title": "Changed properties", + "description": "This property always represents the list of property names for the DSC Resource instance that the `set` method modified. When this value is an empty array, the `set` method didn't enforce any properties for the instance.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } +} diff --git a/schemas/v3/outputs/resource/test.full.json b/schemas/v3/outputs/resource/test.full.json new file mode 100644 index 00000000..44eaff1f --- /dev/null +++ b/schemas/v3/outputs/resource/test.full.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json", + "title": "dsc resource test result (full)", + "description": "Describes the return data for the full result of the `test` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config test` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource test` command.", + "type": "object", + "required": [ + "metadata", + "name", + "result", + "type" + ], + "properties": { + "metadata": { + "$ref": "/PowerShell/DSC/main/schemas/v3/metadata/resourceInstanceResult.json" + }, + "name": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/instanceName.json" + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "result": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json" + } + } +} diff --git a/schemas/v3/outputs/resource/test.json b/schemas/v3/outputs/resource/test.json new file mode 100644 index 00000000..b440717c --- /dev/null +++ b/schemas/v3/outputs/resource/test.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json", + "title": "dsc resource test result", + "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the tested state of a non-nested instance or an array of objects that describe the tested state of the nested instances for a group or adapter resource.", + "anyOf": [ + { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json" + }, + { + "type": "array", + "items": { + "$ref": "/PowerShell/DSC/main/schemas/v3/outputs/resource/test.full.json" + } + } + ] +} diff --git a/schemas/v3/outputs/resource/test.simple.json b/schemas/v3/outputs/resource/test.simple.json new file mode 100644 index 00000000..d3caeb5e --- /dev/null +++ b/schemas/v3/outputs/resource/test.simple.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.simple.json", + "title": "dsc resource test result (simple)", + "description": "Describes the return data for a single DSC Resource instance from the `dsc resource test` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource test` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.", + "type": "object", + "required": [ + "desiredState", + "actualState", + "inDesiredState", + "differingProperties" + ], + "properties": { + "desiredState": { + "title": "Desired state", + "description": "This property always represents the desired state of the DSC Resource instance as specified to DSC.", + "type": "object" + }, + "actualState": { + "title": "Actual state", + "description": "This property always represents the current state of the DSC Resource instance as returned by its `test` method or, if the DSC Resource doesn't define the `test` method, by its `get` method. DSC validates this return value against the DSC Resource's schema.", + "type": "object" + }, + "inDesiredState": { + "title": "Instance is in the desired state", + "description": "This property indicates whether the instance is in the desired state.", + "type": "boolean" + }, + "differingProperties": { + "title": "Differing properties", + "description": "This property always represents the list of property names for the DSC Resource instance that aren't in the desired state. When this property is an empty array, the instance is in the desired state.", + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + } +} diff --git a/schemas/v3/outputs/schema.json b/schemas/v3/outputs/schema.json new file mode 100644 index 00000000..f55c29c0 --- /dev/null +++ b/schemas/v3/outputs/schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/schema.json", + "title": "DSC Resource schema result", + "description": "Describes the return data for a DSC Resource from the `dsc schema` command. This command always returns a JSON schema document.", + "type": "object" +} diff --git a/schemas/v3/resource/manifest.adapter.json b/schemas/v3/resource/manifest.adapter.json new file mode 100644 index 00000000..fdc8af29 --- /dev/null +++ b/schemas/v3/resource/manifest.adapter.json @@ -0,0 +1,58 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json", + "title": "Adapter", + "description": "Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC.", + "type": "object", + "required": [ + "list", + "config" + ], + "properties": { + "list": { + "title": "List Command", + "description": "Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the list of supported DSC Resources." + } + } + }, + "config": { + "title": "Expected Configuration", + "description": "Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations.", + "type": "string", + "enum": [ + "full", + "sequence" + ] + } + }, + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } + } + ] +} diff --git a/schemas/v3/resource/manifest.delete.json b/schemas/v3/resource/manifest.delete.json new file mode 100644 index 00000000..c33e546c --- /dev/null +++ b/schemas/v3/resource/manifest.delete.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json", + "title": "Delete method", + "description": "Defines how DSC must call the DSC Resource to delete an instance. Define this method for resources as an alternative to handling the `_exist` property in a `set` operation, which can lead to highly complex code. If the `set` operation for the resource is able to handle deleting an instance when `_exist` is `false`, set the `handlesExist` property of the set method definition to `true` instead.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3/resource/manifest.export.json b/schemas/v3/resource/manifest.export.json new file mode 100644 index 00000000..01f16deb --- /dev/null +++ b/schemas/v3/resource/manifest.export.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json", + "title": "Export Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3/resource/manifest.get.json b/schemas/v3/resource/manifest.get.json new file mode 100644 index 00000000..89776e76 --- /dev/null +++ b/schemas/v3/resource/manifest.get.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json", + "title": "Get Method", + "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3/resource/manifest.json b/schemas/v3/resource/manifest.json new file mode 100644 index 00000000..bc3ab89c --- /dev/null +++ b/schemas/v3/resource/manifest.json @@ -0,0 +1,155 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json", + "title": "Command-based DSC Resource Manifest", + "description": "Defines the information DSC and integrating require to process and call a command-based DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "version" + ], + "properties": { + "$schema": { + "title": "Manifest Schema", + "description": "This property must be the canonical URL of the Command-based DSC Resource Manifest schema that the manifest is implemented for.", + "type": "string", + "format": "uri", + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json" + ] + }, + "type": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceType.json" + }, + "version": { + "title": "Resource Semantic Version", + "description": "The semantic version (semver) of the DSC Resource. This version identifies the DSC Resource, not the version of the application it manages.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/semver.json" + }, + "description": { + "title": "Resource Description", + "description": "A short synopsis of the DSC Resource's purpose.", + "type": "string" + }, + "kind": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/resourceKind.json" + }, + "tags": { + "title": "Tags", + "description": "Defines a list of searchable terms for the resource.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\w+$" + } + }, + "get": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.get.json" + }, + "set": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json" + }, + "whatIf": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json" + }, + "test": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json" + }, + "delete": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.delete.json" + }, + "export": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.export.json" + }, + "validate": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json" + }, + "resolve": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json" + }, + "adapter": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.adapter.json" + }, + "exitCodes": { + "title": "Exit Codes", + "description": "This property defines a map of valid exit codes for the DSC Resource. DSC always interprets exit code `0` as a successful operation and any other exit code as an error. Use this property to indicate human-readable semantic meanings for the DSC Resource's exit codes.", + "type": "object", + "propertyNames": { + "pattern": "^-?[0-9]+$" + }, + "patternProperties": { + "^-?[0-9]+$": { + "type": "string" + } + }, + "unevaluatedProperties": false, + "default": { + "0": "Success", + "1": "Error" + }, + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] + }, + "schema": { + "$ref": "/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json" + } + }, + "allOf": [ + { + "if": { + "properties": { + "kind": { + "const": "adapter" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "adapter" + ] + } + }, + { + "if": { + "properties": { + "kind": { + "const": "importer" + } + }, + "required": [ + "kind" + ] + }, + "then": { + "required": [ + "resolve" + ] + }, + "else": { + "required": [ + "get" + ] + } + } + ] +} diff --git a/schemas/v3/resource/manifest.resolve.json b/schemas/v3/resource/manifest.resolve.json new file mode 100644 index 00000000..f574a2fb --- /dev/null +++ b/schemas/v3/resource/manifest.resolve.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.resolve.json", + "title": "Resolve method", + "description": "Defines how DSC must call the DSC Resource to resolve a nested configuration document from an external source. Define this method for importer resources where the resource kind is set to `Import`.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3/resource/manifest.schema.json b/schemas/v3/resource/manifest.schema.json new file mode 100644 index 00000000..142d7fb2 --- /dev/null +++ b/schemas/v3/resource/manifest.schema.json @@ -0,0 +1,195 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.schema.json", + "title": "Instance Schema", + "description": "Defines how DSC must validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "oneOf": [ + { + "required": [ + "command" + ] + }, + { + "required": [ + "embedded" + ] + } + ], + "properties": { + "command": { + "title": "Instance Schema Command", + "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Command arguments", + "description": "Defines the list of arguments to pass to the command to return the JSON Schema for the resource." + } + } + }, + "embedded": { + "title": "Embedded Instance Schema", + "description": "Defines the JSON Schema DSC must use to validate a JSON blob representing an instance of the DSC Resource.", + "type": "object", + "required": [ + "$schema", + "type", + "properties" + ], + "properties": { + "type": { + "title": "Instance Type", + "description": "Defines the JSON type for an instance of the DSC Resource. DSC Resource instances always have the `object` type.", + "const": "object" + }, + "$schema": { + "title": "DSC Resource instance schema dialect", + "description": "Defines which dialect of JSON Schema the DSC Resource is using to validate instances.", + "type": "string", + "format": "uri-reference", + "enum": [ + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2019-09/schema", + "http://json-schema.org/draft-07/schema#" + ] + }, + "$id": { + "title": "DSC Resource instance schema ID", + "description": "Defines the unique ID for the DSC Resource's instance schema. If the instance schema is published to its own public URI, set this keyword to that URI.", + "type": "string", + "format": "uri-reference" + }, + "properties": { + "title": "Instance Properties", + "description": "Defines the properties that DSC can retrieve and manage for the resource's instances. This keyword must define at least one property as a key-value pair. The key is the property's name. The value is a subschema that validates the property.", + "type": "object", + "minProperties": 1, + "unevaluatedProperties": { + "anyOf": [ + { + "$ref": "https://json-schema.org/draft/2020-12/schema" + }, + { + "$ref": "https://json-schema.org/draft/2019-09/schema" + }, + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ] + }, + "additionalProperties": {}, + "properties": { + "_exist": { + "title": "Standard Property: _exist", + "description": "Indicates that the DSC Resource uses the standard `_exist` property to specify whether an instance should exist as a boolean value that defaults to `true`.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json" + } + }, + "_inDesiredState": { + "title": "Standard Property: _inDesiredState", + "description": "Indicates that the DSC Resource returns this value for it's own `test` method. This read-only property is mandatory when the manifest defines the `test` property. It shouldn't be included if the DSC Resource relies on DSC's synthetic testing.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json" + } + }, + "_purge": { + "title": "Standard Property: _purge", + "description": "Indicates that the DSC Resource uses the standard `_purge` property to specify whether the DSC Resource should remove all non-specified members when it manages an array of members or values.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/purge.json" + } + }, + "_rebootRequested": { + "title": "Standard property: _rebootRequested", + "description": "Indicates whether a resource instance requires a reboot after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest.", + "const": { + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/rebootRequested.json" + } + } + } + } + } + } + }, + "examples": [ + { + "command": { + "executable": "registry", + "args": [ + "schema" + ] + } + }, + { + "embedded": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSInfo", + "type": "object", + "required": [], + "properties": { + "$id": { + "type": "string" + }, + "architecture": { + "type": [ + "string", + "null" + ] + }, + "bitness": { + "$ref": "#/definitions/Bitness" + }, + "codename": { + "type": [ + "string", + "null" + ] + }, + "edition": { + "type": [ + "string", + "null" + ] + }, + "family": { + "$ref": "#/definitions/Family" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Bitness": { + "type": "string", + "enum": [ + "32", + "64", + "unknown" + ] + }, + "Family": { + "type": "string", + "enum": [ + "Linux", + "macOS", + "Windows" + ] + } + } + } + } + ] +} diff --git a/schemas/v3/resource/manifest.set.json b/schemas/v3/resource/manifest.set.json new file mode 100644 index 00000000..c95fa604 --- /dev/null +++ b/schemas/v3/resource/manifest.set.json @@ -0,0 +1,83 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.set.json", + "title": "Set Method", + "description": "Defines how DSC must call the DSC Resource to set the desired state of an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3/resource/manifest.test.json b/schemas/v3/resource/manifest.test.json new file mode 100644 index 00000000..a3aef49a --- /dev/null +++ b/schemas/v3/resource/manifest.test.json @@ -0,0 +1,72 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.test.json", + "title": "Test Method", + "description": "Defines how DSC must call the DSC Resource to test if an instance is in the desired state and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + }, + "return": { + "title": "Test Command Return Type", + "description": "Defines whether the command returns a JSON blob of the DSC Resource's current state or the state and an array of the properties that are out of the desired state.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3/resource/manifest.validate.json b/schemas/v3/resource/manifest.validate.json new file mode 100644 index 00000000..f75f59b5 --- /dev/null +++ b/schemas/v3/resource/manifest.validate.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.validate.json", + "title": "Validate Method", + "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3/resource/manifest.whatIf.json b/schemas/v3/resource/manifest.whatIf.json new file mode 100644 index 00000000..5c53ca1d --- /dev/null +++ b/schemas/v3/resource/manifest.whatIf.json @@ -0,0 +1,83 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.whatIf.json", + "title": "What-if method", + "description": "Defines how DSC must call the DSC Resource to indicate whether and how the set command will modify an instance and how to process the output from the DSC Resource.", + "type": "object", + "required": [ + "executable" + ], + "properties": { + "executable": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandExecutable.json" + }, + "args": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/commandArgs.json" + }, + "input": { + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/inputKind.json" + }, + "implementsPretest": { + "title": "Resource Performs Pre-Test", + "description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set --what-if` command. Set this value to `true` if the DSC Resource tests input before processing how it will modify system state.", + "type": "boolean", + "default": false + }, + "handlesExist": { + "title": "Resource handles _exist property", + "description": "Defines whether the DSC Resource has its own built-in handling for the `_exist` common property. Set this value to `true` if the DSC Resource handles instance deletion internally when receiving a `set --what-if` command where the instance defines the `_exist` property as `false`.", + "type": "boolean", + "default": false + }, + "return": { + "description": "Defines whether the command returns a JSON blob of the DSC Resource's expected state after a set operation in what-if mode or the state and an array of the properties the DSC Resource would modify.", + "$ref": "/PowerShell/DSC/main/schemas/v3/definitions/returnKind.json" + } + }, + "oneOf": [ + { + "required": [ + "input" + ], + "not": { + "properties": { + "args": { + "contains": { + "type": "object" + } + } + } + } + }, + { + "not": { + "required": [ + "input" + ] + }, + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + }, + { + "required": [ + "input" + ], + "properties": { + "args": { + "contains": { + "type": "object" + }, + "minContains": 1, + "maxContains": 1 + } + } + } + ] +} diff --git a/schemas/v3/resource/properties/exist.json b/schemas/v3/resource/properties/exist.json new file mode 100644 index 00000000..11c8d770 --- /dev/null +++ b/schemas/v3/resource/properties/exist.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/exist.json", + "title": "Instance should exist", + "description": "Indicates whether the DSC Resource instance should exist.", + "type": "boolean", + "default": true, + "enum": [ + false, + true + ] +} diff --git a/schemas/v3/resource/properties/inDesiredState.json b/schemas/v3/resource/properties/inDesiredState.json new file mode 100644 index 00000000..6ae3f80c --- /dev/null +++ b/schemas/v3/resource/properties/inDesiredState.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/inDesiredState.json", + "title": "Instance is in the Desired State", + "description": "Indicates whether the instance is in the desired state. This property is only returned by the `test` method.", + "type": [ + "boolean", + "null" + ], + "readOnly": true +} diff --git a/schemas/v3/resource/properties/purge.json b/schemas/v3/resource/properties/purge.json new file mode 100644 index 00000000..bc4a8b92 --- /dev/null +++ b/schemas/v3/resource/properties/purge.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/purge.json", + "title": "Purge", + "description": "Indicates that only the components described in the DSC Resource should exist. If other components exist, the DSC Resource is out of the desired state. When enforcing desired state, the DSC Resource removes unmanaged components.", + "type": [ + "boolean", + "null" + ], + "writeOnly": true +} diff --git a/schemas/v3/resource/properties/rebootRequested.json b/schemas/v3/resource/properties/rebootRequested.json new file mode 100644 index 00000000..7772596c --- /dev/null +++ b/schemas/v3/resource/properties/rebootRequested.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/properties/rebootRequested.json", + "title": "Reboot Requested", + "description": "Indicates that the set operation requires a reboot before it's fully complete.", + "type": [ + "boolean", + "null" + ], + "readOnly": true +} From 2373e289effb51f28bd913ac1e73d2aa18a5934c Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Fri, 21 Feb 2025 18:38:14 -0600 Subject: [PATCH 05/11] (GH-642) Add schemas module, update for schema handling in v3 This commit only touches the `dsc` and `dsc_lib` crates. A future commit will update the examples, manifests, and tests throughout the repository for the updated schema URIs. Tests against this commit specifically will not pass, but the changes to the library are broken out here for easier review. This change defines a new module in the library for interacting with and managing JSON Schemas for DSC. The code in this module is made public for use in other repository crates, but shouldn't be used by crates outside of this repository. It defines new enumerations: - `SchemaUriPrefix` for handling URIs pointing to either the GitHub repository or friendly `aka.ms` locations. - `SchemaForm` for the different forms the DSC schemas are published to (canonical, bundled, and enhanced for VS Code) - `RecognizedSchemaVersion` for managing the version folders schemas are publsihed to for and after GA. It defines a few helper functions for constructing the various URIs for a schema. These helper functions may be useful for testing, but should primarily be used through the new `DscRepoSchema` trait, which requires a type to define the base name and folder path for its schema and whether the schema should be published in its bundled form (only applies to top-level schemas, not subschemas). The trait provides default implementations for retrieving the schema URIs and a function to return a generated JSON Schema for the `$schema` keyword, used by both configuration documents and resource manifests. As we canonicalize and improve the schemas, this trait should make it simpler to manage the schemas across new versions and should be the container for JSON Schema enhancements specific to the DSC schemas. This change updates the configuration document and resource manifest definitions to implement the `DscRepoSchema` trait and replaces the per-type enumerations for schema version URIs by passing the `recognized_schema_uris_subschema` to the schemars `schema_with` attribute. --- dsc_lib/locales/en-us.toml | 8 + dsc_lib/src/configure/config_doc.rs | 48 +- dsc_lib/src/configure/depends_on.rs | 16 +- dsc_lib/src/dscresources/resource_manifest.rs | 44 +- dsc_lib/src/lib.rs | 1 + dsc_lib/src/schemas/mod.rs | 597 ++++++++++++++++++ 6 files changed, 653 insertions(+), 61 deletions(-) create mode 100644 dsc_lib/src/schemas/mod.rs diff --git a/dsc_lib/locales/en-us.toml b/dsc_lib/locales/en-us.toml index 04055ce8..4ee8ff43 100644 --- a/dsc_lib/locales/en-us.toml +++ b/dsc_lib/locales/en-us.toml @@ -1,5 +1,9 @@ _version = 1 +[configure.config_doc] +configurationDocumentSchemaTitle = "Configuration document schema URI" +configurationDocumentSchemaDescription = "Defines the JSON Schema the configuration document adheres to." + [configure.constraints] minLengthIsNull = "Parameter '%{name}' has minimum length constraint but is null" notMinLength = "Parameter '%{name}' has minimum length constraint of %{min_length} but is %{length}" @@ -144,6 +148,10 @@ diffKeyNotObject = "diff: key '%{key}' is not an object" diffArraySize = "diff: arrays have different lengths" diffMissingItem = "diff: actual array missing expected item" +[dscresources.resource_manifest] +resourceManifestSchemaTitle = "Resource manifest schema URI" +resourceManifestSchemaDescription = "Defines the JSON Schema the resource manifest adheres to." + [functions] invalidArgType = "Invalid argument type" invalidArguments = "Invalid argument(s)" diff --git a/dsc_lib/src/configure/config_doc.rs b/dsc_lib/src/configure/config_doc.rs index 336dc545..81903f58 100644 --- a/dsc_lib/src/configure/config_doc.rs +++ b/dsc_lib/src/configure/config_doc.rs @@ -1,10 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +use rust_i18n::t; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use serde_json::{Map, Value}; -use std::{collections::HashMap, hash::Hash}; +use std::collections::HashMap; + +use crate::schemas::DscRepoSchema; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] #[serde(rename_all = "camelCase")] @@ -75,7 +78,8 @@ pub struct Metadata { #[serde(deny_unknown_fields)] pub struct Configuration { #[serde(rename = "$schema")] - pub schema: DocumentSchemaUri, + #[schemars(schema_with = "Configuration::recognized_schema_uris_subschema")] + pub schema: String, #[serde(rename = "contentVersion")] pub content_version: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -143,41 +147,31 @@ pub struct Resource { pub metadata: Option>, } -// Defines the valid and recognized canonical URIs for the configuration schema -#[derive(Debug, Default, Clone, Copy, Hash, Eq, PartialEq, Deserialize, Serialize, JsonSchema)] -pub enum DocumentSchemaUri { - #[default] - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json")] - Version2024_04, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.json")] - Bundled2024_04, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json")] - VSCode2024_04, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json")] - Version2023_10, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json")] - Bundled2023_10, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json")] - VSCode2023_10, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json")] - Version2023_08, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json")] - Bundled2023_08, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json")] - VSCode2023_08, -} - impl Default for Configuration { fn default() -> Self { Self::new() } } +impl DscRepoSchema for Configuration { + const SCHEMA_FILE_BASE_NAME: &'static str = "document"; + const SCHEMA_FOLDER_PATH: &'static str = "config"; + const SCHEMA_SHOULD_BUNDLE: bool = true; + + fn schema_metadata() -> schemars::schema::Metadata { + schemars::schema::Metadata { + title: Some(t!("configure.config_doc.configurationDocumentSchemaTitle").into()), + description: Some(t!("configure.config_doc.configurationDocumentSchemaDescription").into()), + ..Default::default() + } + } +} + impl Configuration { #[must_use] pub fn new() -> Self { Self { - schema: DocumentSchemaUri::Version2024_04, + schema: Self::default_schema_id_uri(), content_version: Some("1.0.0".to_string()), parameters: None, variables: None, diff --git a/dsc_lib/src/configure/depends_on.rs b/dsc_lib/src/configure/depends_on.rs index 10b653af..f3813e74 100644 --- a/dsc_lib/src/configure/depends_on.rs +++ b/dsc_lib/src/configure/depends_on.rs @@ -108,7 +108,7 @@ mod tests { #[test] fn test_simple_order() { let config_yaml: &str = r#" - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Second type: Test/Null @@ -128,7 +128,7 @@ mod tests { #[test] fn test_duplicate_name() { let config_yaml: &str = r#" - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: First type: Test/Null @@ -149,7 +149,7 @@ mod tests { #[test] fn test_missing_dependency() { let config_yaml: &str = r#" - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Second type: Test/Null @@ -166,7 +166,7 @@ mod tests { #[test] fn test_multiple_same_dependency() { let config_yaml: &str = r#" - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Second type: Test/Null @@ -191,7 +191,7 @@ mod tests { #[test] fn test_circular_dependency() { let config_yaml: &str = r#" - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Second type: Test/Null @@ -212,7 +212,7 @@ mod tests { #[test] fn test_multiple_dependencies() { let config_yaml: &str = r#" - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Third type: Test/Null @@ -236,7 +236,7 @@ mod tests { #[test] fn test_complex_circular_dependency() { let config_yaml: &str = r#" - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Third type: Test/Null @@ -262,7 +262,7 @@ mod tests { #[test] fn test_complex_dependency() { let config_yaml: &str = r#" - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Third type: Test/Null diff --git a/dsc_lib/src/dscresources/resource_manifest.rs b/dsc_lib/src/dscresources/resource_manifest.rs index 04a652c4..b6739afd 100644 --- a/dsc_lib/src/dscresources/resource_manifest.rs +++ b/dsc_lib/src/dscresources/resource_manifest.rs @@ -1,13 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +use rust_i18n::t; use schemars::JsonSchema; use semver::Version; use serde::{Deserialize, Serialize}; use serde_json::Value; use std::collections::HashMap; -use crate::dscerror::DscError; +use crate::{dscerror::DscError, schemas::DscRepoSchema}; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] #[serde(rename_all = "camelCase")] @@ -23,7 +24,8 @@ pub enum Kind { pub struct ResourceManifest { /// The version of the resource manifest schema. #[serde(rename = "$schema")] - pub schema_version: ManifestSchemaUri, + #[schemars(schema_with = "ResourceManifest::recognized_schema_uris_subschema")] + pub schema_version: String, /// The namespaced name of the resource. #[serde(rename = "type")] pub resource_type: String, @@ -70,30 +72,6 @@ pub struct ResourceManifest { pub schema: Option, } -// Defines the valid and recognized canonical URIs for the manifest schema -#[derive(Debug, Default, Clone, Copy, Hash, Eq, PartialEq, Deserialize, Serialize, JsonSchema)] -pub enum ManifestSchemaUri { - #[default] - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.json")] - Version2024_04, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json")] - Bundled2024_04, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.vscode.json")] - VSCode2024_04, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json")] - Version2023_10, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json")] - Bundled2023_10, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json")] - VSCode2023_10, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json")] - Version2023_08, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json")] - Bundled2023_08, - #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json")] - VSCode2023_08, -} - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] #[serde(untagged)] pub enum ArgKind { @@ -256,6 +234,20 @@ pub struct ListMethod { pub args: Option>, } +impl DscRepoSchema for ResourceManifest { + const SCHEMA_FILE_BASE_NAME: &'static str = "manifest"; + const SCHEMA_FOLDER_PATH: &'static str = "resource"; + const SCHEMA_SHOULD_BUNDLE: bool = true; + + fn schema_metadata() -> schemars::schema::Metadata { + schemars::schema::Metadata { + title: Some(t!("dscresources.resource_manifest.resourceManifestSchemaTitle").into()), + description: Some(t!("dscresources.resource_manifest.resourceManifestSchemaDescription").into()), + ..Default::default() + } + } +} + /// Import a resource manifest from a JSON value. /// /// # Arguments diff --git a/dsc_lib/src/lib.rs b/dsc_lib/src/lib.rs index ddc1b289..2e9f49e0 100644 --- a/dsc_lib/src/lib.rs +++ b/dsc_lib/src/lib.rs @@ -16,6 +16,7 @@ pub mod functions; pub mod parser; pub mod progress; pub mod util; +pub mod schemas; i18n!("locales", fallback = "en-us"); diff --git a/dsc_lib/src/schemas/mod.rs b/dsc_lib/src/schemas/mod.rs new file mode 100644 index 00000000..7a1f0b20 --- /dev/null +++ b/dsc_lib/src/schemas/mod.rs @@ -0,0 +1,597 @@ +//! Contains helpers for JSON schemas and DSC + +use schemars::{schema::{Metadata, Schema}, JsonSchema}; + +/// Defines the URI prefix for the hosted schemas. +/// +/// While the schemas are currently hosted in the GitHub repository, DSC provides the shortened +/// `aka.ms` link for convenience. Using this enum simplifies migrating to a new URI for schemas +/// in the future. +#[derive(Debug, Default, Clone, Copy, Hash, Eq, PartialEq)] +pub enum SchemaUriPrefix { + #[default] + AkaDotMs, + Github, +} + +impl std::fmt::Display for SchemaUriPrefix { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::AkaDotMs => write!(f, "{}", "https://aka.ms/dsc/schemas"), + Self::Github => write!(f, "{}", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas"), + } + } +} + +impl SchemaUriPrefix { + /// Returns every known URI prefix for convenient iteration. + pub fn all() -> Vec { + vec![ + Self::AkaDotMs, + Self::Github, + ] + } +} + +/// Defines the different forms of JSON Schema that DSC publishes. +#[derive(Debug, Default, Clone, Copy, Hash, Eq, PartialEq)] +pub enum SchemaForm { + /// Indicates that the schema is bundled using the 2020-12 schema bundling contract. + /// + /// These schemas include all of their references in the `$defs` keyword where the key for + /// each reference is the `$id` of that subschema and the value is the subschema. + /// + /// The bundled schemas are preferred for offline usage or where network latency is a concern. + #[default] + Bundled, + /// Indicates that the schema is enhanced for interactively viewing, authoring, and editing + /// the data in VS Code. + /// + /// These schemas include keywords not recognized by JSON Schema libraries and clients outside + /// of VS Code, like `markdownDescription` and `defaultSnippets`. The schema references and + /// definitions do not follow the canonical bundling for schema 2020-12, as the VS Code + /// JSON language server doesn't correctly resolve canonically bundled schemas. + VSCode, + /// Indicates that the schema is canonical but not bundled. It may contain references to other + /// JSON Schemas that require resolution by retrieving those schemas over the network. All + /// DSC schemas are published in this form for easier review, reuse, and retrieval. + Canonical, +} + +impl SchemaForm { + /// Returns the file extension for a given form of schema. + /// + /// The extension for [`Bundled`] and [`Canonical`] schemas is `.json` + /// + /// The extension for [`VSCode`] schemas is `.vscode.json` + pub fn to_extension(&self) -> String { + match self { + Self::Bundled => ".json".to_string(), + Self::VSCode => ".vscode.json".to_string(), + Self::Canonical => ".json".to_string(), + } + } + + /// Return the prefix for a schema's folder path. + /// + /// The [`Bundled`] and [`VSCode`] schemas are always published in the `bundled` folder + /// immediately beneath the version folder. The [`Canonical`] schemas use the folder path + /// as defined for that schema. + pub fn to_folder_prefix(&self) -> String { + match self { + Self::Bundled => "bundled/".to_string(), + Self::VSCode => "bundled/".to_string(), + Self::Canonical => "".to_string(), + } + } + + /// Returns every schema form for convenient iteration. + pub fn all() -> Vec { + vec![ + Self::Bundled, + Self::VSCode, + Self::Canonical, + ] + } +} + +/// Defines the versions of DSC recognized for schema validation and handling. +/// +/// The DSC schemas are published into three folders: +/// +/// - `v..` always includes the exact JSON Schema that shipped in that release +/// of DSC. +/// - `v.` always includes the latest JSON Schema compatible with that minor version +/// of DSC. +/// - `v` always includes the latest JSON Schema compatible with that major version of DSC. +/// +/// Pinning to `v` requires the least-frequent updating of the `$schema` in configuration +/// documents and resource manifests, but also introduces changes that affect those schemas +/// (without breaking changes) regularly. Some of the added features may not be effective in the +/// version of DSC a user has installed. +/// +/// Pinning to `v.` ensures that users always have the latest schemas for the version +/// of DSC they're using without schema changes that they may not be able to take advantage of. +/// However, it requires updating the resource manifests and configuration documents with each +/// minor release of DSC. +/// +/// Pinning to `v..` is the most specific option, but requires the most +/// frequent updating on the part of resource and configuration authors. +#[derive(Debug, Default, Clone, Copy, Hash, Eq, PartialEq)] +pub enum RecognizedSchemaVersion { + // Before any relase is published, this enum must be updated with the new version variants. + // Every release requires a patch version, like `V3_0_1` or `v3_1_0`. New minor releases also + // require a new minor version, like `v3_1`. + + /// Represents `v3` schema folder. + #[default] + V3, + /// Represents the `v3.0` schema folder. + V3_0, + /// Represents the `v3.0.0` schema folder. + V3_0_0, +} + +impl std::fmt::Display for RecognizedSchemaVersion { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::V3 => write!(f, "{}", "v3"), + Self::V3_0 => write!(f, "{}", "v3.0"), + Self::V3_0_0 => write!(f, "{}", "v3.0.0"), + } + } +} + +impl RecognizedSchemaVersion { + /// Returns every recognized schema version for convenient iteration. + pub fn all() -> Vec { + vec![ + Self::V3, + Self::V3_0, + Self::V3_0_0, + ] + } + + //// Returns the latest version with major, minor, and patch segments, like `3.0.0`. + pub fn latest() -> RecognizedSchemaVersion { + Self::V3_0_0 + } + + /// Returns the latest minor version for the latest major version, like `3.0`. + pub fn latest_minor() -> RecognizedSchemaVersion { + Self::V3_0 + } + + /// Returns the latest major version, like `3` + pub fn latest_major() -> RecognizedSchemaVersion { + Self::V3 + } +} + +/// Returns the constructed URI for a hosted DSC schema. +/// +/// This convenience function simplifies constructing the URIs for the various published schemas +/// that DSC recognizes, instead of needing to maintain long lists of those recognized schemas. +/// This function should primarily be called by [`get_recognized_schema_uris`], not called +/// directly. +/// +/// Parameters: +/// +/// - `schema_file_base_name` - specify the base name for the schema file, like `document` for +/// the configuration document schema or `manifest` for the resource manifest schema. +/// - `schema_folder_path` - specify the folder path for the schema file relative to the version +/// folder, like `config` for the configuration document schema or `resource` for the resource +/// manifest schema. +/// - `schema_version` - specify the version of the schema. +/// - `schema_form` - specify whether the schema is bundled, for VS Code, or is the canonical +/// (non-bundled) schema. +/// - `uri_prefix` - Specify whether the URI should be prefixed for `aka.ms` or GitHub. +pub(crate) fn get_recognized_schema_uri( + schema_file_base_name: &str, + schema_folder_path: &str, + schema_version: RecognizedSchemaVersion, + schema_form: SchemaForm, + schema_uri_prefix: SchemaUriPrefix +) -> String { + format!( + "{schema_uri_prefix}/{schema_version}/{}{schema_folder_path}/{schema_file_base_name}{}", + schema_form.to_folder_prefix(), + schema_form.to_extension() + ) +} + +/// Returns the vector of recognized URIs for a given schema. +/// +/// This convenience function generates a vector containing every recognized JSON Schema `$id` URI +/// for a specific schema. It handles returning the schemas for every recognized host, version, +/// and form. +/// +/// Parameters: +/// +///- `schema_file_base_name` - specify the base name for the schema file, like `document` for +/// the configuration document schema or `manifest` for the resource manifest schema. +/// - `schema_folder_path` - specify the folder path for the schema file relative to the version +/// folder, like `config` for the configuration document schema or `resource` for the resource +/// manifest schema. +/// - `should_bundle` - specify whether the schema should be published in its bundled form. All +/// bundled schemas are also published with their VS Code form. Schemas that aren't bundled +/// aren't published with the VS Code form. +pub(crate) fn get_recognized_schema_uris( + schema_file_base_name: &str, + schema_folder_path: &str, + should_bundle: bool +) -> Vec { + let mut uris: Vec = Vec::new(); + let schema_forms = match should_bundle { + true => SchemaForm::all(), + false => vec![SchemaForm::Canonical], + }; + for uri_prefix in SchemaUriPrefix::all() { + for schema_form in schema_forms.iter().copied() { + for schema_version in RecognizedSchemaVersion::all() { + uris.push( + get_recognized_schema_uri( + schema_file_base_name, + schema_folder_path, + schema_version, + schema_form, + uri_prefix + ) + ); + } + } + } + + return uris.into() +} + +/// Returns the JSON Schema to validate that a `$schema` keyword for a DSC type is one of the +/// recognized URIs. +/// +/// This is a convenience function used by the [`DscRepoSchema`] trait. It's not intended for +/// direct use.` +pub(crate) fn get_recognized_uris_subschema( + metadata: Metadata, + schema_file_base_name: &str, + schema_folder_path: &str, + should_bundle: bool +) -> Schema { + let enums: Vec = get_recognized_schema_uris( + schema_file_base_name, + schema_folder_path, + should_bundle + ).iter().map( + |schema_uri| serde_json::Value::String(schema_uri.clone()) + ).collect(); + + schemars::schema::SchemaObject { + instance_type: Some(schemars::schema::InstanceType::String.into()), + format: Some("uri".to_string()), + string: Some(Box::new(schemars::schema::StringValidation { + max_length: None, + min_length: None, + pattern: None, + })), + enum_values: Some(enums), + metadata: Some(Box::new(metadata)), + ..Default::default() + }.into() +} + +/// Returns the recognized schema URI for the latest major version with the +/// `aka.ms` URI prefix. +/// +/// If the schema is published in bundled form, this function returns the URI for that form. +/// Otherwise, it returns the URI for the canonical (non-bundled) form. The VS Code form of the +/// schema is never returned as the default. +/// +/// Parameters: +/// +///- `schema_file_base_name` - specify the base name for the schema file, like `document` for +/// the configuration document schema or `manifest` for the resource manifest schema. +/// - `schema_folder_path` - specify the folder path for the schema file relative to the version +/// folder, like `config` for the configuration document schema or `resource` for the resource +/// manifest schema. +/// - `should_bundle` - specify whether the schema should be published in its bundled form. All +/// bundled schemas are also published with their VS Code form. Schemas that aren't bundled +/// aren't published with the VS Code form. +pub(crate) fn get_default_schema_uri( + schema_file_base_name: &str, + schema_folder_path: &str, + should_bundle: bool +) -> String { + get_recognized_schema_uri( + schema_file_base_name, + schema_folder_path, + RecognizedSchemaVersion::default(), + get_default_schema_form(should_bundle), + SchemaUriPrefix::default() + ) +} + +/// Returns the default form for a schema depending on whether it publishes with its references +/// bundled. +/// +/// If a schema is published in bundled form, the bundled form is the default. Otherwise, the +/// default form is canonical (non-bundled). +fn get_default_schema_form(should_bundle: bool) -> SchemaForm { + match should_bundle { + false => SchemaForm::Canonical, + true => SchemaForm::Bundled, + } +} + +/// Defines a reusable trait to simplify managing multiple versions of JSON Schemas for DSC +/// structs and enums. +/// +/// This trait is only intended for use by definitions in the DSC repository. +pub trait DscRepoSchema : JsonSchema { + /// Defines the base name for the exported JSON Schema, like `document` for + /// [`Configuration`]. + /// + /// [`Configuration`]: crate::configure::config_doc::Configuration + const SCHEMA_FILE_BASE_NAME: &'static str; + + /// Defines the folder path for the schema relative to the published version folder, like + /// `config` for [`Configuration`]. + /// + /// [`Configuration`]: crate::configure::config_doc::Configuration + const SCHEMA_FOLDER_PATH: &'static str; + + /// Indicates whether the schema should be published in its bundled form. All bundled schemas + /// are also published with their VS Code form. Schemas that aren't bundled aren't published + /// with the VS Code form. + const SCHEMA_SHOULD_BUNDLE: bool; + fn schema_metadata() -> Metadata; + + /// Returns the default URI for the schema. + /// + /// An object representing an instance of the schema can specify any valid URI, but the + /// default when creating an instance is the latest major version of the schema with the + /// `aka.ms` prefix. If the schema is published in the bundled form, the default is for the + /// bundled schema. Otherwise, the default is for the canonical (non-bundled) schema. + fn default_schema_id_uri() -> String { + get_default_schema_uri( + Self::SCHEMA_FILE_BASE_NAME, + Self::SCHEMA_FOLDER_PATH, + Self::SCHEMA_SHOULD_BUNDLE + ) + } + + /// Returns the schema URI for a given version, form, and prefix. + fn get_schema_id_uri( + schema_version: RecognizedSchemaVersion, + schema_form: SchemaForm, + uri_prefix: SchemaUriPrefix + ) -> String { + get_recognized_schema_uri( + Self::SCHEMA_FILE_BASE_NAME, + Self::SCHEMA_FOLDER_PATH, + schema_version, + schema_form, + uri_prefix + ) + } + + /// Returns the URI for the VS Code form of the schema with the default prefix for a given + /// version. + /// + /// If the type isn't published in bundled form, this function returns `None`. + fn get_enhanced_schema_id_uri(schema_version: RecognizedSchemaVersion) -> Option { + if !Self::SCHEMA_SHOULD_BUNDLE { + return None; + } + + Some(get_recognized_schema_uri( + Self::SCHEMA_FILE_BASE_NAME, + Self::SCHEMA_FOLDER_PATH, + schema_version, + SchemaForm::VSCode, + SchemaUriPrefix::default() + )) + } + + /// Returns the URI for the canonical (non-bundled) form of the schema with the default + /// prefix for a given version. + fn get_canonical_schema_id_uri(schema_version: RecognizedSchemaVersion) -> String { + get_recognized_schema_uri( + Self::SCHEMA_FILE_BASE_NAME, + Self::SCHEMA_FOLDER_PATH, + schema_version, + SchemaForm::Canonical, + SchemaUriPrefix::default() + ) + } + + /// Returns the URI for the bundled form of the schema with the default prefix for a given + /// version. + fn get_bundled_schema_id_uri(schema_version: RecognizedSchemaVersion) -> Option { + if !Self::SCHEMA_SHOULD_BUNDLE { + return None; + } + + Some(get_recognized_schema_uri( + Self::SCHEMA_FILE_BASE_NAME, + Self::SCHEMA_FOLDER_PATH, + schema_version, + SchemaForm::Bundled, + SchemaUriPrefix::default() + )) + } + + /// Returns the list of recognized schema URIs for the struct or enum. + /// + /// This convenience function generates a vector containing every recognized JSON Schema `$id` + /// URI for a specific schema. It handles returning the schemas for every recognized prefix, + /// version, and form. + fn recognized_schema_uris() -> Vec { + get_recognized_schema_uris( + Self::SCHEMA_FILE_BASE_NAME, + Self::SCHEMA_FOLDER_PATH, + Self::SCHEMA_SHOULD_BUNDLE + ) + } + + /// Returns the subschema to validate a `$schema` keyword pointing to the type. + /// + /// Every schema has a canonical `$id`, but DSC needs to maintain compatibility with schemas + /// within a major version and ensure that previous schema versions can be correctly + /// recognized and validated. This method generates the appropriate subschema with every + /// valid URI for the schema's `$id` without needing to regularly update an enum for each + /// schema and release. + fn recognized_schema_uris_subschema(_: &mut schemars::gen::SchemaGenerator) -> Schema { + get_recognized_uris_subschema( + Self::schema_metadata(), + Self::SCHEMA_FILE_BASE_NAME, + Self::SCHEMA_FOLDER_PATH, + Self::SCHEMA_SHOULD_BUNDLE + ) + } +} + +#[allow(unused_imports)] +mod test { + use serde::{Deserialize, Serialize}; + + use super::*; + + #[test] + fn test_get_recognized_schema_uri() { + let expected = "https://aka.ms/dsc/schemas/v3/bundled/config/document.json".to_string(); + let actual = get_recognized_schema_uri( + "document", + "config", + RecognizedSchemaVersion::V3, + SchemaForm::Bundled, + SchemaUriPrefix::AkaDotMs + ); + assert_eq!(expected, actual) + } + + #[test] + fn test_get_recognized_schema_uris() { + let expected: Vec = vec![ + "https://aka.ms/dsc/schemas/v3/bundled/config/document.json".to_string(), + "https://aka.ms/dsc/schemas/v3.0/bundled/config/document.json".to_string(), + "https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.json".to_string(), + "https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json".to_string(), + "https://aka.ms/dsc/schemas/v3.0/bundled/config/document.vscode.json".to_string(), + "https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.vscode.json".to_string(), + "https://aka.ms/dsc/schemas/v3/config/document.json".to_string(), + "https://aka.ms/dsc/schemas/v3.0/config/document.json".to_string(), + "https://aka.ms/dsc/schemas/v3.0.0/config/document.json".to_string(), + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.json".to_string(), + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.json".to_string(), + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.json".to_string(), + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.vscode.json".to_string(), + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.vscode.json".to_string(), + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.vscode.json".to_string(), + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json".to_string(), + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json".to_string(), + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json".to_string(), + ]; + + let actual = get_recognized_schema_uris( + "document", + "config", + true + ); + + assert_eq!(expected, actual) + } + + #[test] + fn test_get_default_schema_uri() { + let expected_bundled = "https://aka.ms/dsc/schemas/v3/bundled/config/document.json".to_string(); + let expected_canonical = "https://aka.ms/dsc/schemas/v3/config/document.json".to_string(); + + let schema_file_base_name = "document"; + let schema_folder_path = "config"; + + assert_eq!(expected_bundled, get_default_schema_uri(schema_file_base_name, schema_folder_path, true)); + assert_eq!(expected_canonical, get_default_schema_uri(schema_file_base_name, schema_folder_path, false)) + } + + #[test] + fn test_dsc_repo_schema_bundled() { + #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] + struct ExampleBundledSchema { + pub schema_version: String, + } + + impl DscRepoSchema for ExampleBundledSchema { + const SCHEMA_FILE_BASE_NAME: &'static str = "schema"; + const SCHEMA_FOLDER_PATH: &'static str = "example"; + const SCHEMA_SHOULD_BUNDLE: bool = true; + + fn schema_metadata() -> Metadata { + Metadata::default() + } + } + + let bundled_uri = "https://aka.ms/dsc/schemas/v3/bundled/example/schema.json".to_string(); + let vscode_uri = "https://aka.ms/dsc/schemas/v3/bundled/example/schema.vscode.json".to_string(); + let canonical_uri = "https://aka.ms/dsc/schemas/v3/example/schema.json".to_string(); + let schema_version = RecognizedSchemaVersion::V3; + + assert_eq!( + bundled_uri, + ExampleBundledSchema::default_schema_id_uri() + ); + + assert_eq!( + Some(bundled_uri), + ExampleBundledSchema::get_bundled_schema_id_uri(schema_version) + ); + + assert_eq!( + Some(vscode_uri), + ExampleBundledSchema::get_enhanced_schema_id_uri(schema_version) + ); + + assert_eq!( + canonical_uri, + ExampleBundledSchema::get_canonical_schema_id_uri(schema_version) + ) + } + + #[test] + fn test_dsc_repo_schema_not_bundled() { + #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] + struct ExampleNotBundledSchema { + pub schema_version: String, + } + + impl DscRepoSchema for ExampleNotBundledSchema { + const SCHEMA_FILE_BASE_NAME: &'static str = "schema"; + const SCHEMA_FOLDER_PATH: &'static str = "example"; + const SCHEMA_SHOULD_BUNDLE: bool = false; + + fn schema_metadata() -> Metadata { + Metadata::default() + } + } + + let canonical_uri = "https://aka.ms/dsc/schemas/v3/example/schema.json".to_string(); + let schema_version = RecognizedSchemaVersion::V3; + assert_eq!( + canonical_uri, + ExampleNotBundledSchema::default_schema_id_uri() + ); + + assert_eq!( + None, + ExampleNotBundledSchema::get_bundled_schema_id_uri(schema_version) + ); + + assert_eq!( + None, + ExampleNotBundledSchema::get_enhanced_schema_id_uri(schema_version) + ); + + assert_eq!( + canonical_uri, + ExampleNotBundledSchema::get_canonical_schema_id_uri(schema_version) + ) + } +} From 087075aee246ff6dddba650e817253b972960c7b Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Fri, 21 Feb 2025 18:41:51 -0600 Subject: [PATCH 06/11] (GH-642) Update schema URIs to aka.ms and v3 This change updates the schema URIs in the various resource manifests, configuration documents, and tests to use the new schema URIs: - `https://aka.ms/dsc/schemas/v3/bundled/config/document.json` for configuration documents. - `https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json` for resource manifests. This change pins the changes to the major version to reduce how often these files need to be updated with future releases. It uses the `aka.ms` prefix instead of the GitHub URI prefix for readability and because we expect the majority of users to prefer the shorter URI. With this change in place, tests broken in the previous commit should pass again. --- .github/ISSUE_TEMPLATE/Bug_Report.yml | 2 +- .vscode/docs.code-snippets | 4 +-- archive/registry/registry.dsc.resource.json | 2 +- .../windows/windows_baseline.dsc.yaml | 6 ++-- .../windows/windows_inventory.dsc.yaml | 4 +-- dsc/assertion.dsc.resource.json | 2 +- dsc/examples/assertion.dsc.yaml | 4 +-- dsc/examples/brew.dsc.yaml | 4 +-- dsc/examples/brew_export.dsc.yaml | 2 +- dsc/examples/brew_uninstall.dsc.yaml | 4 +-- dsc/examples/groups.dsc.yaml | 8 +++--- dsc/examples/include.dsc.yaml | 2 +- dsc/examples/invalid_schema.dsc.yaml | 2 +- dsc/examples/multiline.dsc.yaml | 2 +- dsc/examples/osinfo.dsc.json | 2 +- dsc/examples/osinfo_parameters.dsc.json | 2 +- dsc/examples/osinfo_parameters.dsc.yaml | 2 +- dsc/examples/osinfo_registry.dsc.json | 2 +- dsc/examples/osinfo_registry.dsc.yaml | 2 +- dsc/examples/parallel.dsc.yaml | 2 +- dsc/examples/powershell.dsc.yaml | 2 +- dsc/examples/reference.dsc.yaml | 2 +- dsc/examples/require_admin.yaml | 2 +- dsc/examples/require_nonadmin.yaml | 2 +- dsc/examples/secure_parameters.dsc.yaml | 2 +- dsc/examples/variables.dsc.yaml | 2 +- dsc/examples/winget.dsc.yaml | 2 +- dsc/examples/winps_script.dsc.yaml | 2 +- dsc/group.dsc.resource.json | 2 +- dsc/include.dsc.resource.json | 2 +- dsc/tests/dsc_args.tests.ps1 | 6 ++-- dsc/tests/dsc_config_get.tests.ps1 | 6 ++-- dsc/tests/dsc_config_set.tests.ps1 | 2 +- dsc/tests/dsc_config_test.tests.ps1 | 4 +-- dsc/tests/dsc_discovery.tests.ps1 | 8 +++--- dsc/tests/dsc_export.tests.ps1 | 16 +++++------ dsc/tests/dsc_expressions.tests.ps1 | 4 +-- dsc/tests/dsc_functions.tests.ps1 | 6 ++-- dsc/tests/dsc_include.tests.ps1 | 28 +++++++++---------- dsc/tests/dsc_parameters.tests.ps1 | 20 ++++++------- dsc/tests/dsc_resource_input.tests.ps1 | 2 +- dsc/tests/dsc_set.tests.ps1 | 2 +- dsc/tests/dsc_tracing.tests.ps1 | 2 +- dsc/tests/dsc_variables.tests.ps1 | 12 ++++---- dsc/tests/dsc_whatif.tests.ps1 | 10 +++---- dscecho/echo.dsc.resource.json | 2 +- osinfo/osinfo.dsc.resource.json | 2 +- osinfo/tests/osinfo.tests.ps1 | 2 +- .../TestAdapter/testadapter.dsc.resource.json | 2 +- .../Tests/class_ps_resources.dsc.yaml | 2 +- .../Tests/native_and_powershell.dsc.yaml | 2 +- .../Tests/powershellgroup.config.tests.ps1 | 14 +++++----- .../Tests/winps_reference_resource.dsc.yaml | 2 +- .../Tests/winps_resource.dsc.yaml | 2 +- .../powershell.dsc.resource.json | 2 +- .../windowspowershell.dsc.resource.json | 2 +- process/ExportTest.dsc.yaml | 2 +- process/process.dsc.resource.json | 2 +- .../reboot_pending.dsc.resource.json | 2 +- reboot_pending/tests/reboot_pending.dsc.yaml | 2 +- registry/registry.dsc.resource.json | 2 +- registry/tests/registry.config.set.tests.ps1 | 2 +- resources/apt/apt.dsc.resource.json | 2 +- .../test/assets/apt_install_rolldice.dsc.yaml | 4 +-- .../assets/apt_uninstall_rolldice.dsc.yaml | 4 +-- resources/apt/test/assets/apt_wget.dsc.yaml | 4 +-- resources/brew/brew.dsc.resource.json | 2 +- .../RunCommandOnSet.dsc.resource.json | 2 +- tools/dsctest/dscdelete.dsc.resource.json | 2 +- tools/dsctest/dscexist.dsc.resource.json | 2 +- tools/dsctest/dscexitcode.dsc.resource.json | 2 +- tools/dsctest/dscsleep.dsc.resource.json | 2 +- tools/dsctest/dsctrace.dsc.resource.json | 2 +- tools/dsctest/dscwhatif.dsc.resource.json | 2 +- tools/test_group_resource/src/main.rs | 5 ++-- .../testGroup.dsc.resource.json | 2 +- .../tests/provider.tests.ps1 | 2 +- wmi-adapter/Tests/test_wmi_config.dsc.yaml | 2 +- wmi-adapter/wmi.dsc.resource.json | 2 +- 79 files changed, 149 insertions(+), 148 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_Report.yml b/.github/ISSUE_TEMPLATE/Bug_Report.yml index e57f9edc..850617d5 100644 --- a/.github/ISSUE_TEMPLATE/Bug_Report.yml +++ b/.github/ISSUE_TEMPLATE/Bug_Report.yml @@ -35,7 +35,7 @@ body: ```yaml # repro.dsc.config.yaml - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: repro type: Test/Echo diff --git a/.vscode/docs.code-snippets b/.vscode/docs.code-snippets index 64e989a9..c9a2fa05 100644 --- a/.vscode/docs.code-snippets +++ b/.vscode/docs.code-snippets @@ -42,7 +42,7 @@ "", "```yaml", "# ${1:name}.example.1.dsc.config.yaml", - "\\$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json", + "\\$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json", "resources:", "- name: ${7:descriptive resource name}", " type: Test/Echo", @@ -101,7 +101,7 @@ "", "```yaml", "# $TM_FILENAME_BASE.example.$1.dsc.config.yaml", - "\\$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json", + "\\$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json", "resources:", "- name: ${4:descriptive resource name}", " type: Test/Echo", diff --git a/archive/registry/registry.dsc.resource.json b/archive/registry/registry.dsc.resource.json index 6d819040..0eadc3dd 100644 --- a/archive/registry/registry.dsc.resource.json +++ b/archive/registry/registry.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Microsoft.Windows/Registry", "description": "Manage Windows Registry keys and values", "tags": [ diff --git a/configurations/windows/windows_baseline.dsc.yaml b/configurations/windows/windows_baseline.dsc.yaml index 614515c0..0ffe6cd9 100644 --- a/configurations/windows/windows_baseline.dsc.yaml +++ b/configurations/windows/windows_baseline.dsc.yaml @@ -1,5 +1,5 @@ # This configuration validates a Windows system against a security baseline configuration -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json metadata: Microsoft.DSC: securityContext: elevated @@ -7,7 +7,7 @@ resources: - name: Validate the OS is Windows type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo @@ -18,7 +18,7 @@ resources: dependsOn: - "[resourceId('Microsoft.DSC/Assertion','Validate the OS is Windows')]" properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Default RDP port type: Microsoft.Windows/Registry diff --git a/configurations/windows/windows_inventory.dsc.yaml b/configurations/windows/windows_inventory.dsc.yaml index 30f1ea18..884517b3 100644 --- a/configurations/windows/windows_inventory.dsc.yaml +++ b/configurations/windows/windows_inventory.dsc.yaml @@ -1,9 +1,9 @@ -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Validate the OS is Windows type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo diff --git a/dsc/assertion.dsc.resource.json b/dsc/assertion.dsc.resource.json index 6f9e3c43..b3d69373 100644 --- a/dsc/assertion.dsc.resource.json +++ b/dsc/assertion.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Microsoft.DSC/Assertion", "version": "0.1.0", "description": "`test` will be invoked for all resources in the supplied configuration.", diff --git a/dsc/examples/assertion.dsc.yaml b/dsc/examples/assertion.dsc.yaml index aebff4f5..41ccb23b 100644 --- a/dsc/examples/assertion.dsc.yaml +++ b/dsc/examples/assertion.dsc.yaml @@ -1,5 +1,5 @@ # Example configuration that uses assertions to validate the environment before running the configuration. -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: current user registry type: Microsoft.Windows/Registry @@ -11,7 +11,7 @@ resources: - name: my assertions type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo diff --git a/dsc/examples/brew.dsc.yaml b/dsc/examples/brew.dsc.yaml index 654f9bb4..313e9e94 100644 --- a/dsc/examples/brew.dsc.yaml +++ b/dsc/examples/brew.dsc.yaml @@ -1,10 +1,10 @@ # Example to see if PowerShell 7 is installed, install it, or get all installed packages -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: assertions type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os_check type: Microsoft/OSInfo diff --git a/dsc/examples/brew_export.dsc.yaml b/dsc/examples/brew_export.dsc.yaml index b652affc..bb715426 100644 --- a/dsc/examples/brew_export.dsc.yaml +++ b/dsc/examples/brew_export.dsc.yaml @@ -1,5 +1,5 @@ # Example to see if PowerShell 7 is installed, install it, or get all installed packages -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: brew type: DSC.PackageManagement/Brew diff --git a/dsc/examples/brew_uninstall.dsc.yaml b/dsc/examples/brew_uninstall.dsc.yaml index 80117624..29dd2ab4 100644 --- a/dsc/examples/brew_uninstall.dsc.yaml +++ b/dsc/examples/brew_uninstall.dsc.yaml @@ -1,10 +1,10 @@ # Example to see if PowerShell 7 is installed, install it, or get all installed packages -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: assertions type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os_check type: Microsoft/OSInfo diff --git a/dsc/examples/groups.dsc.yaml b/dsc/examples/groups.dsc.yaml index cabe3498..0e5d2085 100644 --- a/dsc/examples/groups.dsc.yaml +++ b/dsc/examples/groups.dsc.yaml @@ -1,5 +1,5 @@ # Example for grouping and groups in groups -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json metadata: Microsoft.DSC: requiredSecurityContext: current # this is the default and just used as an example indicating this config works for admins and non-admins @@ -7,7 +7,7 @@ resources: - name: Last Group type: Microsoft.DSC/Group properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Last type: Microsoft.DSC.Debug/Echo @@ -18,7 +18,7 @@ resources: - name: First Group type: Microsoft.DSC/Group properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: First type: Microsoft.DSC.Debug/Echo @@ -27,7 +27,7 @@ resources: - name: Nested Group type: Microsoft.DSC/Group properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Nested Second type: Microsoft.DSC.Debug/Echo diff --git a/dsc/examples/include.dsc.yaml b/dsc/examples/include.dsc.yaml index 8a3898ac..bf70af47 100644 --- a/dsc/examples/include.dsc.yaml +++ b/dsc/examples/include.dsc.yaml @@ -1,6 +1,6 @@ # This is a simple example of how to Include another configuration into this one -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: get os info type: Microsoft.DSC/Include diff --git a/dsc/examples/invalid_schema.dsc.yaml b/dsc/examples/invalid_schema.dsc.yaml index 566a96ef..b573bd0f 100644 --- a/dsc/examples/invalid_schema.dsc.yaml +++ b/dsc/examples/invalid_schema.dsc.yaml @@ -1,5 +1,5 @@ # Sample configuration with invalid properties that don't match the resource schema. -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo diff --git a/dsc/examples/multiline.dsc.yaml b/dsc/examples/multiline.dsc.yaml index a67dadac..41122ee9 100644 --- a/dsc/examples/multiline.dsc.yaml +++ b/dsc/examples/multiline.dsc.yaml @@ -1,4 +1,4 @@ -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: test multi-line type: Microsoft.DSC.Debug/Echo diff --git a/dsc/examples/osinfo.dsc.json b/dsc/examples/osinfo.dsc.json index b0ae4d6f..3ea35f93 100644 --- a/dsc/examples/osinfo.dsc.json +++ b/dsc/examples/osinfo.dsc.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/config/document.json", "resources": [ { "name": "os", diff --git a/dsc/examples/osinfo_parameters.dsc.json b/dsc/examples/osinfo_parameters.dsc.json index 1b9fc84d..f65b84e8 100644 --- a/dsc/examples/osinfo_parameters.dsc.json +++ b/dsc/examples/osinfo_parameters.dsc.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/config/document.json", "parameters": { "osFamily": { "type": "string", diff --git a/dsc/examples/osinfo_parameters.dsc.yaml b/dsc/examples/osinfo_parameters.dsc.yaml index 396471b4..5668d241 100644 --- a/dsc/examples/osinfo_parameters.dsc.yaml +++ b/dsc/examples/osinfo_parameters.dsc.yaml @@ -1,4 +1,4 @@ -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: osFamily: type: string diff --git a/dsc/examples/osinfo_registry.dsc.json b/dsc/examples/osinfo_registry.dsc.json index 5c2faa2b..ad80b8bd 100644 --- a/dsc/examples/osinfo_registry.dsc.json +++ b/dsc/examples/osinfo_registry.dsc.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/config/document.json", "metadata": { "description": "Simple example using two different resources and one of them twice." }, diff --git a/dsc/examples/osinfo_registry.dsc.yaml b/dsc/examples/osinfo_registry.dsc.yaml index a1698564..6a39786d 100644 --- a/dsc/examples/osinfo_registry.dsc.yaml +++ b/dsc/examples/osinfo_registry.dsc.yaml @@ -1,5 +1,5 @@ # Simple example using two different resources and one of them twice. -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo diff --git a/dsc/examples/parallel.dsc.yaml b/dsc/examples/parallel.dsc.yaml index f9be63db..b88ea83b 100644 --- a/dsc/examples/parallel.dsc.yaml +++ b/dsc/examples/parallel.dsc.yaml @@ -1,5 +1,5 @@ # Example on how concurrency would be defined in the configuration. -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json metadata: _timeoutSeconds: 600 # example of setting timeout for orchestration, should be namespaced? resources: diff --git a/dsc/examples/powershell.dsc.yaml b/dsc/examples/powershell.dsc.yaml index ddce88d4..d649d8de 100644 --- a/dsc/examples/powershell.dsc.yaml +++ b/dsc/examples/powershell.dsc.yaml @@ -1,5 +1,5 @@ # Example configuration mixing native app resources with classic PS resources -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Use class PowerShell resources type: Microsoft.DSC/PowerShell diff --git a/dsc/examples/reference.dsc.yaml b/dsc/examples/reference.dsc.yaml index 75ffb46b..6b175b9b 100644 --- a/dsc/examples/reference.dsc.yaml +++ b/dsc/examples/reference.dsc.yaml @@ -1,5 +1,5 @@ # Simple example showing how to reference output from a resource to use in another -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo diff --git a/dsc/examples/require_admin.yaml b/dsc/examples/require_admin.yaml index 7cda6ecb..9650e8e5 100644 --- a/dsc/examples/require_admin.yaml +++ b/dsc/examples/require_admin.yaml @@ -1,7 +1,7 @@ # example showing use of specific metadata to indicate this config requires admin to run # note that the resource doesn't require admin, but this will fail to even try to run the # config if the user is not root or elevated as administrator -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json metadata: Microsoft.DSC: securityContext: elevated diff --git a/dsc/examples/require_nonadmin.yaml b/dsc/examples/require_nonadmin.yaml index 750a1c2b..a41ed285 100644 --- a/dsc/examples/require_nonadmin.yaml +++ b/dsc/examples/require_nonadmin.yaml @@ -1,6 +1,6 @@ # example showing use of specific metadata to indicate this config requires admin to run # this will fail to even try to run the config if the user is root or elevated as administrator -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json metadata: Microsoft.DSC: securityContext: restricted diff --git a/dsc/examples/secure_parameters.dsc.yaml b/dsc/examples/secure_parameters.dsc.yaml index 4a7c17c5..43462555 100644 --- a/dsc/examples/secure_parameters.dsc.yaml +++ b/dsc/examples/secure_parameters.dsc.yaml @@ -1,4 +1,4 @@ -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: myString: type: secureString diff --git a/dsc/examples/variables.dsc.yaml b/dsc/examples/variables.dsc.yaml index 53b472ce..a3cdf823 100644 --- a/dsc/examples/variables.dsc.yaml +++ b/dsc/examples/variables.dsc.yaml @@ -1,4 +1,4 @@ -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: myParameter: type: string diff --git a/dsc/examples/winget.dsc.yaml b/dsc/examples/winget.dsc.yaml index 1a4f8578..8e3357e7 100644 --- a/dsc/examples/winget.dsc.yaml +++ b/dsc/examples/winget.dsc.yaml @@ -1,6 +1,6 @@ # The `Microsoft.Winget.DSC` resources needs to be installed: install-psresource Microsoft.Winget.DSC -Prerelease -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: ensureCalc: type: string diff --git a/dsc/examples/winps_script.dsc.yaml b/dsc/examples/winps_script.dsc.yaml index 8dbb61ac..34a34359 100644 --- a/dsc/examples/winps_script.dsc.yaml +++ b/dsc/examples/winps_script.dsc.yaml @@ -1,4 +1,4 @@ -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json metadata: Microsoft.DSC: securityContext: elevated diff --git a/dsc/group.dsc.resource.json b/dsc/group.dsc.resource.json index 28eb02be..a83e4a06 100644 --- a/dsc/group.dsc.resource.json +++ b/dsc/group.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Microsoft.DSC/Group", "version": "0.1.0", "description": "All resources in the supplied configuration is treated as a group.", diff --git a/dsc/include.dsc.resource.json b/dsc/include.dsc.resource.json index f036d6f0..ad125be8 100644 --- a/dsc/include.dsc.resource.json +++ b/dsc/include.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Microsoft.DSC/Include", "version": "0.1.0", "description": "Allows including a configuration file with optional parameter file.", diff --git a/dsc/tests/dsc_args.tests.ps1 b/dsc/tests/dsc_args.tests.ps1 index 74ec4ce9..239aa784 100644 --- a/dsc/tests/dsc_args.tests.ps1 +++ b/dsc/tests/dsc_args.tests.ps1 @@ -5,7 +5,7 @@ Describe 'config argument tests' { BeforeAll { $manifest = @' { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/Hello", "version": "0.1.0", "get": { @@ -117,7 +117,7 @@ actualState: param($parameter) $yaml = @' -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo @@ -137,7 +137,7 @@ resources: param($parameter) $yaml = @' -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo diff --git a/dsc/tests/dsc_config_get.tests.ps1 b/dsc/tests/dsc_config_get.tests.ps1 index cba1e386..f8078d13 100644 --- a/dsc/tests/dsc_config_get.tests.ps1 +++ b/dsc/tests/dsc_config_get.tests.ps1 @@ -33,7 +33,7 @@ Describe 'dsc config get tests' { It 'can accept the use of --output-format as a subcommand' { $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo type: Microsoft.DSC.Debug/Echo @@ -58,7 +58,7 @@ Describe 'dsc config get tests' { It 'json progress for config subcommand' { $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo 1 type: Microsoft.DSC.Debug/Echo @@ -150,7 +150,7 @@ Describe 'dsc config get tests' { It 'contentVersion is ignored' { $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json contentVersion: 1.0.0.0 resources: - name: Echo diff --git a/dsc/tests/dsc_config_set.tests.ps1 b/dsc/tests/dsc_config_set.tests.ps1 index 6283bd36..d9ab9703 100644 --- a/dsc/tests/dsc_config_set.tests.ps1 +++ b/dsc/tests/dsc_config_set.tests.ps1 @@ -4,7 +4,7 @@ Describe 'dsc config set tests' { It 'can use _exist with resources that support and do not support it' { $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Exist type: Test/Exist diff --git a/dsc/tests/dsc_config_test.tests.ps1 b/dsc/tests/dsc_config_test.tests.ps1 index ec437e9a..6b725467 100644 --- a/dsc/tests/dsc_config_test.tests.ps1 +++ b/dsc/tests/dsc_config_test.tests.ps1 @@ -4,12 +4,12 @@ Describe 'dsc config test tests' { It 'Assertion works correctly' { $configYaml = @' - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Operating System Assertion type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Is64BitOS type: Microsoft/OSInfo diff --git a/dsc/tests/dsc_discovery.tests.ps1 b/dsc/tests/dsc_discovery.tests.ps1 index cc4b4ed9..058b70c8 100644 --- a/dsc/tests/dsc_discovery.tests.ps1 +++ b/dsc/tests/dsc_discovery.tests.ps1 @@ -23,7 +23,7 @@ Describe 'tests for resource discovery' { It 'Use DSC_RESOURCE_PATH instead of PATH when defined' { $resourceJson = @' { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "DSC/TestPathResource", "version": "0.1.0", "get": { @@ -45,7 +45,7 @@ Describe 'tests for resource discovery' { param($extension) $resourceYaml = @' - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json type: DSC/TestYamlResource version: 0.1.0 get: @@ -62,7 +62,7 @@ Describe 'tests for resource discovery' { param($extension) $resourceInput = @' - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json type: DSC/TestYamlResource version: 0.1.0 get: @@ -77,7 +77,7 @@ Describe 'tests for resource discovery' { It 'warns on invalid semver' { $manifest = @' { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/InvalidSemver", "version": "1.1.0..1", "get": { diff --git a/dsc/tests/dsc_export.tests.ps1 b/dsc/tests/dsc_export.tests.ps1 index 9eddc623..bf0325d2 100644 --- a/dsc/tests/dsc_export.tests.ps1 +++ b/dsc/tests/dsc_export.tests.ps1 @@ -8,7 +8,7 @@ Describe 'resource export tests' { $out = dsc resource export -r Microsoft/Process $LASTEXITCODE | Should -Be 0 $config_with_process_list = $out | ConvertFrom-Json - $config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json' + $config_with_process_list.'$schema' | Should -BeExactly 'https://aka.ms/dsc/schemas/v3/bundled/config/document.json' $config_with_process_list.'resources' | Should -Not -BeNullOrEmpty $config_with_process_list.resources.count | Should -BeGreaterThan 1 } @@ -25,7 +25,7 @@ Describe 'resource export tests' { It 'Export can be called on a configuration' { $yaml = @' - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json contentVersion: 1.2.3 resources: - name: Processes @@ -36,7 +36,7 @@ Describe 'resource export tests' { $out = $yaml | dsc config export -f - $LASTEXITCODE | Should -Be 0 $config_with_process_list = $out | ConvertFrom-Json - $config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json' + $config_with_process_list.'$schema' | Should -BeExactly 'https://aka.ms/dsc/schemas/v3/bundled/config/document.json' $config_with_process_list.'resources' | Should -Not -BeNullOrEmpty $config_with_process_list.resources.count | Should -BeGreaterThan 1 $config_with_process_list.metadata.'Microsoft.DSC'.operation | Should -BeExactly 'export' @@ -47,7 +47,7 @@ Describe 'resource export tests' { It 'Configuration Export can be piped to configuration Set' -Skip:(!$IsWindows) { $yaml = @' - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Processes type: Microsoft/Process @@ -63,7 +63,7 @@ Describe 'resource export tests' { It 'Duplicate resource types in Configuration Export should not result in error' { $yaml = @' - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Processes type: Microsoft/Process @@ -83,7 +83,7 @@ Describe 'resource export tests' { $out = dsc resource export -r Microsoft/Process -o pretty-json $LASTEXITCODE | Should -Be 0 $config_with_process_list = $out | ConvertFrom-Json - $config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json' + $config_with_process_list.'$schema' | Should -BeExactly 'https://aka.ms/dsc/schemas/v3/bundled/config/document.json' $config_with_process_list.'resources' | Should -Not -BeNullOrEmpty $config_with_process_list.resources.count | Should -BeGreaterThan 1 } @@ -91,7 +91,7 @@ Describe 'resource export tests' { It 'Export can be called on a configuration with the use of --output-format as a subcommand' { $yaml = @' - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Processes type: Microsoft/Process @@ -101,7 +101,7 @@ Describe 'resource export tests' { $out = $yaml | dsc config export -o pretty-json -f - $LASTEXITCODE | Should -Be 0 $config_with_process_list = $out | ConvertFrom-Json - $config_with_process_list.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json' + $config_with_process_list.'$schema' | Should -BeExactly 'https://aka.ms/dsc/schemas/v3/bundled/config/document.json' $config_with_process_list.'resources' | Should -Not -BeNullOrEmpty $config_with_process_list.resources.count | Should -BeGreaterThan 1 } diff --git a/dsc/tests/dsc_expressions.tests.ps1 b/dsc/tests/dsc_expressions.tests.ps1 index 8aeec82d..11907a49 100644 --- a/dsc/tests/dsc_expressions.tests.ps1 +++ b/dsc/tests/dsc_expressions.tests.ps1 @@ -15,7 +15,7 @@ Describe 'Expressions tests' { ) { param($text, $expected) $yaml = @" -`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +`$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: test: type: object @@ -55,7 +55,7 @@ resources: ) { param($expression) $yaml = @" -`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +`$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: echo type: Microsoft.DSC.Debug/Echo diff --git a/dsc/tests/dsc_functions.tests.ps1 b/dsc/tests/dsc_functions.tests.ps1 index e4f5bdb1..148d26f1 100644 --- a/dsc/tests/dsc_functions.tests.ps1 +++ b/dsc/tests/dsc_functions.tests.ps1 @@ -14,7 +14,7 @@ Describe 'tests for function expressions' { $escapedText = $text -replace "'", "''" $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo type: Microsoft.DSC.Debug/Echo @@ -32,7 +32,7 @@ Describe 'tests for function expressions' { param($path, $expected) $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo type: Microsoft.DSC.Debug/Echo @@ -45,7 +45,7 @@ Describe 'tests for function expressions' { It 'default systemRoot() is correct for the OS' { $config_yaml = @' - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo type: Microsoft.DSC.Debug/Echo diff --git a/dsc/tests/dsc_include.tests.ps1 b/dsc/tests/dsc_include.tests.ps1 index e0f45438..e424d048 100644 --- a/dsc/tests/dsc_include.tests.ps1 +++ b/dsc/tests/dsc_include.tests.ps1 @@ -14,7 +14,7 @@ Describe 'Include tests' { It 'Include invalid config file' { $invalidConfig = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json properties: - name: osinfo type: Microsoft.DSC/Include @@ -26,7 +26,7 @@ Describe 'Include tests' { $invalidConfig | Set-Content -Path $invalidConfigPath $config = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: osinfo type: Microsoft.DSC/Include @@ -41,7 +41,7 @@ Describe 'Include tests' { It 'Include config file with default parameters' { $config = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: osinfo type: Microsoft.DSC/Include @@ -67,7 +67,7 @@ Describe 'Include tests' { $includeContent = (Get-Content $osinfoConfigPath -Raw).Replace("`n", "`n" + (' ' * 20)) $config = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: osinfo type: Microsoft.DSC/Include @@ -97,7 +97,7 @@ Describe 'Include tests' { $includeContent = (Get-Content $osinfoJsonPath -Raw).Replace("`n", "").Replace('"', '\"') $config = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: osinfo type: Microsoft.DSC/Include @@ -121,7 +121,7 @@ Describe 'Include tests' { It 'Include config with parameters file' { $config = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: osinfo type: Microsoft.DSC/Include @@ -148,7 +148,7 @@ Describe 'Include tests' { $parametersContent = (Get-Content $parametersContentFile -Raw).Replace("`n", "").Replace('"', '\"') $config = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: osinfo type: Microsoft.DSC/Include @@ -179,7 +179,7 @@ Describe 'Include tests' { param($config, $parameters) $configYaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: osinfo type: Microsoft.DSC/Include @@ -211,7 +211,7 @@ Describe 'Include tests' { } $configYaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: osinfo type: Microsoft.DSC/Include @@ -236,7 +236,7 @@ Describe 'Include tests' { It 'Multiple includes' { $echoConfig = @' -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: one type: Microsoft.DSC.Debug/Echo @@ -252,7 +252,7 @@ resources: $directorySeparator = [System.IO.Path]::DirectorySeparatorChar.ToString().Replace('\', '\\') $nestedIncludeConfig = @" -`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +`$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: nested type: Microsoft.DSC/Include @@ -264,7 +264,7 @@ resources: $nestedIncludeConfig | Set-Content -Path $nestedIncludeConfigPath -Encoding utf8 $includeConfig = @" -`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +`$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: include type: Microsoft.DSC/Include @@ -288,7 +288,7 @@ resources: It 'Set with include works' { $echoConfig = @' -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: one type: Microsoft.DSC.Debug/Echo @@ -304,7 +304,7 @@ resources: $directorySeparator = [System.IO.Path]::DirectorySeparatorChar.ToString().Replace('\', '\\') $includeConfig = @" -`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +`$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: nested type: Microsoft.DSC/Include diff --git a/dsc/tests/dsc_parameters.tests.ps1 b/dsc/tests/dsc_parameters.tests.ps1 index 75182799..f07bfb70 100644 --- a/dsc/tests/dsc_parameters.tests.ps1 +++ b/dsc/tests/dsc_parameters.tests.ps1 @@ -9,7 +9,7 @@ Describe 'Parameters tests' { param($inputType) $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: param1: type: string @@ -43,7 +43,7 @@ Describe 'Parameters tests' { param($type, $value) $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: param1: type: $type @@ -69,7 +69,7 @@ Describe 'Parameters tests' { param($type, $value) $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: param1: type: $type @@ -95,7 +95,7 @@ Describe 'Parameters tests' { param($type, $value) $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: param1: type: $type @@ -122,7 +122,7 @@ Describe 'Parameters tests' { param($type, $value, $min, $max) $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: param1: type: int @@ -148,7 +148,7 @@ Describe 'Parameters tests' { param($type, $value, $allowed) $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: param1: type: $type @@ -175,7 +175,7 @@ Describe 'Parameters tests' { param($type, $value, $constraint) $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: param1: type: $type @@ -195,7 +195,7 @@ Describe 'Parameters tests' { It 'Default value is used when not provided' { $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: paramString: type: string @@ -252,7 +252,7 @@ Describe 'Parameters tests' { } | ConvertTo-Json $config_yaml = @' - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: osFamily: type: string @@ -293,7 +293,7 @@ Describe 'Parameters tests' { param($type, $value) $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: param: type: $type diff --git a/dsc/tests/dsc_resource_input.tests.ps1 b/dsc/tests/dsc_resource_input.tests.ps1 index c55fb8ca..75da7094 100644 --- a/dsc/tests/dsc_resource_input.tests.ps1 +++ b/dsc/tests/dsc_resource_input.tests.ps1 @@ -5,7 +5,7 @@ Describe 'tests for resource input' { BeforeAll { $manifest = @' { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/EnvVarInput", "version": "0.1.0", "get": { diff --git a/dsc/tests/dsc_set.tests.ps1 b/dsc/tests/dsc_set.tests.ps1 index 6bbd7e78..8a58cbbb 100644 --- a/dsc/tests/dsc_set.tests.ps1 +++ b/dsc/tests/dsc_set.tests.ps1 @@ -5,7 +5,7 @@ Describe 'resource set tests' { BeforeAll { $manifest = @' { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/SetNoTest", "version": "0.1.0", "get": { diff --git a/dsc/tests/dsc_tracing.tests.ps1 b/dsc/tests/dsc_tracing.tests.ps1 index 3de5c73c..5e1d68fa 100644 --- a/dsc/tests/dsc_tracing.tests.ps1 +++ b/dsc/tests/dsc_tracing.tests.ps1 @@ -74,7 +74,7 @@ Describe 'tracing tests' { param($level) $configYaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: trace type: Test/Trace diff --git a/dsc/tests/dsc_variables.tests.ps1 b/dsc/tests/dsc_variables.tests.ps1 index 95d3d348..6fbe8282 100644 --- a/dsc/tests/dsc_variables.tests.ps1 +++ b/dsc/tests/dsc_variables.tests.ps1 @@ -9,9 +9,9 @@ Describe 'Configruation variables tests' { $out.results[0].result.actualState.output | Should -BeExactly 'myOutput is: Hello world!, myObject is: baz' } - It 'Duplicated variable takes last value' { - $configYaml = @' -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + It 'Duplicated variable takes last value' { + $configYaml = @' +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json variables: myVariable: foo myVariable: bar @@ -27,9 +27,9 @@ resources: $out.results[0].result.actualState.output | Should -Be 'bar' } - It 'Missing variable returns error' { - $configYaml = @' -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + It 'Missing variable returns error' { + $configYaml = @' +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json variables: hello: world resources: diff --git a/dsc/tests/dsc_whatif.tests.ps1 b/dsc/tests/dsc_whatif.tests.ps1 index b969f49a..aebc8154 100644 --- a/dsc/tests/dsc_whatif.tests.ps1 +++ b/dsc/tests/dsc_whatif.tests.ps1 @@ -7,7 +7,7 @@ Describe 'whatif tests' { It 'config set whatif when actual state matches desired state' { $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Hello type: Microsoft.DSC.Debug/Echo @@ -28,7 +28,7 @@ Describe 'whatif tests' { It 'config set whatif when actual state does not match desired state' -Skip:(!$IsWindows) { # TODO: change/create cross-plat resource that implements set without just matching desired state $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Registry type: Microsoft.Windows/Registry @@ -52,7 +52,7 @@ Describe 'whatif tests' { It 'config set whatif for delete is not supported' { $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Delete type: Test/Delete @@ -72,7 +72,7 @@ Describe 'whatif tests' { It 'actual execution of WhatIf resource' { $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: WhatIf type: Test/WhatIf @@ -90,7 +90,7 @@ Describe 'whatif tests' { It 'what-if execution of WhatIf resource' { $config_yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: WhatIf type: Test/WhatIf diff --git a/dscecho/echo.dsc.resource.json b/dscecho/echo.dsc.resource.json index 5f556894..49aeaa63 100644 --- a/dscecho/echo.dsc.resource.json +++ b/dscecho/echo.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Microsoft.DSC.Debug/Echo", "version": "1.0.0", "get": { diff --git a/osinfo/osinfo.dsc.resource.json b/osinfo/osinfo.dsc.resource.json index d4d8f57e..037355fa 100644 --- a/osinfo/osinfo.dsc.resource.json +++ b/osinfo/osinfo.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "description": "Returns information about the operating system.", "tags": [ "os", diff --git a/osinfo/tests/osinfo.tests.ps1 b/osinfo/tests/osinfo.tests.ps1 index 389df8ed..ee328316 100644 --- a/osinfo/tests/osinfo.tests.ps1 +++ b/osinfo/tests/osinfo.tests.ps1 @@ -42,7 +42,7 @@ Describe 'osinfo resource tests' { It 'should support export' { $out = dsc resource export -r Microsoft/OSInfo | ConvertFrom-Json - $out.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json' + $out.'$schema' | Should -BeExactly 'https://aka.ms/dsc/schemas/v3/bundled/config/document.json' if ($IsWindows) { $out.resources[0].properties.family | Should -BeExactly 'Windows' } diff --git a/powershell-adapter/Tests/TestAdapter/testadapter.dsc.resource.json b/powershell-adapter/Tests/TestAdapter/testadapter.dsc.resource.json index 4a66ad0b..8623253e 100644 --- a/powershell-adapter/Tests/TestAdapter/testadapter.dsc.resource.json +++ b/powershell-adapter/Tests/TestAdapter/testadapter.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/TestAdapter", "version": "0.1.0", "kind": "adapter", diff --git a/powershell-adapter/Tests/class_ps_resources.dsc.yaml b/powershell-adapter/Tests/class_ps_resources.dsc.yaml index a0eb4aa5..62868e0f 100644 --- a/powershell-adapter/Tests/class_ps_resources.dsc.yaml +++ b/powershell-adapter/Tests/class_ps_resources.dsc.yaml @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Working with classic DSC resources type: Microsoft.DSC/PowerShell diff --git a/powershell-adapter/Tests/native_and_powershell.dsc.yaml b/powershell-adapter/Tests/native_and_powershell.dsc.yaml index c39b03c3..88a2a25f 100644 --- a/powershell-adapter/Tests/native_and_powershell.dsc.yaml +++ b/powershell-adapter/Tests/native_and_powershell.dsc.yaml @@ -2,7 +2,7 @@ # Licensed under the MIT License. # Example configuration mixing native app resources with classic PS resources -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Get info from classic DSC resources type: Microsoft.DSC/PowerShell diff --git a/powershell-adapter/Tests/powershellgroup.config.tests.ps1 b/powershell-adapter/Tests/powershellgroup.config.tests.ps1 index cbeb33c3..d2c803de 100644 --- a/powershell-adapter/Tests/powershellgroup.config.tests.ps1 +++ b/powershell-adapter/Tests/powershellgroup.config.tests.ps1 @@ -69,7 +69,7 @@ Describe 'PowerShell adapter resource tests' { It 'Export works on config with class-based resources' { $yaml = @' - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Working with class-based resources type: Microsoft.DSC/PowerShell @@ -81,7 +81,7 @@ Describe 'PowerShell adapter resource tests' { $out = $yaml | dsc config export -f - $LASTEXITCODE | Should -Be 0 $res = $out | ConvertFrom-Json - $res.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json' + $res.'$schema' | Should -BeExactly 'https://aka.ms/dsc/schemas/v3/bundled/config/document.json' $res.'resources' | Should -Not -BeNullOrEmpty $res.resources[0].properties.result.count | Should -Be 5 $res.resources[0].properties.result[0].Name | Should -Be "Object1" @@ -90,7 +90,7 @@ Describe 'PowerShell adapter resource tests' { It 'Export fails when class-based resource does not implement' { $yaml = @' - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Working with class-based resources type: Microsoft.DSC/PowerShell @@ -114,7 +114,7 @@ Describe 'PowerShell adapter resource tests' { try { $psmp = "`$env:PSModulePath"+[System.IO.Path]::PathSeparator+$TestDrive $yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Working with class-based resources type: Microsoft.DSC/PowerShell @@ -127,7 +127,7 @@ Describe 'PowerShell adapter resource tests' { $out = $yaml | dsc config export -f - $LASTEXITCODE | Should -Be 0 $res = $out | ConvertFrom-Json - $res.'$schema' | Should -BeExactly 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json' + $res.'$schema' | Should -BeExactly 'https://aka.ms/dsc/schemas/v3/bundled/config/document.json' $res.'resources' | Should -Not -BeNullOrEmpty $res.resources[0].properties.result.count | Should -Be 5 $res.resources[0].properties.result[0].Name | Should -Be "Object1" @@ -142,7 +142,7 @@ Describe 'PowerShell adapter resource tests' { It 'DSCConfigRoot macro is working when config is from a file' { $yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Working with class-based resources type: Microsoft.DSC/PowerShell @@ -167,7 +167,7 @@ Describe 'PowerShell adapter resource tests' { It 'DSC_CONFIG_ROOT env var is cwd when config is piped from stdin' { $yaml = @" - `$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Working with class-based resources type: Microsoft.DSC/PowerShell diff --git a/powershell-adapter/Tests/winps_reference_resource.dsc.yaml b/powershell-adapter/Tests/winps_reference_resource.dsc.yaml index d9c5e433..0babd052 100644 --- a/powershell-adapter/Tests/winps_reference_resource.dsc.yaml +++ b/powershell-adapter/Tests/winps_reference_resource.dsc.yaml @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Copy contents from one file to another type: Microsoft.Windows/WindowsPowerShell diff --git a/powershell-adapter/Tests/winps_resource.dsc.yaml b/powershell-adapter/Tests/winps_resource.dsc.yaml index aca685e1..3f875f90 100644 --- a/powershell-adapter/Tests/winps_resource.dsc.yaml +++ b/powershell-adapter/Tests/winps_resource.dsc.yaml @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Get info from classic DSC resources type: Microsoft.Windows/WindowsPowerShell diff --git a/powershell-adapter/powershell.dsc.resource.json b/powershell-adapter/powershell.dsc.resource.json index 041bdf22..76cb1a12 100644 --- a/powershell-adapter/powershell.dsc.resource.json +++ b/powershell-adapter/powershell.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Microsoft.DSC/PowerShell", "version": "0.1.0", "kind": "adapter", diff --git a/powershell-adapter/windowspowershell.dsc.resource.json b/powershell-adapter/windowspowershell.dsc.resource.json index ed1dddb3..54f91a9d 100644 --- a/powershell-adapter/windowspowershell.dsc.resource.json +++ b/powershell-adapter/windowspowershell.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Microsoft.Windows/WindowsPowerShell", "version": "0.1.0", "kind": "adapter", diff --git a/process/ExportTest.dsc.yaml b/process/ExportTest.dsc.yaml index 941b9500..0a51ce87 100644 --- a/process/ExportTest.dsc.yaml +++ b/process/ExportTest.dsc.yaml @@ -1,5 +1,5 @@ # Example configuration mixing native app resources with classic PS resources -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Processes type: Microsoft/Process diff --git a/process/process.dsc.resource.json b/process/process.dsc.resource.json index cb1b2635..6046ad12 100644 --- a/process/process.dsc.resource.json +++ b/process/process.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "description": "Returns information about running processes.", "type": "Microsoft/Process", "version": "0.1.0", diff --git a/reboot_pending/reboot_pending.dsc.resource.json b/reboot_pending/reboot_pending.dsc.resource.json index 6f5bbd69..224a0e72 100644 --- a/reboot_pending/reboot_pending.dsc.resource.json +++ b/reboot_pending/reboot_pending.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "description": "Returns info about pending reboot.", "type": "Microsoft.Windows/RebootPending", "version": "0.1.0", diff --git a/reboot_pending/tests/reboot_pending.dsc.yaml b/reboot_pending/tests/reboot_pending.dsc.yaml index 2f7a9382..5e8e272a 100644 --- a/reboot_pending/tests/reboot_pending.dsc.yaml +++ b/reboot_pending/tests/reboot_pending.dsc.yaml @@ -1,4 +1,4 @@ -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Pending reboot status type: Microsoft.Windows/RebootPending diff --git a/registry/registry.dsc.resource.json b/registry/registry.dsc.resource.json index 92f454dd..50505092 100644 --- a/registry/registry.dsc.resource.json +++ b/registry/registry.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Microsoft.Windows/Registry", "description": "Manage Windows Registry keys and values", "tags": [ diff --git a/registry/tests/registry.config.set.tests.ps1 b/registry/tests/registry.config.set.tests.ps1 index 7153e79f..d969b646 100644 --- a/registry/tests/registry.config.set.tests.ps1 +++ b/registry/tests/registry.config.set.tests.ps1 @@ -38,7 +38,7 @@ Describe 'registry config set tests' { It 'delete called when _exist is false' -Skip:(!$IsWindows) { $config = @{ - '$schema' = 'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json' + '$schema' = 'https://aka.ms/dsc/schemas/v3/bundled/config/document.json' resources = @( @{ name = 'reg' diff --git a/resources/apt/apt.dsc.resource.json b/resources/apt/apt.dsc.resource.json index 3c0b38ce..a03c067f 100644 --- a/resources/apt/apt.dsc.resource.json +++ b/resources/apt/apt.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "DSC.PackageManagement/Apt", "description": "Manage packages with the advanced package tool (APT)", "tags": [ diff --git a/resources/apt/test/assets/apt_install_rolldice.dsc.yaml b/resources/apt/test/assets/apt_install_rolldice.dsc.yaml index b14a60dc..24c8c690 100644 --- a/resources/apt/test/assets/apt_install_rolldice.dsc.yaml +++ b/resources/apt/test/assets/apt_install_rolldice.dsc.yaml @@ -1,10 +1,10 @@ # Example to see if PowerShell 7 is installed, install it, or get all installed packages -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: assertions type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os_check type: Microsoft/OSInfo diff --git a/resources/apt/test/assets/apt_uninstall_rolldice.dsc.yaml b/resources/apt/test/assets/apt_uninstall_rolldice.dsc.yaml index 1809bc11..75c3dbb6 100644 --- a/resources/apt/test/assets/apt_uninstall_rolldice.dsc.yaml +++ b/resources/apt/test/assets/apt_uninstall_rolldice.dsc.yaml @@ -1,10 +1,10 @@ # Example to see if PowerShell 7 is installed, install it, or get all installed packages -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: assertions type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os_check type: Microsoft/OSInfo diff --git a/resources/apt/test/assets/apt_wget.dsc.yaml b/resources/apt/test/assets/apt_wget.dsc.yaml index 2fd1aa16..d82d1f62 100644 --- a/resources/apt/test/assets/apt_wget.dsc.yaml +++ b/resources/apt/test/assets/apt_wget.dsc.yaml @@ -1,10 +1,10 @@ # Example to see if PowerShell 7 is installed, install it, or get all installed packages -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: assertions type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os_check type: Microsoft/OSInfo diff --git a/resources/brew/brew.dsc.resource.json b/resources/brew/brew.dsc.resource.json index 1ee49317..b79abd49 100644 --- a/resources/brew/brew.dsc.resource.json +++ b/resources/brew/brew.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "DSC.PackageManagement/Brew", "description": "DSC resource to manage Homebrew packages", "tags": [ diff --git a/runcommandonset/RunCommandOnSet.dsc.resource.json b/runcommandonset/RunCommandOnSet.dsc.resource.json index 1b6dd97b..d67e4b0b 100644 --- a/runcommandonset/RunCommandOnSet.dsc.resource.json +++ b/runcommandonset/RunCommandOnSet.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "description": "Takes a single-command line to execute on DSC set operation", "type": "Microsoft.DSC.Transitional/RunCommandOnSet", "version": "0.1.0", diff --git a/tools/dsctest/dscdelete.dsc.resource.json b/tools/dsctest/dscdelete.dsc.resource.json index 2a44a657..645ce21d 100644 --- a/tools/dsctest/dscdelete.dsc.resource.json +++ b/tools/dsctest/dscdelete.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/Delete", "version": "0.1.0", "get": { diff --git a/tools/dsctest/dscexist.dsc.resource.json b/tools/dsctest/dscexist.dsc.resource.json index 9ef80f2b..a476d5e6 100644 --- a/tools/dsctest/dscexist.dsc.resource.json +++ b/tools/dsctest/dscexist.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/Exist", "version": "0.1.0", "get": { diff --git a/tools/dsctest/dscexitcode.dsc.resource.json b/tools/dsctest/dscexitcode.dsc.resource.json index 554dc494..dd5818c5 100644 --- a/tools/dsctest/dscexitcode.dsc.resource.json +++ b/tools/dsctest/dscexitcode.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/ExitCode", "version": "0.1.0", "get": { diff --git a/tools/dsctest/dscsleep.dsc.resource.json b/tools/dsctest/dscsleep.dsc.resource.json index d4f0f975..1049ae7b 100644 --- a/tools/dsctest/dscsleep.dsc.resource.json +++ b/tools/dsctest/dscsleep.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/Sleep", "version": "0.1.0", "get": { diff --git a/tools/dsctest/dsctrace.dsc.resource.json b/tools/dsctest/dsctrace.dsc.resource.json index b5b93c04..b6eb5d53 100644 --- a/tools/dsctest/dsctrace.dsc.resource.json +++ b/tools/dsctest/dsctrace.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/Trace", "version": "0.1.0", "get": { diff --git a/tools/dsctest/dscwhatif.dsc.resource.json b/tools/dsctest/dscwhatif.dsc.resource.json index 9d336ee2..7e5b3541 100644 --- a/tools/dsctest/dscwhatif.dsc.resource.json +++ b/tools/dsctest/dscwhatif.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/WhatIf", "version": "0.1.0", "get": { diff --git a/tools/test_group_resource/src/main.rs b/tools/test_group_resource/src/main.rs index 9bff0beb..ba98b32e 100644 --- a/tools/test_group_resource/src/main.rs +++ b/tools/test_group_resource/src/main.rs @@ -7,6 +7,7 @@ use args::{Args, SubCommand}; use clap::Parser; use dsc_lib::dscresources::resource_manifest::{ResourceManifest, GetMethod, Kind}; use dsc_lib::dscresources::dscresource::{Capability, DscResource, ImplementedAs}; +use dsc_lib::schemas::DscRepoSchema; fn main() { let args = Args::parse(); @@ -26,7 +27,7 @@ fn main() { require_adapter: Some("Test/TestGroup".to_string()), manifest: Some(serde_json::to_value(ResourceManifest { description: Some("This is a test resource.".to_string()), - schema_version: dsc_lib::dscresources::resource_manifest::ManifestSchemaUri::Version2023_10, + schema_version: dsc_lib::dscresources::resource_manifest::ResourceManifest::default_schema_id_uri(), resource_type: "Test/TestResource1".to_string(), kind: Some(Kind::Resource), version: "1.0.0".to_string(), @@ -51,7 +52,7 @@ fn main() { require_adapter: Some("Test/TestGroup".to_string()), manifest: Some(serde_json::to_value(ResourceManifest { description: Some("This is a test resource.".to_string()), - schema_version: dsc_lib::dscresources::resource_manifest::ManifestSchemaUri::Version2023_10, + schema_version: dsc_lib::dscresources::resource_manifest::ResourceManifest::default_schema_id_uri(), resource_type: "Test/TestResource2".to_string(), kind: Some(Kind::Resource), version: "1.0.1".to_string(), diff --git a/tools/test_group_resource/testGroup.dsc.resource.json b/tools/test_group_resource/testGroup.dsc.resource.json index 5436d13f..504df6ad 100644 --- a/tools/test_group_resource/testGroup.dsc.resource.json +++ b/tools/test_group_resource/testGroup.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/TestGroup", "kind": "adapter", "version": "0.1.0", diff --git a/tools/test_group_resource/tests/provider.tests.ps1 b/tools/test_group_resource/tests/provider.tests.ps1 index bd2285cb..140dd1fb 100644 --- a/tools/test_group_resource/tests/provider.tests.ps1 +++ b/tools/test_group_resource/tests/provider.tests.ps1 @@ -22,7 +22,7 @@ Describe 'Resource adapter tests' { It 'Error if adapter resource is missing "requireAdapter" member' { $invalid_manifest = @' { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Test/InvalidTestGroup", "kind": "adapter", "version": "0.1.0", diff --git a/wmi-adapter/Tests/test_wmi_config.dsc.yaml b/wmi-adapter/Tests/test_wmi_config.dsc.yaml index 7a18deae..13534784 100644 --- a/wmi-adapter/Tests/test_wmi_config.dsc.yaml +++ b/wmi-adapter/Tests/test_wmi_config.dsc.yaml @@ -1,5 +1,5 @@ # Example configuration for reading data from Windows WMI -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Get info from WMI type: Microsoft.Windows/WMI diff --git a/wmi-adapter/wmi.dsc.resource.json b/wmi-adapter/wmi.dsc.resource.json index b07b16d1..cd54f97c 100644 --- a/wmi-adapter/wmi.dsc.resource.json +++ b/wmi-adapter/wmi.dsc.resource.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "type": "Microsoft.Windows/WMI", "version": "0.1.0", "kind": "adapter", From 7665f850382396df234bc6f08237795566553113 Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Mon, 24 Feb 2025 16:36:15 -0600 Subject: [PATCH 07/11] (GH-642) Add initial plumbing for validating schema URIs Prior to this change, DSC didn't have a convenient way to verify whether a configuration or manifest used a recognized schema or to switch behaviors based on the declared URI. This change begins the process of plumbing the recognized schemas into DSC so the engine can correctly validate and handle items based on the value of the `$schema` keyword. In this first iteration, the `DscRepoSchema` trait adds a method to validate whether the item uses a recognized schema. In the future, the engine should provide further handling than pass/fail. This change only adds the methods, it doesn't alter how DSC processes configuration documents or resource manifests. --- dsc_lib/locales/en-us.toml | 2 + dsc_lib/src/configure/config_doc.rs | 55 +++++++++++++++++- dsc_lib/src/dscerror.rs | 3 + dsc_lib/src/dscresources/resource_manifest.rs | 57 +++++++++++++++++++ dsc_lib/src/schemas/mod.rs | 22 +++++++ 5 files changed, 138 insertions(+), 1 deletion(-) diff --git a/dsc_lib/locales/en-us.toml b/dsc_lib/locales/en-us.toml index 4ee8ff43..17ce4540 100644 --- a/dsc_lib/locales/en-us.toml +++ b/dsc_lib/locales/en-us.toml @@ -319,7 +319,9 @@ schemaNotAvailable = "No Schema found and `validate` is not supported" securityContext = "Security context" utf8Conversion = "UTF-8 conversion" unknown = "Unknown" +unrecognizedSchemaUri = "Unrecognized $schema URI" validation = "Validation" +validSchemaUrisAre = "Valid schema URIs are" setting = "Setting" [progress] diff --git a/dsc_lib/src/configure/config_doc.rs b/dsc_lib/src/configure/config_doc.rs index 81903f58..4c4dce7c 100644 --- a/dsc_lib/src/configure/config_doc.rs +++ b/dsc_lib/src/configure/config_doc.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; use serde_json::{Map, Value}; use std::collections::HashMap; -use crate::schemas::DscRepoSchema; +use crate::{dscerror::DscError, schemas::DscRepoSchema}; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)] #[serde(rename_all = "camelCase")] @@ -165,6 +165,16 @@ impl DscRepoSchema for Configuration { ..Default::default() } } + + fn validate_schema_uri(&self) -> Result<(), DscError> { + match Self::is_recognized_schema_uri(&self.schema) { + true => Ok(()), + false => Err(DscError::UnrecognizedSchemaUri( + self.schema.clone(), + Self::recognized_schema_uris(), + )) + } + } } impl Configuration { @@ -199,3 +209,46 @@ impl Default for Resource { Self::new() } } + +#[allow(unused_imports)] +mod test { + use serde_json::json; + + use crate::{configure::config_doc::Configuration, dscerror::DscError, dscresources::resource_manifest::{import_manifest, ResourceManifest}, schemas::DscRepoSchema}; + + #[test] + fn test_validate_schema_uri_with_invalid_uri() { + let invalid_uri = "https://invalid.schema.uri".to_string(); + + let manifest = Configuration{ + schema: invalid_uri.clone(), + ..Default::default() + }; + + let ref result = manifest.validate_schema_uri(); + + assert!(result.as_ref().is_err()); + + match result.as_ref().unwrap_err() { + DscError::UnrecognizedSchemaUri(actual, recognized) => { + assert_eq!(actual, &invalid_uri); + assert_eq!(recognized, &Configuration::recognized_schema_uris()) + }, + _ => { + panic!("Expected validate_schema_uri() to error on unrecognized schema uri, but was {:?}", result.as_ref().unwrap_err()) + } + } + } + + #[test] + fn test_validate_schema_uri_with_valid_uri() { + let manifest = Configuration{ + schema: Configuration::default_schema_id_uri(), + ..Default::default() + }; + + let result = manifest.validate_schema_uri(); + + assert!(result.is_ok()); + } +} diff --git a/dsc_lib/src/dscerror.rs b/dsc_lib/src/dscerror.rs index c11ebffd..4437aeb4 100644 --- a/dsc_lib/src/dscerror.rs +++ b/dsc_lib/src/dscerror.rs @@ -113,6 +113,9 @@ pub enum DscError { message: String, }, + #[error("{t}: {0}. {t2}: {1:?}", t = t!("dscerror.unrecognizedSchemaUri"), t2 = t!("dscerror.validSchemaUrisAre"))] + UnrecognizedSchemaUri(String, Vec), + #[error("{t}: {0}", t = t!("dscerror.validation"))] Validation(String), diff --git a/dsc_lib/src/dscresources/resource_manifest.rs b/dsc_lib/src/dscresources/resource_manifest.rs index b6739afd..bc38dff6 100644 --- a/dsc_lib/src/dscresources/resource_manifest.rs +++ b/dsc_lib/src/dscresources/resource_manifest.rs @@ -246,6 +246,16 @@ impl DscRepoSchema for ResourceManifest { ..Default::default() } } + + fn validate_schema_uri(&self) -> Result<(), DscError> { + match Self::is_recognized_schema_uri(&self.schema_version) { + true => Ok(()), + false => Err(DscError::UnrecognizedSchemaUri( + self.schema_version.clone(), + Self::recognized_schema_uris(), + )) + } + } } /// Import a resource manifest from a JSON value. @@ -288,3 +298,50 @@ pub fn validate_semver(version: &str) -> Result<(), semver::Error> { Version::parse(version)?; Ok(()) } + +#[allow(unused_imports)] +mod test { + use serde_json::json; + + use crate::{dscerror::DscError, dscresources::resource_manifest::{import_manifest, ResourceManifest}, schemas::DscRepoSchema}; + + #[test] + fn test_validate_schema_uri_with_invalid_uri() { + let invalid_uri = "https://invalid.schema.uri".to_string(); + + let manifest = ResourceManifest{ + schema_version: invalid_uri.clone(), + resource_type: "Microsoft.Dsc.Test/InvalidSchemaUri".to_string(), + version: "0.1.0".to_string(), + ..Default::default() + }; + + let ref result = manifest.validate_schema_uri(); + + assert!(result.as_ref().is_err()); + + match result.as_ref().unwrap_err() { + DscError::UnrecognizedSchemaUri(actual, recognized) => { + assert_eq!(actual, &invalid_uri); + assert_eq!(recognized, &ResourceManifest::recognized_schema_uris()) + }, + _ => { + panic!("Expected validate_schema_uri() to error on unrecognized schema uri, but was {:?}", result.as_ref().unwrap_err()) + } + } + } + + #[test] + fn test_validate_schema_uri_with_valid_uri() { + let manifest = ResourceManifest{ + schema_version: ResourceManifest::default_schema_id_uri(), + resource_type: "Microsoft.Dsc.Test/ValidSchemaUri".to_string(), + version: "0.1.0".to_string(), + ..Default::default() + }; + + let result = manifest.validate_schema_uri(); + + assert!(result.is_ok()); + } +} diff --git a/dsc_lib/src/schemas/mod.rs b/dsc_lib/src/schemas/mod.rs index 7a1f0b20..511c41a9 100644 --- a/dsc_lib/src/schemas/mod.rs +++ b/dsc_lib/src/schemas/mod.rs @@ -2,6 +2,8 @@ use schemars::{schema::{Metadata, Schema}, JsonSchema}; +use crate::dscerror::DscError; + /// Defines the URI prefix for the hosted schemas. /// /// While the schemas are currently hosted in the GitHub repository, DSC provides the shortened @@ -447,6 +449,26 @@ pub trait DscRepoSchema : JsonSchema { Self::SCHEMA_SHOULD_BUNDLE ) } + + /// Indicates whether a given string is a recognized shema URI. + fn is_recognized_schema_uri(uri: &String) -> bool { + Self::recognized_schema_uris().contains(uri) + } + + /// Validates the `$schema` keyword for deserializing instances. + /// + /// This method simplifies the validation of a type that has the `$schema` keyword and expects + /// that instances of the type in data indicate which schema version DSC should use to validate + /// them. + /// + /// This method includes a default implementation to avoid requiring the implementation for + /// types that don't define the `$schema` keyword in their serialized form. + /// + /// Any DSC type that serializes with the `$schema` keyword **must** define this + /// method to actually validate the instance. + fn validate_schema_uri(&self) -> Result<(), DscError> { + Ok(()) + } } #[allow(unused_imports)] From 448b89b3e3f529183fefa1f4f9a8a3c6f1fc92d2 Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Tue, 25 Feb 2025 13:31:25 -0600 Subject: [PATCH 08/11] (GH-642) Document schema URI publishing and update manifest/config ref This change drafts a new reference document that explains how the DSC schemas are published, the URIs DSC recognizes for those schemas, and updates the documentation for the resource manifest and configuration document schemas with the updated context. A future change will address updating the rest of the reference documentation. --- docs/reference/schemas/config/document.md | 78 ++- .../schemas/resource/manifest/root.md | 44 +- docs/reference/schemas/schema-uris.md | 650 ++++++++++++++++++ 3 files changed, 724 insertions(+), 48 deletions(-) create mode 100644 docs/reference/schemas/schema-uris.md diff --git a/docs/reference/schemas/config/document.md b/docs/reference/schemas/config/document.md index 447e51b0..eb378dba 100644 --- a/docs/reference/schemas/config/document.md +++ b/docs/reference/schemas/config/document.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for a Desired State Configuration document. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Configuration document schema reference --- @@ -15,7 +15,7 @@ The YAML or JSON file that defines a DSC Configuration. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json Type: object ``` @@ -29,7 +29,14 @@ A configuration document can be defined as either YAML or JSON. For ease of auth recommends drafting configuration documents in YAML. For DSC's authoring tools to recognize a file as a DSC Configuration document, the filename must -end with `.dsc.config.json`, `.dsc.config.yml`, or `.dsc.config.yaml`. +end with one of the following: + +- `.dsc.config.json` +- `.dsc.config.yml` +- `.dsc.config.yaml`. +- `.dsc.json` +- `.dsc.yml` +- `.dsc.yaml` You can use configuration document functions to dynamically determine values in the document at runtime. For more information, see [DSC Configuration document functions reference][01] @@ -46,29 +53,23 @@ The rest of this document describes the schema DSC uses to validation configurat Every configuration document must include these properties: -- [$schema] -- [resources] +- [$schema](#schema) +- [resources](#resources) ## Properties ### $schema -The `$schema` property indicates the canonical URL for the version of this schema that the document -adheres to. DSC uses this property when validating the configuration document before any -configuration operations. - -There are currently 3 published versions of the schema, compatible with different versions of DSC: - -- `2024/04` is the latest version of the schema, compatible with DSC version 3.0.0-preview.7 and - later. -- `2023/10` is the previous version of the schema, compatible with DSC versions `3.0.0-alpha.4` and - `3.0.0-alpha.5`. -- `2023/08` is the first version of the schema, compatible with DSC versions `3.0.0-alpha.1` through - `3.0.0-alpha.3`. +The `$schema` property indicates the URI that resolves to the version of this schema that the +document adheres to. DSC uses this property when validating and processing the configuration +document. -This documentation is for the latest version of the schema. You should update your configuration -documents and resource manifests to the latest version of the schema. Prior versions don't work -with new releases of DSC. The schemas remain published, but won't get any updates. +The JSON schemas for DSC are published in multiple versions and forms. This documentation is for +the latest version of the schema. As a convenience, you can specify either the full URI for the +schema hosted in GitHub or use the shorter `aka.ms` URI. You can specify the schema for a specific +semantic version, the latest schema for a minor version, or the latest schema for a major version +of DSC. For more information about schema URIs and versioning, see +[DSC JSON Schema URIs](../schema-uris.md). For every version of the schema, there are three valid urls: @@ -79,12 +80,12 @@ For every version of the schema, there are three valid urls: - `.../bundled/config/document.json` - The URL to the bundled schema. When it's used for validation, the validating client only needs to - retrieve this schema. + The URL to the canonically bundled schema. When it's used for validation, the validating client + only needs to retrieve this schema. This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can still validate the document when it uses this schema, other tools may error or behave in unexpected - ways. + ways if they don't fully support the 2020-12 specification. - `.../bundled/config/document.vscode.json` @@ -100,15 +101,24 @@ Type: string Required: true Format: URI ValidValues: [ - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.vscode.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.vscode.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.vscode.json + https://aka.ms/dsc/schemas/v3/config/document.json + https://aka.ms/dsc/schemas/v3/bundled/config/document.json + https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json + https://aka.ms/dsc/schemas/v3.0/config/document.json + https://aka.ms/dsc/schemas/v3.0/bundled/config/document.json + https://aka.ms/dsc/schemas/v3.0/bundled/config/document.vscode.json + https://aka.ms/dsc/schemas/v3.0.0/config/document.json + https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.json + https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.vscode.json ] ``` @@ -142,7 +152,7 @@ For more information about defining parameters in a configuration, see ```yaml Type: object Required: false -ValidPropertySchema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.parameter.json +ValidPropertySchema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.parameter.json ``` ### variables @@ -178,7 +188,7 @@ For more information about defining a valid resource instance in a configuration Type: array Required: true MinimumItemCount: 1 -ValidItemSchema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.resource.json +ValidItemSchema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json ``` diff --git a/docs/reference/schemas/resource/manifest/root.md b/docs/reference/schemas/resource/manifest/root.md index 04f3871f..28f42694 100644 --- a/docs/reference/schemas/resource/manifest/root.md +++ b/docs/reference/schemas/resource/manifest/root.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for a DSC Resource manifest -ms.date: 06/24/2024 +ms.date: 02/28/2025 ms.topic: reference title: Command-based DSC Resource manifest schema reference --- @@ -15,7 +15,7 @@ The data file that defines a command-based DSC Resource. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json Type: object ``` @@ -48,6 +48,13 @@ The `$schema` property indicates the canonical URI of this schema that the manif against. This property is mandatory. DSC uses this value to validate the manifest against the correct JSON schema. +The JSON schemas for DSC are published in multiple versions and forms. This documentation is for +the latest version of the schema. As a convenience, you can specify either the full URI for the +schema hosted in GitHub or use the shorter `aka.ms` URI. You can specify the schema for a specific +semantic version, the latest schema for a minor version, or the latest schema for a major version +of DSC. For more information about schema URIs and versioning, see +[DSC JSON Schema URIs](../schema-uris.md). + For every version of the schema, there are three valid urls: - `.../resource/manifest.json` @@ -57,12 +64,12 @@ For every version of the schema, there are three valid urls: - `.../bundled/resource/manifest.json` - The URL to the bundled schema. When it's used for validation, the validating client only needs to - retrieve this schema. + The URL to the canonically bundled schema. When it's used for validation, the validating client + only needs to retrieve this schema. This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can still validate the document when it uses this schema, other tools may error or behave in unexpected - ways. + ways if they don't fully support the 2020-12 specification. - `.../bundled/resource/manifest.vscode.json` @@ -78,15 +85,24 @@ Type: string Required: true Format: URI ValidValues: [ - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.vscode.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json - https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.vscode.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.vscode.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json + https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.vscode.json + https://aka.ms/dsc/schemas/v3/resource/manifest.json + https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json + https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.vscode.json + https://aka.ms/dsc/schemas/v3.0/resource/manifest.json + https://aka.ms/dsc/schemas/v3.0/bundled/resource/manifest.json + https://aka.ms/dsc/schemas/v3.0/bundled/resource/manifest.vscode.json + https://aka.ms/dsc/schemas/v3.0.0/resource/manifest.json + https://aka.ms/dsc/schemas/v3.0.0/bundled/resource/manifest.json + https://aka.ms/dsc/schemas/v3.0.0/bundled/resource/manifest.vscode.json ] ``` diff --git a/docs/reference/schemas/schema-uris.md b/docs/reference/schemas/schema-uris.md new file mode 100644 index 00000000..32bb47b8 --- /dev/null +++ b/docs/reference/schemas/schema-uris.md @@ -0,0 +1,650 @@ +--- +description: Reference for how DSC schemas are versioned and published and the URIs used to retrieve them. +ms.date: 02/28/2025 +ms.topic: reference +title: DSC JSON Schema URIs +--- + +# DSC JSON Schema URIs + +This document describes how the JSON Schemas are versioned and published for the Microsoft Desired +State Configuration (DSC) platform. + +DSC uses JSON schemas extensively to describe and validate the data that it takes as input and +returns as output. To ensure compatibility and simplify the user experience, DSC schemas are +published in multiple versions and forms. + +The URIs for DSC schemas use the following syntax: + +```syntax +///. +``` + +## Schema URI prefixes + +The schemas for DSC are hosted in the `schemas` folder of the DSC repository. The URI prefix for +accessing the schemas in GitHub is `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas`. + +However, DSC also provides short links for every schema URI. When using the short link to a schema, +the URI prefix is `https://aka.ms/dsc/schemas`. + +You can use either prefix in your configuration documents, resource manifests, or when retrieving +the schemas programmatically. + +## Schema Versioning + +DSC uses [semantic versioning](https://semver.org) and aligns the version of the CLI, the platform, +and the JSON schemas. A non-prerelease semantic version includes three segments: + +```syntax +.. +``` + +- When the next release of DSC contains only fixes, not improvements or breaking changes, the + `patch` segment increments by one. +- When the next release of DSC contains any improvements and doesn't include any breaking changes, + the `minor` segment increments by one. +- When the next release of DSC contains any breaking changes, the `major` segment of the version + increments by one. + +### Version folders + +For every release of DSC, the schemas are published to three versioned folders: + +- `v..` - The full semantic version folder. This folder is unique to each + release. +- `v.` - The minor version folder for the current major version. The schemas in this + folder are always for the latest patch release of that minor version. +- `v` - The major version folder. The schemas in this folder are always for the latest + release of that major version. + +To illustrate the versioning, the following table shows which folders the schemas for each release +publish to. Entries in the table with an asterisk suffix (`*`) indicate that the entry is the +latest schema for that version folder. + +| Release | Major version folder | Minor version folder | Full version folder | +|:-------:|:--------------------:|:--------------------:|:-------------------:| +| `3.0.0` | `v3` | `v3.0` | `v3.0.0*` | +| `3.0.1` | `v3` | `v3.0*` | `v3.0.1*` | +| `3.1.0` | `v3` | `v3.1` | `v3.1.0*` | +| `3.1.1` | `v3*` | `v3.1*` | `v3.1.1*` | + +### Pinning to a version folder + +Publishing the schemas under multiple version folders enables you to choose which version you want +to use for your resource manifests, configuration documents, and integrating tools. + +If you pin to a full semantic version folder, like `v3.0.0`, you're pinning to schemas that won't +change. However, to take advantage of any improvements or fixes to the schemas, you'll need to +update the URI with each release. + +If you pin to a minor version folder, like `v3.0`, the schemas you use will update with every patch +release. This enables you to take advantage of fixes to the schemas without continually updating +your schema URIs. However, to take advantage of any improvements or new features, you'll need to +update the URI whenever a new minor version is released. + +If you pin to a major version folder, like `v3`, the schemas you use will update with every +non-breaking release. You can use those schemas until you want or need to migrate to a new major +version of DSC. + +Microsoft recommends that the majority of users pin to the major version folder for ease of use. If +you're an integrating developer or a resource author, consider pinning to a specific minor version +to indicate that your resource or software hasn't been updated to take advantage of new features. + +## Schema forms + +The schemas for DSC are always published in their canonical form, where the schema lives at its own +URI. Schemas for top-level items, like configuration documents, resource manifests, and the output +types for DSC, are also published in their canonically bundled form and in their enhanced authoring +form. + +All JSON schemas published for DSC use the [2020-12 JSON Schema Specification][xx] unless otherwise +noted, regardless of their form. + +The canonical (non-bundled) form schemas don't have a prefix folder for their path. They always use +the `.json` file extension for their URI. For example, the URI for the canonical schema describing +a resource manifest is `//resource/manifest.json`. The `$id` keyword +for every schema is always set to the canonical form of the schema for that version folder and uses +the GitHub URI prefix. This ensures that the schemas can always be correctly resolved by reference. + +The canonically bundled form schemas are placed in the `bundled` prefix folder for their path. They +always use the `.json` file extension for their URI. For example, the URI for the canonically +bundled schema describing a resource manifest is +`//bundled/resource/manifest.json`. + +The enhanced authoring form for schemas are placed in the `bundled` prefix folder for their path. +They always use the `.vscode.json` file extension for their URI. For example, the URI for the +enhanced authoring schema describing a resource manifest is +`//bundled/resource/manifest.vscode.json`. + +The following table illustrates these differences between schema forms: + +| Schema form | Prefix folder | File extension | +|:------------------------|:-------------:|:--------------:| +| Canonical (non-bundled) | _None_ | `.json` | +| Canonically bundled | `bundled` | `.json` | +| Enhanced autoring | `bundled` | `.vscode.json` | + +### Canonical (non-bundled) schemas + +The canonical form for each schema describes a single type for DSC. If the schema references any +other DSC types with the [$ref keyword](), those references are site-relative. Publishing the +schemas in this format enables users and developers to select only the schemas for the data types +they want to use without needing to download or handle other schemas they may not require. + +While DSC is able to validate any of its data without network connectivity, be aware that using the +canonical non-bundled form for a schema may require more than one network call to retrieve any +references schemas. To minimize the number of network operations, use the canonically bundled form +for the schema instead. + +### Canonically bundled schemas + +Not every DSC schema is available in the +[canonically bundled](https://json-schema.org/blog/posts/bundling-json-schema-compound-documents) +form. Only top-level schemas, like configuration documents, resource manifests, and DSC's output, +are published in this form. + +Canonically bundled schemas generally reference numerous other schemas with the [$ref keyword](). +As with the non-bundled form, these references are site-relative. Unlike the non-bundled form, +the bundled form recursively includes every referenced schema in the `$defs` keyword. + +The `$defs` keyword is always an object. For canonically bundled schemas, every key is the +canonical URI to a referenced schema. The value for each key is the schema object hosted at that +URI. Each of the schemas bundled in the `$defs` keyword always defines both the `$id` keyword and +the `$schema` keyword. + +### Enhanced authoring schemas + +Every DSC Schema published in the canonically bundled form is also published in the enhanced +authoring form. These schemas leverage the extended vocabulary that VS Code recognizes for JSON +Schemas to provide improved IntelliSense, hover documentation, error messaging, and default +snippets. These schemas make it easier to author, edit, and review your configuration documents, +resource manifests, and DSC's output in VS Code. + +These schemas validate the data with the same vocabulary as the canonical forms of the schema. They +only affect the experience for authoring, editing, and reviewing the data in VS Code. + +These JSON Schemas are _not_ canonical. They use a vocabulary that most JSON Schema libraries and +tools don't understand. In most cases, using these schemas with those tools should not raise any +errors. However, when you want to use the DSC schemas with tools other than VS Code, you should +consider using the canonically bundled form of the schema instead. + +## Bundled schema URIs list + +This section enumerates every schema published in the canonically bundled form for DSC and the URIs +recognized for each schema. + + + +### Configuration document schema + +The following table defines the value of the `$id` keyword for each published version of the +configuration document schema. The `$id` is the same across all forms of the schema and regardless of +the prefix URI used to retrieve the schema. + +| Version folder | ID | +|:---------------|:--------------------------------------------------------------------------------------------| +| `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json` | +| `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json` | +| `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json` | + +The following list of tables defines the recognized URIs for the configuration document schema: + +- Short URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://aka.ms/dsc/schemas/v3/config/document.json` | + | Canonical (non-bundled) | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/config/document.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/config/document.json` | + | Canonically bundled | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/config/document.json` | + | Canonically bundled | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/config/document.json` | + | Canonically bundled | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.json` | + | Enhanced AUthoring | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/config/document.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.vscode.json` | + +- GitHub URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:-----------------------------------------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json` | + | Canonical (non-bundled) | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json` | + | Canonically bundled | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.json` | + | Canonically bundled | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.json` | + | Canonically bundled | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.json` | + | Enhanced AUthoring | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.vscode.json` | + +### Resource manifest schema + +The following table defines the value of the `$id` keyword for each published version of the +resource manifest schema. The `$id` is the same across all forms of the schema and regardless of +the prefix URI used to retrieve the schema. + +| Version folder | ID | +|:---------------|:----------------------------------------------------------------------------------------------| +| `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json` | +| `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json` | +| `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json` | + +The following list of tables defines the recognized URIs for the resource manifest schema: + +- Short URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:--------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://aka.ms/dsc/schemas/v3/resource/manifest.json` | + | Canonical (non-bundled) | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/resource/manifest.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/resource/manifest.json` | + | Canonically bundled | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json` | + | Canonically bundled | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/resource/manifest.json` | + | Canonically bundled | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/resource/manifest.json` | + | Enhanced AUthoring | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/resource/manifest.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/resource/manifest.vscode.json` | + +- GitHub URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:-------------------------------------------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json` | + | Canonical (non-bundled) | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json` | + | Canonically bundled | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json` | + | Canonically bundled | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json` | + | Canonically bundled | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json` | + | Enhanced AUthoring | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.vscode.json` | + +### Output schema for dsc config get command + +The following table defines the value of the `$id` keyword for each published version of the output +schema for the `dsc config get` command. The `$id` is the same across all forms of the schema and +regardless of the prefix URI used to retrieve the schema. + +| Version folder | ID | +|:---------------|:----------------------------------------------------------------------------------------------| +| `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/get.json` | +| `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/get.json` | +| `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/get.json` | + +The following list of tables defines the recognized URIs for the output schema: + +- Short URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:--------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://aka.ms/dsc/schemas/v3/outputs/config/get.json` | + | Canonical (non-bundled) | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/outputs/config/get.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/outputs/config/get.json` | + | Canonically bundled | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/config/get.json` | + | Canonically bundled | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/config/get.json` | + | Canonically bundled | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/config/get.json` | + | Enhanced AUthoring | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/config/get.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/config/get.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/config/get.vscode.json` | + +- GitHub URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:-------------------------------------------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/get.json` | + | Canonical (non-bundled) | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/get.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/get.json` | + | Canonically bundled | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/config/get.json` | + | Canonically bundled | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/config/get.json` | + | Canonically bundled | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/config/get.json` | + | Enhanced AUthoring | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/config/get.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/config/get.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/config/get.vscode.json` | + +### Output schema for dsc config set command + +The following table defines the value of the `$id` keyword for each published version of the output +schema for the `dsc config set` command. The `$id` is the same across all forms of the schema and +regardless of the prefix URI used to retrieve the schema. + +| Version folder | ID | +|:---------------|:----------------------------------------------------------------------------------------------| +| `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/set.json` | +| `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/set.json` | +| `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/set.json` | + +The following list of tables defines the recognized URIs for the output schema: + +- Short URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:--------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://aka.ms/dsc/schemas/v3/outputs/config/set.json` | + | Canonical (non-bundled) | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/outputs/config/set.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/outputs/config/set.json` | + | Canonically bundled | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/config/set.json` | + | Canonically bundled | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/config/set.json` | + | Canonically bundled | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/config/set.json` | + | Enhanced AUthoring | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/config/set.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/config/set.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/config/set.vscode.json` | + +- GitHub URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:-------------------------------------------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/set.json` | + | Canonical (non-bundled) | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/set.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/set.json` | + | Canonically bundled | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/config/set.json` | + | Canonically bundled | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/config/set.json` | + | Canonically bundled | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/config/set.json` | + | Enhanced AUthoring | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/config/set.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/config/set.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/config/set.vscode.json` | + +### Output schema for dsc config test command + +The following table defines the value of the `$id` keyword for each published version of the output +schema for the `dsc config test` command. The `$id` is the same across all forms of the schema and +regardless of the prefix URI used to retrieve the schema. + +| Version folder | ID | +|:---------------|:----------------------------------------------------------------------------------------------| +| `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/test.json` | +| `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/test.json` | +| `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/test.json` | + +The following list of tables defines the recognized URIs for the output schema: + +- Short URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:--------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://aka.ms/dsc/schemas/v3/outputs/config/test.json` | + | Canonical (non-bundled) | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/outputs/config/test.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/outputs/config/test.json` | + | Canonically bundled | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/config/test.json` | + | Canonically bundled | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/config/test.json` | + | Canonically bundled | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/config/test.json` | + | Enhanced AUthoring | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/config/test.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/config/test.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/config/test.vscode.json` | + +- GitHub URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:-------------------------------------------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/config/test.json` | + | Canonical (non-bundled) | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/config/test.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/test.json` | + | Canonically bundled | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/config/test.json` | + | Canonically bundled | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/config/test.json` | + | Canonically bundled | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/config/test.json` | + | Enhanced AUthoring | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/config/test.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/config/test.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/config/test.vscode.json` | + + +### Output schema for dsc resource get command + +The following table defines the value of the `$id` keyword for each published version of the output +schema for the `dsc resource get` command. The `$id` is the same across all forms of the schema and +regardless of the prefix URI used to retrieve the schema. + +| Version folder | ID | +|:---------------|:----------------------------------------------------------------------------------------------| +| `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json` | +| `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json` | +| `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json` | + +The following list of tables defines the recognized URIs for the output schema: + +- Short URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:--------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://aka.ms/dsc/schemas/v3/outputs/resource/get.json` | + | Canonical (non-bundled) | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/outputs/resource/get.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/outputs/resource/get.json` | + | Canonically bundled | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/resource/get.json` | + | Canonically bundled | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/resource/get.json` | + | Canonically bundled | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/resource/get.json` | + | Enhanced AUthoring | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/resource/get.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/resource/get.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/resource/get.vscode.json` | + +- GitHub URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:-------------------------------------------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/get.json` | + | Canonical (non-bundled) | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/get.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json` | + | Canonically bundled | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/resource/get.json` | + | Canonically bundled | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/resource/get.json` | + | Canonically bundled | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/resource/get.json` | + | Enhanced AUthoring | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/resource/get.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/resource/get.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/resource/get.vscode.json` | + +### Output schema for dsc resource list command + +The following table defines the value of the `$id` keyword for each published version of the output +schema for the `dsc resource list` command. The `$id` is the same across all forms of the schema and +regardless of the prefix URI used to retrieve the schema. + +| Version folder | ID | +|:---------------|:----------------------------------------------------------------------------------------------| +| `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/list.json` | +| `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/list.json` | +| `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/list.json` | + +The following list of tables defines the recognized URIs for the output schema: + +- Short URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:--------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://aka.ms/dsc/schemas/v3/outputs/resource/list.json` | + | Canonical (non-bundled) | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/outputs/resource/list.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/outputs/resource/list.json` | + | Canonically bundled | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/resource/list.json` | + | Canonically bundled | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/resource/list.json` | + | Canonically bundled | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/resource/list.json` | + | Enhanced AUthoring | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/resource/list.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/resource/list.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/resource/list.vscode.json` | + +- GitHub URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:-------------------------------------------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/list.json` | + | Canonical (non-bundled) | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/list.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/list.json` | + | Canonically bundled | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/resource/list.json` | + | Canonically bundled | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/resource/list.json` | + | Canonically bundled | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/resource/list.json` | + | Enhanced AUthoring | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/resource/list.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/resource/list.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/resource/list.vscode.json` | + + +### Output schema for dsc resource schema command + +The following table defines the value of the `$id` keyword for each published version of the output +schema for the `dsc resource schema` command. The `$id` is the same across all forms of the schema and +regardless of the prefix URI used to retrieve the schema. + +| Version folder | ID | +|:---------------|:----------------------------------------------------------------------------------------------| +| `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/schema.json` | +| `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/schema.json` | +| `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/schema.json` | + +The following list of tables defines the recognized URIs for the output schema: + +- Short URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:--------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://aka.ms/dsc/schemas/v3/outputs/resource/schema.json` | + | Canonical (non-bundled) | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/outputs/resource/schema.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/outputs/resource/schema.json` | + | Canonically bundled | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/resource/schema.json` | + | Canonically bundled | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/resource/schema.json` | + | Canonically bundled | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/resource/schema.json` | + | Enhanced AUthoring | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/resource/schema.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/resource/schema.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/resource/schema.vscode.json` | + +- GitHub URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:-------------------------------------------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/schema.json` | + | Canonical (non-bundled) | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/schema.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/schema.json` | + | Canonically bundled | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/resource/schema.json` | + | Canonically bundled | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/resource/schema.json` | + | Canonically bundled | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/resource/schema.json` | + | Enhanced AUthoring | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/resource/schema.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/resource/schema.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/resource/schema.vscode.json` | + + +### Output schema for dsc resource set command + +The following table defines the value of the `$id` keyword for each published version of the output +schema for the `dsc resource set` command. The `$id` is the same across all forms of the schema and +regardless of the prefix URI used to retrieve the schema. + +| Version folder | ID | +|:---------------|:----------------------------------------------------------------------------------------------| +| `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json` | +| `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json` | +| `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json` | + +The following list of tables defines the recognized URIs for the output schema: + +- Short URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:--------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://aka.ms/dsc/schemas/v3/outputs/resource/set.json` | + | Canonical (non-bundled) | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/outputs/resource/set.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/outputs/resource/set.json` | + | Canonically bundled | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/resource/set.json` | + | Canonically bundled | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/resource/set.json` | + | Canonically bundled | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/resource/set.json` | + | Enhanced AUthoring | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/resource/set.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/resource/set.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/resource/set.vscode.json` | + +- GitHub URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:-------------------------------------------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/set.json` | + | Canonical (non-bundled) | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/set.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json` | + | Canonically bundled | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/resource/set.json` | + | Canonically bundled | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/resource/set.json` | + | Canonically bundled | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/resource/set.json` | + | Enhanced AUthoring | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/resource/set.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/resource/set.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/resource/set.vscode.json` | + +### Output schema for dsc resource test command + +The following table defines the value of the `$id` keyword for each published version of the output +schema for the `dsc resource test` command. The `$id` is the same across all forms of the schema and +regardless of the prefix URI used to retrieve the schema. + +| Version folder | ID | +|:---------------|:----------------------------------------------------------------------------------------------| +| `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json` | +| `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json` | +| `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json` | + +The following list of tables defines the recognized URIs for the output schema: + +- Short URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:--------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://aka.ms/dsc/schemas/v3/outputs/resource/test.json` | + | Canonical (non-bundled) | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/outputs/resource/test.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/outputs/resource/test.json` | + | Canonically bundled | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/resource/test.json` | + | Canonically bundled | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/resource/test.json` | + | Canonically bundled | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/resource/test.json` | + | Enhanced AUthoring | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/resource/test.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/resource/test.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/resource/test.vscode.json` | + +- GitHub URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:-------------------------------------------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/resource/test.json` | + | Canonical (non-bundled) | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/resource/test.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json` | + | Canonically bundled | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/resource/test.json` | + | Canonically bundled | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/resource/test.json` | + | Canonically bundled | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/resource/test.json` | + | Enhanced AUthoring | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/resource/test.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/resource/test.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/resource/test.vscode.json` | + +### Output schema for dsc schema command + +The following table defines the value of the `$id` keyword for each published version of the output +schema for the `dsc schema` command. The `$id` is the same across all forms of the schema and +regardless of the prefix URI used to retrieve the schema. + +| Version folder | ID | +|:---------------|:----------------------------------------------------------------------------------------------| +| `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/schema.json` | +| `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/schema.json` | +| `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/schema.json` | + +The following list of tables defines the recognized URIs for the output schema: + +- Short URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:--------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://aka.ms/dsc/schemas/v3/outputs/schema.json` | + | Canonical (non-bundled) | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/outputs/schema.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/outputs/schema.json` | + | Canonically bundled | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/schema.json` | + | Canonically bundled | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/schema.json` | + | Canonically bundled | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/schema.json` | + | Enhanced AUthoring | `v3` | `https://aka.ms/dsc/schemas/v3/bundled/outputs/schema.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://aka.ms/dsc/schemas/v3.0/bundled/outputs/schema.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://aka.ms/dsc/schemas/v3.0.0/bundled/outputs/schema.vscode.json` | + +- GitHub URIs by version and form: + + | Form | Version | Recognized URI | + |:------------------------|:---------|:-------------------------------------------------------------------------------------------------------------| + | Canonical (non-bundled) | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/outputs/schema.json` | + | Canonical (non-bundled) | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/outputs/schema.json` | + | Canonical (non-bundled) | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/schema.json` | + | Canonically bundled | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/schema.json` | + | Canonically bundled | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/schema.json` | + | Canonically bundled | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/schema.json` | + | Enhanced AUthoring | `v3` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/outputs/schema.vscode.json` | + | Enhanced AUthoring | `v3.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/outputs/schema.vscode.json` | + | Enhanced AUthoring | `v3.0.0` | `https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/outputs/schema.vscode.json` | From b2bacf6a456fcd14289ae874e28ff20189131094 Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Tue, 25 Feb 2025 13:32:29 -0600 Subject: [PATCH 09/11] (GH-642) Update reference docs for v3 schemas This change updates the reference documentation to align with the new schema URIs and the changes to the enumeration and struct casing. --- docs/reference/cli/config/get.md | 6 +-- docs/reference/cli/config/set.md | 6 +-- docs/reference/cli/config/test.md | 6 +-- docs/reference/cli/resource/list.md | 24 ++++----- docs/reference/cli/schema/command.md | 18 ++++++- .../reference/schemas/config/functions/add.md | 6 +-- .../schemas/config/functions/base64.md | 6 +-- .../schemas/config/functions/concat.md | 6 +-- .../schemas/config/functions/createArray.md | 8 +-- .../reference/schemas/config/functions/div.md | 6 +-- .../schemas/config/functions/envvar.md | 4 +- .../reference/schemas/config/functions/int.md | 4 +- .../reference/schemas/config/functions/max.md | 6 +-- .../reference/schemas/config/functions/min.md | 6 +-- .../reference/schemas/config/functions/mod.md | 6 +-- .../reference/schemas/config/functions/mul.md | 6 +-- .../schemas/config/functions/overview.md | 20 +++---- .../schemas/config/functions/parameters.md | 4 +- .../schemas/config/functions/reference.md | 4 +- .../schemas/config/functions/resourceId.md | 8 +-- .../reference/schemas/config/functions/sub.md | 4 +- .../schemas/config/functions/variables.md | 4 +- docs/reference/schemas/config/metadata.md | 6 +-- docs/reference/schemas/config/parameter.md | 4 +- docs/reference/schemas/config/resource.md | 4 +- docs/reference/schemas/definitions/message.md | 6 +-- .../definitions/parameters/dataTypes.md | 4 +- .../schemas/definitions/resourceKind.md | 54 ++++++++++--------- .../schemas/definitions/resourceType.md | 4 +- .../metadata/Microsoft.DSC/properties.md | 16 +++--- docs/reference/schemas/outputs/config/get.md | 4 +- docs/reference/schemas/outputs/config/set.md | 4 +- docs/reference/schemas/outputs/config/test.md | 4 +- .../reference/schemas/outputs/resource/get.md | 4 +- .../schemas/outputs/resource/list.md | 41 ++++++++------ .../reference/schemas/outputs/resource/set.md | 4 +- .../schemas/outputs/resource/test.md | 4 +- .../schemas/resource/manifest/adapter.md | 4 +- .../schemas/resource/manifest/delete.md | 4 +- .../schemas/resource/manifest/export.md | 4 +- .../schemas/resource/manifest/get.md | 4 +- .../schemas/resource/manifest/resolve.md | 4 +- .../resource/manifest/schema/embedded.md | 20 +++---- .../resource/manifest/schema/property.md | 4 +- .../schemas/resource/manifest/set.md | 4 +- .../schemas/resource/manifest/test.md | 4 +- .../schemas/resource/manifest/validate.md | 4 +- .../schemas/resource/manifest/whatif.md | 4 +- .../schemas/resource/properties/exist.md | 18 ++++--- .../resource/properties/inDesiredState.md | 16 +++--- .../schemas/resource/properties/overview.md | 15 +++--- .../schemas/resource/properties/purge.md | 8 +-- .../resource/properties/rebootRequested.md | 14 ++--- 53 files changed, 248 insertions(+), 214 deletions(-) diff --git a/docs/reference/cli/config/get.md b/docs/reference/cli/config/get.md index ee78b0ea..34a2bc5d 100644 --- a/docs/reference/cli/config/get.md +++ b/docs/reference/cli/config/get.md @@ -1,6 +1,6 @@ --- description: Command line reference for the 'dsc config get' command -ms.date: 06/24/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc config get --- @@ -49,12 +49,12 @@ document saved as `example.dsc.config.yaml`. ```yaml # example.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Windows only type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo diff --git a/docs/reference/cli/config/set.md b/docs/reference/cli/config/set.md index 307137e8..19549bc2 100644 --- a/docs/reference/cli/config/set.md +++ b/docs/reference/cli/config/set.md @@ -1,6 +1,6 @@ --- description: Command line reference for the 'dsc config set' command -ms.date: 06/24/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc config set --- @@ -50,12 +50,12 @@ The command inspects the resource instances defined in the configuration documen ```yaml # example.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Windows only type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo diff --git a/docs/reference/cli/config/test.md b/docs/reference/cli/config/test.md index 9d5df35c..26cbabb2 100644 --- a/docs/reference/cli/config/test.md +++ b/docs/reference/cli/config/test.md @@ -1,6 +1,6 @@ --- description: Command line reference for the 'dsc config test' command -ms.date: 06/24/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc config test --- @@ -49,12 +49,12 @@ resource instances defined in the configuration document saved as `example.dsc.c ```yaml # example.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Windows only type: Microsoft.DSC/Assertion properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo diff --git a/docs/reference/cli/resource/list.md b/docs/reference/cli/resource/list.md index b4f1e3be..bef65e46 100644 --- a/docs/reference/cli/resource/list.md +++ b/docs/reference/cli/resource/list.md @@ -1,6 +1,6 @@ --- description: Command line reference for the 'dsc resource list' command -ms.date: 06/24/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc resource list --- @@ -309,24 +309,24 @@ a summary table for the returned resources. The summary table includes the follo displayed in the listed order: - **Type** - The fully qualified type name of the resource. -- **Kind** - Whether the resource is an `Adapter`, `Group`, or typical `Resource`. For more - information, see [DSC Resource kind schema reference][03]. +- **Kind** - Whether the resource is an `adapter`, `group`, `importer`, or typical `Resource`. For + more information, see [DSC Resource kind schema reference][03]. - **Version** - The semantic version of the resource. - **Caps** - A display of the resource's [capabilities][04] as flags. The capabilities are displayed in the following order, using a `-` instead of the appropriate letter if the resource doesn't have a specific capability: - - `g` indicates that the resource has the [Get capability][05]. - - `s` indicates that the resource has the [Set capability][06] - - `x` indicates that the resource has the [SetHandlesExist capability][07] - - `w` indicates that the resource has the [WhatIf capability][08] - - `t` indicates that the resource has the [Test capability][09] - - `d` indicates that the resource has the [Delete capability][10] - - `e` indicates that the resource has the [Export capability][11] - - `r` indicates that the resource has the [Resolve capability][12] + - `g` indicates that the resource has the [get capability][05]. + - `s` indicates that the resource has the [set capability][06] + - `x` indicates that the resource has the [setHandlesExist capability][07] + - `w` indicates that the resource has the [whatIf capability][08] + - `t` indicates that the resource has the [test capability][09] + - `d` indicates that the resource has the [delete capability][10] + - `e` indicates that the resource has the [export capability][11] + - `r` indicates that the resource has the [resolve capability][12] For example, the `Microsoft.Windows/Registry` resource has the following capabilities: `gs--d-`, - indicating it has the `Get`, `Set`, and `Delete` capabilities. + indicating it has the `get`, `set`, and `delete` capabilities. - **RequireAdapter** - The fully qualified type name of the adapter resource that DSC uses to invoke the returned resource. - **Description** - The short description of the resource's purpose and usage. diff --git a/docs/reference/cli/schema/command.md b/docs/reference/cli/schema/command.md index 343cd5cc..d744dbb9 100644 --- a/docs/reference/cli/schema/command.md +++ b/docs/reference/cli/schema/command.md @@ -1,6 +1,6 @@ --- description: Command line reference for the 'dsc schema' command -ms.date: 06/24/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc schema --- @@ -26,6 +26,22 @@ 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. +> [!NOTE] +> Currently, the schemas returned by the `dsc schema` command and those published to GitHub are +> not the same. The published schemas more fully describe and validate the data than the schemas +> emitted by the command. The DSC team is working to canonicalize the schemas returned from the +> command. +> +> Both the published schemas and those returned from this command correctly validate the data. The +> schemas returned from this command are less strict than the published schemas. Even though data +> validates against the schemas returned by this command, DSC may raise errors when processing the +> data. For example, the returned schema for versions indicates that the valid value is a string - +> but if you specify a string that isn't a semantic version, DSC raises an error. In that case, the +> data passed the schema validation but was incorrect. +> +> Until the schemas are canonicalized, consider using the published schemas when indpendently +> testing your configuration documents and resource manifests with a JSON Schema validation tool. + ## Examples ### Example 1 - Retrieve the schema for the dsc resource get command result diff --git a/docs/reference/schemas/config/functions/add.md b/docs/reference/schemas/config/functions/add.md index c624cfec..663b5133 100644 --- a/docs/reference/schemas/config/functions/add.md +++ b/docs/reference/schemas/config/functions/add.md @@ -1,6 +1,6 @@ --- description: Reference for the 'add' DSC configuration document function -ms.date: 03/19/2024 +ms.date: 02/28/2025 ms.topic: reference title: add --- @@ -30,7 +30,7 @@ This example document shows how you can use the `add()` function to return the s ```yaml # add.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Sum of 3 and 5 type: Test/Echo @@ -60,7 +60,7 @@ configuration functions that return integer values. ```yaml # add.example.2.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Add nested function outputs type: Test/Echo diff --git a/docs/reference/schemas/config/functions/base64.md b/docs/reference/schemas/config/functions/base64.md index 13dde543..69b1c29a 100644 --- a/docs/reference/schemas/config/functions/base64.md +++ b/docs/reference/schemas/config/functions/base64.md @@ -1,6 +1,6 @@ --- description: Reference for the 'base64' DSC configuration document function -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: base64 --- @@ -31,7 +31,7 @@ The configuration converts a basic string value with the `base64()` function. ```yaml # base64.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo 'abc' in base64 type: Test/Echo @@ -61,7 +61,7 @@ strings `a`, `b`, and `c` into `abc` before returning the base64 representation. ```yaml # base64.example.2.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo concatenated 'a', 'b', 'c' in base64 type: Test/Echo diff --git a/docs/reference/schemas/config/functions/concat.md b/docs/reference/schemas/config/functions/concat.md index 4bec08b7..5579da38 100644 --- a/docs/reference/schemas/config/functions/concat.md +++ b/docs/reference/schemas/config/functions/concat.md @@ -1,6 +1,6 @@ --- description: Reference for the 'concat' DSC configuration document function -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: concat --- @@ -35,7 +35,7 @@ The configuration uses the `concat()` function to join the strings `abc` and `de ```yaml # concat.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo 'abcdef' type: Test/Echo @@ -64,7 +64,7 @@ The configuration uses the `concat()` function to return a combined array of str ```yaml # concat.example.2.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo ['a', 'b', 'c', 'd', 'e', 'f'] type: Test/Echo diff --git a/docs/reference/schemas/config/functions/createArray.md b/docs/reference/schemas/config/functions/createArray.md index 384de1f3..e2c2fc68 100644 --- a/docs/reference/schemas/config/functions/createArray.md +++ b/docs/reference/schemas/config/functions/createArray.md @@ -1,6 +1,6 @@ --- description: Reference for the 'createArray' DSC configuration document function -ms.date: 04/09/2024 +ms.date: 02/28/2025 ms.topic: reference title: createArray --- @@ -33,7 +33,7 @@ example synopsis ```yaml # createArray.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo array of integers type: Test/Echo @@ -66,7 +66,7 @@ sub-array contains only integers. The second sub-array contains only strings. ```yaml # createArray.example.2.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Create array of arrays type: Test/Echo @@ -102,7 +102,7 @@ strings. It uses YAML's folded multiline string syntax to make the function more ```yaml # createArray.example.3.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo flattened array type: Test/Echo diff --git a/docs/reference/schemas/config/functions/div.md b/docs/reference/schemas/config/functions/div.md index 70683061..c2e86cf2 100644 --- a/docs/reference/schemas/config/functions/div.md +++ b/docs/reference/schemas/config/functions/div.md @@ -1,6 +1,6 @@ --- description: Reference for the 'div' DSC configuration document function -ms.date: 03/19/2024 +ms.date: 02/28/2025 ms.topic: reference title: div --- @@ -32,7 +32,7 @@ integers. ```yaml # div.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Dividing integers type: Test/Echo @@ -63,7 +63,7 @@ full integer value without the remainder. It doesn't round the result up to 3. ```yaml # div.example.2.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Dividing nested functions type: Test/Echo diff --git a/docs/reference/schemas/config/functions/envvar.md b/docs/reference/schemas/config/functions/envvar.md index fbbe7b08..6237e474 100644 --- a/docs/reference/schemas/config/functions/envvar.md +++ b/docs/reference/schemas/config/functions/envvar.md @@ -1,6 +1,6 @@ --- description: Reference for the 'envvar' DSC configuration document function -ms.date: 03/01/2024 +ms.date: 02/28/2025 ms.topic: reference title: envvar --- @@ -35,7 +35,7 @@ This configuration echoes that folder with the `Test/Echo` resource. ```yaml # ./examples/envvar.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo 'DSC_CONFIG_ROOT' in envvar type: Test/Echo diff --git a/docs/reference/schemas/config/functions/int.md b/docs/reference/schemas/config/functions/int.md index a1d54e4b..6f73a72d 100644 --- a/docs/reference/schemas/config/functions/int.md +++ b/docs/reference/schemas/config/functions/int.md @@ -1,6 +1,6 @@ --- description: Reference for the 'int' DSC configuration document function -ms.date: 06/13/2024 +ms.date: 02/28/2025 ms.topic: reference title: int --- @@ -31,7 +31,7 @@ This configuration returns an integer, converting the string value `'4.7'` to `4 ```yaml # int.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo integer value type: Test/Echo diff --git a/docs/reference/schemas/config/functions/max.md b/docs/reference/schemas/config/functions/max.md index b3fe2ec0..c66afdea 100644 --- a/docs/reference/schemas/config/functions/max.md +++ b/docs/reference/schemas/config/functions/max.md @@ -1,6 +1,6 @@ --- description: Reference for the 'max' DSC configuration document function -ms.date: 04/09/2024 +ms.date: 02/28/2025 ms.topic: reference title: max --- @@ -30,7 +30,7 @@ This configuration returns the largest number from a list of integers. ```yaml # max.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo maximum value type: Test/Echo @@ -61,7 +61,7 @@ function more readable. ```yaml # max.example.2.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo integer array type: Test/Echo diff --git a/docs/reference/schemas/config/functions/min.md b/docs/reference/schemas/config/functions/min.md index 4a80b0e0..5fbf4922 100644 --- a/docs/reference/schemas/config/functions/min.md +++ b/docs/reference/schemas/config/functions/min.md @@ -1,6 +1,6 @@ --- description: Reference for the 'min' DSC configuration document function -ms.date: 04/09/2024 +ms.date: 02/28/2025 ms.topic: reference title: min --- @@ -30,7 +30,7 @@ This configuration returns the smallest number from a list of integers. ```yaml # min.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo minimum value type: Test/Echo @@ -61,7 +61,7 @@ function more readable. ```yaml # min.example.2.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo integer array type: Test/Echo diff --git a/docs/reference/schemas/config/functions/mod.md b/docs/reference/schemas/config/functions/mod.md index d13c536b..3a5e6cc8 100644 --- a/docs/reference/schemas/config/functions/mod.md +++ b/docs/reference/schemas/config/functions/mod.md @@ -1,6 +1,6 @@ --- description: Reference for the 'mod' DSC configuration document function -ms.date: 03/19/2024 +ms.date: 02/28/2025 ms.topic: reference title: mod --- @@ -30,7 +30,7 @@ division for two integers. ```yaml # mod.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Remainder for integers type: Test/Echo @@ -60,7 +60,7 @@ two other mathematical operations. ```yaml # mod.example.2.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Remainder for nested functions type: Test/Echo diff --git a/docs/reference/schemas/config/functions/mul.md b/docs/reference/schemas/config/functions/mul.md index c750848b..1557f90d 100644 --- a/docs/reference/schemas/config/functions/mul.md +++ b/docs/reference/schemas/config/functions/mul.md @@ -1,6 +1,6 @@ --- description: Reference for the 'mul' DSC configuration document function -ms.date: 03/20/2024 +ms.date: 02/28/2025 ms.topic: reference title: mul --- @@ -30,7 +30,7 @@ This example document multiplies two integers to return a product for the output ```yaml # mul.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Multiplying integers type: Test/Echo @@ -59,7 +59,7 @@ This document shows how you can multiply the output of nested configuration func ```yaml # mul.example.2.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Multiplying nested function outputs type: Test/Echo diff --git a/docs/reference/schemas/config/functions/overview.md b/docs/reference/schemas/config/functions/overview.md index fa27a628..7281e82d 100644 --- a/docs/reference/schemas/config/functions/overview.md +++ b/docs/reference/schemas/config/functions/overview.md @@ -1,6 +1,6 @@ --- description: Reference for available functions in a Desired State Configuration document. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Configuration document functions reference --- @@ -107,7 +107,7 @@ the [base64()][base64] function. ```yaml # overview.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Double quoted syntax type: Test/Echo @@ -157,7 +157,7 @@ output of the [concat()][concat] function, combining the strings `a` and `b` int ```yaml # overview.example.2.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo the concatenated strings 'a' and 'b' type: Test/Echo @@ -190,7 +190,7 @@ nested functions shown in the third instance to base64. ```yaml # overview.example.3.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Echo the concatenated strings 'a' and 'b' as base64 type: Test/Echo @@ -301,7 +301,7 @@ can access an object's properties in a configuration document. ```yaml # overview.example.4.properties.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json # Minimal definition of the parameters parameters: data: { type: object } @@ -366,7 +366,7 @@ The next configuration document shows how you can access nested object propertie ```yaml # overview.example.4.nested.properties.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json # Minimal definition of the parameters parameters: data: { type: object } @@ -410,7 +410,7 @@ The following configuration document shows how you can access items in an array. ```yaml # overview.example.4.items.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json # Minimal definition of the parameters parameters: data: { type: object } @@ -469,7 +469,7 @@ The following configuration document shows how you can access items in a nested ```yaml # overview.example.4.nested.items.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json # Minimal definition of the parameters parameters: data: { type: object } @@ -512,7 +512,7 @@ together to access values in complex objects. ```yaml # overview.example.4.mixed.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json # Minimal definition of the parameters parameters: data: { type: object } @@ -541,7 +541,7 @@ dsc config --parameters-file $params get --path $config ``` ```yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json # Minimal definition of the parameters parameters: data: { type: object } diff --git a/docs/reference/schemas/config/functions/parameters.md b/docs/reference/schemas/config/functions/parameters.md index 86e0f10e..455dfaba 100644 --- a/docs/reference/schemas/config/functions/parameters.md +++ b/docs/reference/schemas/config/functions/parameters.md @@ -1,6 +1,6 @@ --- description: Reference for the 'parameters' DSC configuration document function -ms.date: 02/05/2024 +ms.date: 02/28/2025 ms.topic: reference title: parameters --- @@ -35,7 +35,7 @@ The configuration uses the `parameters()` function to echo the value of the `mes ```yaml # parameters.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json parameters: message: type: string diff --git a/docs/reference/schemas/config/functions/reference.md b/docs/reference/schemas/config/functions/reference.md index 9d007145..6499df6e 100644 --- a/docs/reference/schemas/config/functions/reference.md +++ b/docs/reference/schemas/config/functions/reference.md @@ -1,6 +1,6 @@ --- description: Reference for the 'reference' DSC configuration document function -ms.date: 03/20/2024 +ms.date: 02/28/2025 ms.topic: reference title: reference --- @@ -43,7 +43,7 @@ the resource and uses the dot-path notation to access the **bitness** property o ```yaml # reference.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: System type: Microsoft/OSInfo diff --git a/docs/reference/schemas/config/functions/resourceId.md b/docs/reference/schemas/config/functions/resourceId.md index 7c42a9d1..fa3f9c7e 100644 --- a/docs/reference/schemas/config/functions/resourceId.md +++ b/docs/reference/schemas/config/functions/resourceId.md @@ -1,6 +1,6 @@ --- description: Reference for the 'resourceId' DSC configuration document function -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: resourceId --- @@ -37,7 +37,7 @@ The following configuration uses the `resourceId()` function to reference the in ```yaml # resourceId.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Tailspin Key type: Microsoft.Windows/Registry @@ -62,12 +62,12 @@ resource instance named 'IsWindows' as a dependency of the `Example Key` resourc ```yaml # resourceId.example.2.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: IsWindows type: DSC/AssertionGroup properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: os type: Microsoft/OSInfo diff --git a/docs/reference/schemas/config/functions/sub.md b/docs/reference/schemas/config/functions/sub.md index e9cc4f2c..a22f003c 100644 --- a/docs/reference/schemas/config/functions/sub.md +++ b/docs/reference/schemas/config/functions/sub.md @@ -1,6 +1,6 @@ --- description: Reference for the 'sub' DSC configuration document function -ms.date: 03/20/2024 +ms.date: 02/28/2025 ms.topic: reference title: sub --- @@ -31,7 +31,7 @@ integers. ```yaml # sub.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Subtract integers type: Test/Echo diff --git a/docs/reference/schemas/config/functions/variables.md b/docs/reference/schemas/config/functions/variables.md index 11a8324e..f9c463ff 100644 --- a/docs/reference/schemas/config/functions/variables.md +++ b/docs/reference/schemas/config/functions/variables.md @@ -1,6 +1,6 @@ --- description: Reference for the 'variables' DSC configuration document function -ms.date: 08/22/2024 +ms.date: 02/28/2025 ms.topic: reference title: variables --- @@ -35,7 +35,7 @@ example synopsis ```yaml # variables.example.1.dsc.config.yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json variables: message: Hello, world! resources: diff --git a/docs/reference/schemas/config/metadata.md b/docs/reference/schemas/config/metadata.md index 115ea672..93250df0 100644 --- a/docs/reference/schemas/config/metadata.md +++ b/docs/reference/schemas/config/metadata.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for metadata in a Desired State Configuration document. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Configuration document metadata schema --- @@ -15,7 +15,7 @@ Defines a set of informational key-value pairs for the configuration. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.metadata.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.metadata.json Type: object ``` @@ -29,7 +29,7 @@ For example, you could define information about the configuration used by your t tools: ```yaml -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.vscode.json metadata: owner: security.ops@contoso.com diff --git a/docs/reference/schemas/config/parameter.md b/docs/reference/schemas/config/parameter.md index b1cee316..e2c8034d 100644 --- a/docs/reference/schemas/config/parameter.md +++ b/docs/reference/schemas/config/parameter.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for a parameter in a Desired State Configuration document. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Configuration document parameter schema --- @@ -15,7 +15,7 @@ Defines runtime options for a configuration. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.parameter.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.parameter.json Type: object ``` diff --git a/docs/reference/schemas/config/resource.md b/docs/reference/schemas/config/resource.md index a7ef10aa..56114eea 100644 --- a/docs/reference/schemas/config/resource.md +++ b/docs/reference/schemas/config/resource.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for a resource instance in a Desired State Configuration document. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Configuration document resource instance schema --- @@ -15,7 +15,7 @@ Defines a DSC Resource instance in a configuration document. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.resource.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json Type: object ``` diff --git a/docs/reference/schemas/definitions/message.md b/docs/reference/schemas/definitions/message.md index 15c7f334..9075c992 100644 --- a/docs/reference/schemas/definitions/message.md +++ b/docs/reference/schemas/definitions/message.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for a structured message returned from a 'dsc config' command. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: Structured message schema reference --- @@ -15,7 +15,7 @@ A message emitted by a DSC Resource with associated metadata. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/message.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/message.json Type: object ``` @@ -69,7 +69,7 @@ Indicates the severity of the message. ```yaml Type: string Required: true -Valid Values: [Error, Warning, Information] +Valid Values: [error, warning, information] ``` [01]: resourceType.md diff --git a/docs/reference/schemas/definitions/parameters/dataTypes.md b/docs/reference/schemas/definitions/parameters/dataTypes.md index 83f88fbb..a61e7107 100644 --- a/docs/reference/schemas/definitions/parameters/dataTypes.md +++ b/docs/reference/schemas/definitions/parameters/dataTypes.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for valid parameter data types in a configuration document. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC configuration parameter data type schema reference --- @@ -15,7 +15,7 @@ Defines valid data types for a DSC configuration parameter ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/parameters/dataTypes.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/parameters/dataTypes.json Type: string ValidValues: [array, bool, int, object, string, secureobject, securestring] ``` diff --git a/docs/reference/schemas/definitions/resourceKind.md b/docs/reference/schemas/definitions/resourceKind.md index a60b0681..de400641 100644 --- a/docs/reference/schemas/definitions/resourceKind.md +++ b/docs/reference/schemas/definitions/resourceKind.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for resource kind -ms.date: 06/24/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource kind schema reference --- @@ -15,33 +15,34 @@ Identifies whether a resource is an adapter resource, a group resource, or a nor ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/resourceKind.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceKind.json Type: string -ValidValues: [Resource, Adapter, Group, Import] +ValidValues: [resource, adapter, group, importer] ``` ## Description DSC supports three kinds of command-based DSC Resources: -- `Resource` - Indicates that the manifest isn't for a group or adapter resource. -- `Group` - Indicates that the manifest is for a [group resource](#group-resources). -- `Adapter` - Indicates that the manifest is for an [adapter resource](#adapter-resources). -- `Import` - Indicates that the manifest is for an [importer resource](#importer-resources). +- `resource` - Indicates that the manifest isn't for a group or adapter resource. +- `group` - Indicates that the manifest is for a [group resource](#group-resources). +- `adapter` - Indicates that the manifest is for an [adapter resource](#adapter-resources). +- `importer` - Indicates that the manifest is for an [importer resource](#importer-resources). When `kind` isn't defined in the resource manifest, DSC infers the value for the property. If the `adapter` property is defined in the resource manifest, DSC infers the value of `kind` as -`Adapter`. If the `adapter` property isn't defined, DSC infers the value of `kind` as `Resource`. -DSC can't infer whether a manifest is for a group resource. +`adapter`. If the `adapter` property isn't defined, DSC infers the value of `kind` as `resource`. +DSC can't infer whether a manifest is for a group or importer resource. When defining a group resource, always explicitly define the `kind` property in the manifest as -`Group`. +`group`. When defining an importer resource, always explicitly define the `kind` property in the +manifest as `importer`. ### Adapter resources -An adapter resource makes non-command-based resources available to DSC. They always have a -`resources` property that takes an array of nested resource instances. Adapters may provide -additional control over how the adapted resources are processed. +An adapter resource makes non-command resources available to DSC. They always have a `resources` +property that takes an array of nested resource instances. Adapters may provide additional control +over how the adapted resources are processed. An adapter resource must always define the [adapter][01] and [validate][02] properties in the resource manifest. @@ -166,6 +167,7 @@ of the `Microsoft/OSInfo` resource. The top-level instances of the `Test/Echo` a resource. ```yaml +# yaml-language-server: $schema=https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.vscode.json resources: # The top level echo references and depends on the top-level OSInfo. # It also depends on the top-level Group. @@ -200,7 +202,7 @@ depends on the adjacent nested `Microsoft.DSC/Group` instance. - name: Top level group type: Microsoft.DSC/Group properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: # The nested echo references and depends on the adjacent nested OSInfo. - name: Nested echo @@ -229,13 +231,13 @@ nested instance of `Test/Echo` references and depends on the deeply nested insta - name: Top level group type: Microsoft.DSC/Group properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: # Snipped the Test/Echo and Microsoft/OSInfo instances for brevity - name: Nested Group type: Microsoft.DSC/Group properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: # The deeply nested echo references and depends on the adjacent # deeply nested OSInfo. @@ -262,8 +264,8 @@ nested instances in the same group. Putting the configuration together, you get this full document: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.vscode.json -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +# yaml-language-server: $schema=https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: # The top level echo references and depends on the top-level OSInfo. - name: Top level echo @@ -284,7 +286,7 @@ resources: - name: Top level group type: Microsoft.DSC/Group properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: # The nested echo references and depends on the adjacent nested OSInfo. - name: Nested echo @@ -303,7 +305,7 @@ resources: - name: Nested Group type: Microsoft.DSC/Group properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: # The deeply nested echo references and depends on the adjacent # deeply nested OSInfo. @@ -328,8 +330,8 @@ references and depends on the nested `Microsoft/OSInfo` instance. The nested ins to the top-level instance, not adjacent. ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.vscode.json -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +# yaml-language-server: $schema=https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Top level echo type: Test/Echo @@ -343,7 +345,7 @@ resources: - name: Top level group type: Microsoft.DSC/Group properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Nested OSInfo type: Microsoft/OSInfo @@ -357,8 +359,8 @@ references and depends on the top-level `Microsoft/OSInfo` instance. The top-lev external to the nested instance, not adjacent. ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.vscode.json -$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json +# yaml-language-server: $schema=https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Top level OSInfo type: Microsoft/OSInfo @@ -366,7 +368,7 @@ resources: - name: Top level group type: Microsoft.DSC/Group properties: - $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json resources: - name: Nested echo type: Test/Echo diff --git a/docs/reference/schemas/definitions/resourceType.md b/docs/reference/schemas/definitions/resourceType.md index 4c45d941..219284ea 100644 --- a/docs/reference/schemas/definitions/resourceType.md +++ b/docs/reference/schemas/definitions/resourceType.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for a resource instance type name -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource fully qualified type name schema reference --- @@ -15,7 +15,7 @@ Identifies a DSC Resource. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/definitions/resourceType.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json Type: string Pattern: ^\w+(\.\w+){0,2}\/\w+$ ``` diff --git a/docs/reference/schemas/metadata/Microsoft.DSC/properties.md b/docs/reference/schemas/metadata/Microsoft.DSC/properties.md index 30e12b46..5e8bc74d 100644 --- a/docs/reference/schemas/metadata/Microsoft.DSC/properties.md +++ b/docs/reference/schemas/metadata/Microsoft.DSC/properties.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the metadata field Microsoft.DSC -ms.date: 05/07/2024 +ms.date: 02/28/2025 ms.topic: reference title: Microsoft.DSC metadata property schema reference --- @@ -26,7 +26,7 @@ For example, `PT0.611216S` represents a duration of about `0.61` seconds. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/duration.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json Type: string Format: duration ``` @@ -40,7 +40,7 @@ For example: `2024-04-14T08:49:51.395686600-07:00` ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/endDateTime.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/endDateTime.json Type: string Format: date-time ``` @@ -53,7 +53,7 @@ this value is `WhatIf` when DSC is invoked with the `--whatIf` argument. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/executionType.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/executionType.json Type: string ValidValues: [Actual, WhatIf] ``` @@ -65,7 +65,7 @@ Defines the operation that DSC applied to the configuration document: `Get`, `Se ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/operation.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/operation.json Type: string ValidValues: [Get, Set, Test, Export] ``` @@ -79,7 +79,7 @@ non-elevated session. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/securityContext.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/securityContext.json Type: string ValidValues: [Current, Elevated, Restricted] ``` @@ -93,7 +93,7 @@ For example: `2024-04-14T08:49:51.395686600-07:00` ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/startDatetime.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/startDatetime.json Type: string Format: date-time ``` @@ -105,7 +105,7 @@ DSC command, like `3.0.0-preview.7`. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/metadata/Microsoft.DSC/version.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/version.json Type: object ``` diff --git a/docs/reference/schemas/outputs/config/get.md b/docs/reference/schemas/outputs/config/get.md index 19fd2af7..631f4e98 100644 --- a/docs/reference/schemas/outputs/config/get.md +++ b/docs/reference/schemas/outputs/config/get.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the data returned by the 'dsc config get' command. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc config get result schema reference --- @@ -15,7 +15,7 @@ The result output from the `dsc config get` command. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/config/get.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/get.json Type: object ``` diff --git a/docs/reference/schemas/outputs/config/set.md b/docs/reference/schemas/outputs/config/set.md index 72453bfc..5407bbff 100644 --- a/docs/reference/schemas/outputs/config/set.md +++ b/docs/reference/schemas/outputs/config/set.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the data returned by the 'dsc config set' command. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc config set result schema reference --- @@ -15,7 +15,7 @@ The result output from the `dsc config set` command. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/config/set.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/set.json Type: object ``` diff --git a/docs/reference/schemas/outputs/config/test.md b/docs/reference/schemas/outputs/config/test.md index 4df9b60d..f5893607 100644 --- a/docs/reference/schemas/outputs/config/test.md +++ b/docs/reference/schemas/outputs/config/test.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the data returned by the 'dsc config test' command. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc config test result schema reference --- @@ -15,7 +15,7 @@ The result output from the `dsc config test` command. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/config/test.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/config/test.json Type: object ``` diff --git a/docs/reference/schemas/outputs/resource/get.md b/docs/reference/schemas/outputs/resource/get.md index 42fb08e6..b6fb4190 100644 --- a/docs/reference/schemas/outputs/resource/get.md +++ b/docs/reference/schemas/outputs/resource/get.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the data returned by the 'dsc resource get' command. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc resource get result schema reference --- @@ -15,7 +15,7 @@ The result output from the `dsc resource get` command. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/resource/get.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json Type: object ``` diff --git a/docs/reference/schemas/outputs/resource/list.md b/docs/reference/schemas/outputs/resource/list.md index 2191ba2e..68c4b4cc 100644 --- a/docs/reference/schemas/outputs/resource/list.md +++ b/docs/reference/schemas/outputs/resource/list.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the data returned by the 'dsc resource list' command. -ms.date: 06/24/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc resource list result schema reference --- @@ -15,7 +15,7 @@ The result output from the `dsc resource list` command. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/resource/list.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/list.json Type: object ``` @@ -85,15 +85,15 @@ optional and depend on the resource. The following list describes the available capabilities for a resource: -- `Get` - The resource supports retrieving the current state of an +- `get` - The resource supports retrieving the current state of an instance. All DSC Resources must have this capability. A resource has this capability when it defines the mandatory [get][07] property in its resource manifest. -- `Set` - The resource supports enforcing the desired state of an +- `set` - The resource supports enforcing the desired state of an instance. A resource has this capability when it defines the [set][08] property in its resource manifest. Resources without this capability can't be used with the [dsc resource set][09] or [dsc config set][10] commands unless they're in a Microsoft.DSC/Assertion group as a nested instance. -- `SetHandlesExist` - The resource supports the +- `setHandlesExist` - The resource supports the [_exist property][11] directly. A resource has this capability when it defines the [handlesExist][12] property as `true` in the definition of the [set][08] command property in its resource manifest. @@ -104,12 +104,12 @@ The following list describes the available capabilities for a resource: When a resource doesn't have this capability, when DSC finds an instance of the resource with `_exist` set to `false`, it handles calling the [delete][13] operation for the resource. - If the resource doesn't have this capability or the `Delete` capability, DSC raises an error when + If the resource doesn't have this capability or the `delete` capability, DSC raises an error when an instance defines `_exist` as `false`. -- `WhatIf` - The resource supports returning explicit information +- `whatIf` - The resource supports returning explicit information about how it will modify state when a user calls [dsc config set][10] with the [--what-if][14] - option. A resource has this capability when it defines the [What-if method][15] in its resource - manifest. + option. A resource has this capability when it defines the [What-if operation][15] in its + resource manifest. When a resource has this capability, DSC calls the defined command with its arguments when a user executes the `dsc config set` command with the `--what-if` option. @@ -121,25 +121,25 @@ The following list describes the available capabilities for a resource: used to test a resource might be valid for that operation, but not have permissions to actually modify the system state. Only a resource with this capability can fully report whether and how the resource will change system state. -- `Test` - The resource supports validating the desired state of an +- `test` - The resource supports validating the desired state of an instance against the current state of the instance. A resource has this capability when it defines the [test][16] property in its resource manifest. - If a resource doesn't have the `Test` capability, DSC uses a synthetic test for instances of the + If a resource doesn't have the `test` capability, DSC uses a synthetic test for instances of the resource. The synthetic test compares each property for the desired state of an instance against the actual state. The synthetic test uses strict, case-sensitive equivalence. If the desired state for a property and the actual state aren't the same, DSC marks the property as out of the desired state. -- `Delete` - The resource supports removing an instance. A resource +- `delete` - The resource supports removing an instance. A resource has this capability when it defines the [delete][13] property in its resource manifest. This - capability isn't mutually exclusive with the `SetHandlesExist` property. A resource can handle + capability isn't mutually exclusive with the `setHandlesExist` property. A resource can handle the `_exist` property in set operations and be called directly with [dsc resource delete][17] to remove an instance. -- `Export` - The resource supports enumerating every instance of +- `export` - The resource supports enumerating every instance of the resource. A resource has this capability when it defines the [export][18] property in its resource manifest. Only resources with this capability are usable with the [dsc resource export][19] and [dsc config export][20] commands. -- `Resolve` - The resource supports resolving nested resource +- `resolve` - The resource supports resolving nested resource instances from an external source. A resource has this capability when it defines the [resolve][21] property in its resource manifest. This functionality is primarily used by [importer resources][22]. @@ -149,7 +149,16 @@ Type: array Required: true ItemsMustBeUnique: true ItemsType: string -ItemsValidValues: [Get, Set, SetHandlesExist, Test, Delete, Export] +ItemsValidValues: [ + get, + set, + setHandlesExist, + whatIf, + test, + delete, + export, + resolve + ] ``` ### description diff --git a/docs/reference/schemas/outputs/resource/set.md b/docs/reference/schemas/outputs/resource/set.md index 77ca082d..c1210c7e 100644 --- a/docs/reference/schemas/outputs/resource/set.md +++ b/docs/reference/schemas/outputs/resource/set.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the data returned by the 'dsc resource set' command. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc resource set result schema reference --- @@ -15,7 +15,7 @@ The result output from the `dsc resource set` command. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/resource/set.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/set.json Type: object ``` diff --git a/docs/reference/schemas/outputs/resource/test.md b/docs/reference/schemas/outputs/resource/test.md index d1e0e7b1..9620c6d9 100644 --- a/docs/reference/schemas/outputs/resource/test.md +++ b/docs/reference/schemas/outputs/resource/test.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the data returned by the 'dsc resource test' command. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: dsc resource test result schema reference --- @@ -15,7 +15,7 @@ The result output from the `dsc resource test` command. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/outputs/resource/test.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/test.json Type: object ``` diff --git a/docs/reference/schemas/resource/manifest/adapter.md b/docs/reference/schemas/resource/manifest/adapter.md index 41f157a0..28b5d8e7 100644 --- a/docs/reference/schemas/resource/manifest/adapter.md +++ b/docs/reference/schemas/resource/manifest/adapter.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the 'adapter' property in a DSC Resource manifest -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource manifest adapter property schema reference --- @@ -15,7 +15,7 @@ Defines a DSC Resource as a DSC Resource Adapter. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.adapter.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.adapter.json Type: object ``` diff --git a/docs/reference/schemas/resource/manifest/delete.md b/docs/reference/schemas/resource/manifest/delete.md index ac4a1b69..8f906441 100644 --- a/docs/reference/schemas/resource/manifest/delete.md +++ b/docs/reference/schemas/resource/manifest/delete.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the 'delete' property in a DSC Resource manifest -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource manifest delete property schema reference --- @@ -15,7 +15,7 @@ Indicates how to call the resource to delete a specific instance. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.delete.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.delete.json Type: object ``` diff --git a/docs/reference/schemas/resource/manifest/export.md b/docs/reference/schemas/resource/manifest/export.md index 8587bbbe..a9899e6f 100644 --- a/docs/reference/schemas/resource/manifest/export.md +++ b/docs/reference/schemas/resource/manifest/export.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the 'export' property in a DSC Resource manifest -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource manifest export property schema reference --- @@ -15,7 +15,7 @@ Defines how to retrieve the current state of every instance for a DSC Resource. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.export.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.export.json Type: object ``` diff --git a/docs/reference/schemas/resource/manifest/get.md b/docs/reference/schemas/resource/manifest/get.md index 2bab66ba..c216ed2c 100644 --- a/docs/reference/schemas/resource/manifest/get.md +++ b/docs/reference/schemas/resource/manifest/get.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the 'get' property in a DSC Resource manifest -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource manifest get property schema reference --- @@ -15,7 +15,7 @@ Defines how to retrieve a DSC Resource instance. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.get.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.get.json Type: object ``` diff --git a/docs/reference/schemas/resource/manifest/resolve.md b/docs/reference/schemas/resource/manifest/resolve.md index 99b2c617..ab76b178 100644 --- a/docs/reference/schemas/resource/manifest/resolve.md +++ b/docs/reference/schemas/resource/manifest/resolve.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the 'resolve' property in a DSC Resource manifest -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource manifest resolve property schema reference --- @@ -16,7 +16,7 @@ source. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.resolve.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.resolve.json Type: object ``` diff --git a/docs/reference/schemas/resource/manifest/schema/embedded.md b/docs/reference/schemas/resource/manifest/schema/embedded.md index eff9828f..7d89026e 100644 --- a/docs/reference/schemas/resource/manifest/schema/embedded.md +++ b/docs/reference/schemas/resource/manifest/schema/embedded.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the embedded instance schema in a DSC Resource manifest -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource manifest embedded schema reference --- @@ -15,7 +15,7 @@ Defines a JSON Schema that validates a DSC Resource instance. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.schema.json#/properties/embedded +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json#/properties/embedded Type: object ``` @@ -103,11 +103,11 @@ whether an instance should be added, updated, or removed during a set operation. provides shared semantics for DSC Resources and integrating tools, but doesn't enable any additional built-in processing with DSC. -If defined, this property must be a reference to the schema for the well-known property: +If defined, this property must be a reference to the schema for the canonical property: ```json "_exist": { - "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/exist.json" + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json" } ``` @@ -119,11 +119,11 @@ The read-only `_inDesiredState` property indicates whether a resource instance i state. This property is mandatory for command-based DSC Resources that define the [test][02] property. -If defined, this property must be a reference to the schema for the well-known property: +If defined, this property must be a reference to the schema for the canonical property: ```json "_inDesiredState": { - "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/inDesiredState.json" + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json" } ``` @@ -135,11 +135,11 @@ Resources that need to distinguish between whether unmanaged entries in a list a removed can define the write-only `_purge` property. This property provides shared semantics for DSC Resources and integrating tools, but doesn't enable any built-in processing with DSC. -If defined, this property must be a reference to the schema for the well-known property: +If defined, this property must be a reference to the schema for the canonical property: ```json "_purge": { - "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/purge.json" + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json" } ``` @@ -151,11 +151,11 @@ The read-only `_rebootRequested` property indicates whether a resource instance after a set operation. To use DSC's built-in reboot notification processing, resources must define this property in their manifest. -If defined, this property must be a reference to the schema for the well-known property: +If defined, this property must be a reference to the schema for the canonical property: ```json "_rebootRequested": { - "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/rebootRequested.json" + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json" } ``` diff --git a/docs/reference/schemas/resource/manifest/schema/property.md b/docs/reference/schemas/resource/manifest/schema/property.md index 191bbdea..addd800b 100644 --- a/docs/reference/schemas/resource/manifest/schema/property.md +++ b/docs/reference/schemas/resource/manifest/schema/property.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the 'schema' property in a DSC Resource manifest -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource manifest schema property schema reference --- @@ -15,7 +15,7 @@ Defines how to retrieve the JSON Schema that validates a DSC Resource instance. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.schema.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.schema.json Type: object ``` diff --git a/docs/reference/schemas/resource/manifest/set.md b/docs/reference/schemas/resource/manifest/set.md index 4b09fdae..f8f7a910 100644 --- a/docs/reference/schemas/resource/manifest/set.md +++ b/docs/reference/schemas/resource/manifest/set.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the 'set' property in a DSC Resource manifest -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource manifest set property schema reference --- @@ -15,7 +15,7 @@ Defines how to enforce state for a DSC Resource instance. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.set.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.set.json Type: object ``` diff --git a/docs/reference/schemas/resource/manifest/test.md b/docs/reference/schemas/resource/manifest/test.md index e46b0a90..882132db 100644 --- a/docs/reference/schemas/resource/manifest/test.md +++ b/docs/reference/schemas/resource/manifest/test.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the 'test' property in a DSC Resource manifest -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource manifest test property schema reference --- @@ -15,7 +15,7 @@ Defines how to test whether a DSC Resource instance is in the desired state. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.test.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.test.json Type: object ``` diff --git a/docs/reference/schemas/resource/manifest/validate.md b/docs/reference/schemas/resource/manifest/validate.md index 16b5c834..0e4f42ff 100644 --- a/docs/reference/schemas/resource/manifest/validate.md +++ b/docs/reference/schemas/resource/manifest/validate.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the 'validate' property in a DSC Resource manifest -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource manifest validate property schema reference --- @@ -15,7 +15,7 @@ Indicates how to call a group resource to test whether nested instances are vali ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.validate.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.validate.json Type: object ``` diff --git a/docs/reference/schemas/resource/manifest/whatif.md b/docs/reference/schemas/resource/manifest/whatif.md index ed5054ed..715d4bbc 100644 --- a/docs/reference/schemas/resource/manifest/whatif.md +++ b/docs/reference/schemas/resource/manifest/whatif.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the 'whatIf' property in a DSC Resource manifest -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource manifest whatIf property schema reference --- @@ -15,7 +15,7 @@ Defines how to indicate whether and how the set command will modify an instance. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.whatIf.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.whatIf.json Type: object ``` diff --git a/docs/reference/schemas/resource/properties/exist.md b/docs/reference/schemas/resource/properties/exist.md index 2803a412..7543ce22 100644 --- a/docs/reference/schemas/resource/properties/exist.md +++ b/docs/reference/schemas/resource/properties/exist.md @@ -1,6 +1,6 @@ --- -description: JSON schema reference for the '_exist' well-known DSC Resource property. -ms.date: 10/05/2023 +description: JSON schema reference for the '_exist' canonical DSC Resource property. +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource _exist property schema --- @@ -15,17 +15,17 @@ Indicates whether an instance should exist. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/exist.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/exist.json Type: boolean DefaultValue: true ``` ## Description -The `_exist` property indicates that the resource can enforce whether instances exist, handling -whether an instance should be added, updated, or removed during a set operation. This property -provides shared semantics for DSC Resources and integrating tools, but doesn't enable any -additional built-in processing with DSC. +The `_exist` canonical property indicates that the resource can enforce whether instances exist, +handling whether an instance should be added, updated, or removed during a set operation. This +property provides shared semantics for DSC Resources and integrating tools. Resources that define +this property indicate to DSC that they adhere to the contract for the canonical property. Resources should only define this property when their implementation adheres to the following behavior contract: @@ -44,6 +44,8 @@ snippet: ```json "_exist": { - "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/exist.json" + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/exist.json" } ``` + + diff --git a/docs/reference/schemas/resource/properties/inDesiredState.md b/docs/reference/schemas/resource/properties/inDesiredState.md index d2f892e6..b3e026ea 100644 --- a/docs/reference/schemas/resource/properties/inDesiredState.md +++ b/docs/reference/schemas/resource/properties/inDesiredState.md @@ -1,6 +1,6 @@ --- -description: JSON schema reference for the '_inDesiredState' well-known DSC Resource property. -ms.date: 01/17/2024 +description: JSON schema reference for the '_inDesiredState' canonical DSC Resource property. +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource _inDesiredState property schema --- @@ -15,16 +15,16 @@ Indicates whether an instance is in the desired state. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/inDesiredState.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/inDesiredState.json Type: [boolean, 'null'] ReadOnly: true ``` ## Description -The `_inDesiredState` property indicates whether a resource instance is in the desired state. -Whether a resource's instance schema should include this property depends on whether the resource's -[manifest][01] defines the [test][02] property. +The `_inDesiredState` canonical property indicates whether a resource instance is in the desired +state. Whether a resource's instance schema should include this property depends on whether the +resource's [manifest][01] defines the [test][02] property. If the resource's manifest doesn't define `test`, the resource relies on DSC's synthetic test. The resource's instance schema must not include the `_inDesiredState` property. @@ -43,9 +43,11 @@ snippet: ```json "_inDesiredState": { - "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/inDesiredState.json" + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/inDesiredState.json" } ``` + + [01]: ../manifest/root.md [02]: ../manifest/test.md diff --git a/docs/reference/schemas/resource/properties/overview.md b/docs/reference/schemas/resource/properties/overview.md index 2c023222..948e5efc 100644 --- a/docs/reference/schemas/resource/properties/overview.md +++ b/docs/reference/schemas/resource/properties/overview.md @@ -1,24 +1,23 @@ --- description: >- - Information about the list of well-known DSC Resource properties, including their purpose and how + Information about the list of canonical DSC Resource properties, including their purpose and how to add them to a resource's manifest. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference -title: DSC well-known properties +title: DSC canonical properties --- -# DSC well-known properties +# DSC canonical properties -DSC has support for several well-known properties. Some well-known properties enable a DSC Resource -to use built-in processing. The well-known properties always start with an underscore (`_`) and DSC +DSC has support for several canonical properties. Some canonical properties enable a DSC Resource +to use built-in processing. The canonical properties always start with an underscore (`_`) and DSC Resources that use these properties may not override or extend them. ## _exist The `_exist` property indicates that the resource can enforce whether instances exist, handling whether an instance should be added, updated, or removed during a set operation. This property -provides shared semantics for DSC Resources and integrating tools, but doesn't enable any -additional built-in processing with DSC. +provides shared semantics for DSC Resources and integrating tools. For more information, see [DSC Resource _exist property schema][01]. diff --git a/docs/reference/schemas/resource/properties/purge.md b/docs/reference/schemas/resource/properties/purge.md index e8440004..109c13e5 100644 --- a/docs/reference/schemas/resource/properties/purge.md +++ b/docs/reference/schemas/resource/properties/purge.md @@ -1,6 +1,6 @@ --- description: JSON schema reference for the '_purge' well-known DSC Resource property. -ms.date: 01/17/2024 +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource _purge property schema --- @@ -15,7 +15,7 @@ Indicates that the resource should treat non-defined entries in a list as invali ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/purge.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/purge.json Type: [boolean, 'null'] WriteOnly: true ``` @@ -44,6 +44,8 @@ snippet: ```json "_inDesiredState": { - "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/purge.json" + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/purge.json" } ``` + + diff --git a/docs/reference/schemas/resource/properties/rebootRequested.md b/docs/reference/schemas/resource/properties/rebootRequested.md index 2ce8d38c..b2288fa1 100644 --- a/docs/reference/schemas/resource/properties/rebootRequested.md +++ b/docs/reference/schemas/resource/properties/rebootRequested.md @@ -1,6 +1,6 @@ --- -description: JSON schema reference for the '_rebootRequested' well-known DSC Resource property. -ms.date: 01/17/2024 +description: JSON schema reference for the '_rebootRequested' canonical DSC Resource property. +ms.date: 02/28/2025 ms.topic: reference title: DSC Resource _rebootRequested property schema --- @@ -15,15 +15,15 @@ Indicates whether an instance is in the desired state. ```yaml SchemaDialect: https://json-schema.org/draft/2020-12/schema -SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/rebootRequested.json +SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/properties/rebootRequested.json Type: [boolean, 'null'] ReadOnly: true ``` ## Description -The `_rebootRequested` property indicates whether a resource instance requires a reboot after a set -operation. +The `_rebootRequested` canonical property indicates whether a resource instance requires a reboot +after a set operation. If the resource determines during a set operation that the node needs to reboot before the state change takes full effect, it should return the instance's data with the `_rebootRequested` property @@ -43,6 +43,8 @@ snippet: ```json "_rebootRequested": { - "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/properties/rebootRequested.json" + "$ref": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/properties/rebootRequested.json" } ``` + + From 617a4d1512a1f3ddb09c47565521c40e1a3525ec Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Tue, 25 Feb 2025 13:58:14 -0600 Subject: [PATCH 10/11] (maint) Address clippy lints --- dsc_lib/src/configure/config_doc.rs | 7 +- dsc_lib/src/dscresources/resource_manifest.rs | 7 +- dsc_lib/src/schemas/mod.rs | 77 ++++++++++--------- 3 files changed, 49 insertions(+), 42 deletions(-) diff --git a/dsc_lib/src/configure/config_doc.rs b/dsc_lib/src/configure/config_doc.rs index 4c4dce7c..3e981e7b 100644 --- a/dsc_lib/src/configure/config_doc.rs +++ b/dsc_lib/src/configure/config_doc.rs @@ -167,9 +167,10 @@ impl DscRepoSchema for Configuration { } fn validate_schema_uri(&self) -> Result<(), DscError> { - match Self::is_recognized_schema_uri(&self.schema) { - true => Ok(()), - false => Err(DscError::UnrecognizedSchemaUri( + if Self::is_recognized_schema_uri(&self.schema) { + Ok(()) + } else { + Err(DscError::UnrecognizedSchemaUri( self.schema.clone(), Self::recognized_schema_uris(), )) diff --git a/dsc_lib/src/dscresources/resource_manifest.rs b/dsc_lib/src/dscresources/resource_manifest.rs index bc38dff6..6d2e580d 100644 --- a/dsc_lib/src/dscresources/resource_manifest.rs +++ b/dsc_lib/src/dscresources/resource_manifest.rs @@ -248,9 +248,10 @@ impl DscRepoSchema for ResourceManifest { } fn validate_schema_uri(&self) -> Result<(), DscError> { - match Self::is_recognized_schema_uri(&self.schema_version) { - true => Ok(()), - false => Err(DscError::UnrecognizedSchemaUri( + if Self::is_recognized_schema_uri(&self.schema_version) { + Ok(()) + } else { + Err(DscError::UnrecognizedSchemaUri( self.schema_version.clone(), Self::recognized_schema_uris(), )) diff --git a/dsc_lib/src/schemas/mod.rs b/dsc_lib/src/schemas/mod.rs index 511c41a9..0f75a12c 100644 --- a/dsc_lib/src/schemas/mod.rs +++ b/dsc_lib/src/schemas/mod.rs @@ -19,15 +19,15 @@ pub enum SchemaUriPrefix { impl std::fmt::Display for SchemaUriPrefix { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::AkaDotMs => write!(f, "{}", "https://aka.ms/dsc/schemas"), - Self::Github => write!(f, "{}", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas"), + Self::AkaDotMs => write!(f, "https://aka.ms/dsc/schemas"), + Self::Github => write!(f, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas"), } } } impl SchemaUriPrefix { /// Returns every known URI prefix for convenient iteration. - pub fn all() -> Vec { + #[must_use] pub fn all() -> Vec { vec![ Self::AkaDotMs, Self::Github, @@ -66,11 +66,10 @@ impl SchemaForm { /// The extension for [`Bundled`] and [`Canonical`] schemas is `.json` /// /// The extension for [`VSCode`] schemas is `.vscode.json` - pub fn to_extension(&self) -> String { + #[must_use] pub fn to_extension(&self) -> String { match self { - Self::Bundled => ".json".to_string(), + Self::Bundled | Self::Canonical => ".json".to_string(), Self::VSCode => ".vscode.json".to_string(), - Self::Canonical => ".json".to_string(), } } @@ -79,16 +78,15 @@ impl SchemaForm { /// The [`Bundled`] and [`VSCode`] schemas are always published in the `bundled` folder /// immediately beneath the version folder. The [`Canonical`] schemas use the folder path /// as defined for that schema. - pub fn to_folder_prefix(&self) -> String { + #[must_use] pub fn to_folder_prefix(&self) -> String { match self { - Self::Bundled => "bundled/".to_string(), - Self::VSCode => "bundled/".to_string(), - Self::Canonical => "".to_string(), + Self::Bundled | Self::VSCode => "bundled/".to_string(), + Self::Canonical => String::new(), } } /// Returns every schema form for convenient iteration. - pub fn all() -> Vec { + #[must_use] pub fn all() -> Vec { vec![ Self::Bundled, Self::VSCode, @@ -137,16 +135,16 @@ pub enum RecognizedSchemaVersion { impl std::fmt::Display for RecognizedSchemaVersion { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::V3 => write!(f, "{}", "v3"), - Self::V3_0 => write!(f, "{}", "v3.0"), - Self::V3_0_0 => write!(f, "{}", "v3.0.0"), + Self::V3 => write!(f, "v3"), + Self::V3_0 => write!(f, "v3.0"), + Self::V3_0_0 => write!(f, "v3.0.0"), } } } impl RecognizedSchemaVersion { /// Returns every recognized schema version for convenient iteration. - pub fn all() -> Vec { + #[must_use] pub fn all() -> Vec { vec![ Self::V3, Self::V3_0, @@ -155,17 +153,17 @@ impl RecognizedSchemaVersion { } //// Returns the latest version with major, minor, and patch segments, like `3.0.0`. - pub fn latest() -> RecognizedSchemaVersion { + #[must_use] pub fn latest() -> RecognizedSchemaVersion { Self::V3_0_0 } /// Returns the latest minor version for the latest major version, like `3.0`. - pub fn latest_minor() -> RecognizedSchemaVersion { + #[must_use] pub fn latest_minor() -> RecognizedSchemaVersion { Self::V3_0 } /// Returns the latest major version, like `3` - pub fn latest_major() -> RecognizedSchemaVersion { + #[must_use] pub fn latest_major() -> RecognizedSchemaVersion { Self::V3 } } @@ -224,9 +222,10 @@ pub(crate) fn get_recognized_schema_uris( should_bundle: bool ) -> Vec { let mut uris: Vec = Vec::new(); - let schema_forms = match should_bundle { - true => SchemaForm::all(), - false => vec![SchemaForm::Canonical], + let schema_forms = if should_bundle { + SchemaForm::all() + } else { + vec![SchemaForm::Canonical] }; for uri_prefix in SchemaUriPrefix::all() { for schema_form in schema_forms.iter().copied() { @@ -244,15 +243,15 @@ pub(crate) fn get_recognized_schema_uris( } } - return uris.into() + uris } /// Returns the JSON Schema to validate that a `$schema` keyword for a DSC type is one of the /// recognized URIs. /// /// This is a convenience function used by the [`DscRepoSchema`] trait. It's not intended for -/// direct use.` -pub(crate) fn get_recognized_uris_subschema( +/// direct use. +#[must_use] pub(crate) fn get_recognized_uris_subschema( metadata: Metadata, schema_file_base_name: &str, schema_folder_path: &str, @@ -317,9 +316,10 @@ pub(crate) fn get_default_schema_uri( /// If a schema is published in bundled form, the bundled form is the default. Otherwise, the /// default form is canonical (non-bundled). fn get_default_schema_form(should_bundle: bool) -> SchemaForm { - match should_bundle { - false => SchemaForm::Canonical, - true => SchemaForm::Bundled, + if should_bundle { + SchemaForm::Bundled + } else { + SchemaForm::Canonical } } @@ -352,7 +352,7 @@ pub trait DscRepoSchema : JsonSchema { /// default when creating an instance is the latest major version of the schema with the /// `aka.ms` prefix. If the schema is published in the bundled form, the default is for the /// bundled schema. Otherwise, the default is for the canonical (non-bundled) schema. - fn default_schema_id_uri() -> String { + #[must_use] fn default_schema_id_uri() -> String { get_default_schema_uri( Self::SCHEMA_FILE_BASE_NAME, Self::SCHEMA_FOLDER_PATH, @@ -361,7 +361,7 @@ pub trait DscRepoSchema : JsonSchema { } /// Returns the schema URI for a given version, form, and prefix. - fn get_schema_id_uri( + #[must_use] fn get_schema_id_uri( schema_version: RecognizedSchemaVersion, schema_form: SchemaForm, uri_prefix: SchemaUriPrefix @@ -379,7 +379,7 @@ pub trait DscRepoSchema : JsonSchema { /// version. /// /// If the type isn't published in bundled form, this function returns `None`. - fn get_enhanced_schema_id_uri(schema_version: RecognizedSchemaVersion) -> Option { + #[must_use] fn get_enhanced_schema_id_uri(schema_version: RecognizedSchemaVersion) -> Option { if !Self::SCHEMA_SHOULD_BUNDLE { return None; } @@ -395,7 +395,7 @@ pub trait DscRepoSchema : JsonSchema { /// Returns the URI for the canonical (non-bundled) form of the schema with the default /// prefix for a given version. - fn get_canonical_schema_id_uri(schema_version: RecognizedSchemaVersion) -> String { + #[must_use] fn get_canonical_schema_id_uri(schema_version: RecognizedSchemaVersion) -> String { get_recognized_schema_uri( Self::SCHEMA_FILE_BASE_NAME, Self::SCHEMA_FOLDER_PATH, @@ -407,7 +407,7 @@ pub trait DscRepoSchema : JsonSchema { /// Returns the URI for the bundled form of the schema with the default prefix for a given /// version. - fn get_bundled_schema_id_uri(schema_version: RecognizedSchemaVersion) -> Option { + #[must_use] fn get_bundled_schema_id_uri(schema_version: RecognizedSchemaVersion) -> Option { if !Self::SCHEMA_SHOULD_BUNDLE { return None; } @@ -426,7 +426,7 @@ pub trait DscRepoSchema : JsonSchema { /// This convenience function generates a vector containing every recognized JSON Schema `$id` /// URI for a specific schema. It handles returning the schemas for every recognized prefix, /// version, and form. - fn recognized_schema_uris() -> Vec { + #[must_use] fn recognized_schema_uris() -> Vec { get_recognized_schema_uris( Self::SCHEMA_FILE_BASE_NAME, Self::SCHEMA_FOLDER_PATH, @@ -441,7 +441,7 @@ pub trait DscRepoSchema : JsonSchema { /// recognized and validated. This method generates the appropriate subschema with every /// valid URI for the schema's `$id` without needing to regularly update an enum for each /// schema and release. - fn recognized_schema_uris_subschema(_: &mut schemars::gen::SchemaGenerator) -> Schema { + #[must_use] fn recognized_schema_uris_subschema(_: &mut schemars::gen::SchemaGenerator) -> Schema { get_recognized_uris_subschema( Self::schema_metadata(), Self::SCHEMA_FILE_BASE_NAME, @@ -451,7 +451,7 @@ pub trait DscRepoSchema : JsonSchema { } /// Indicates whether a given string is a recognized shema URI. - fn is_recognized_schema_uri(uri: &String) -> bool { + #[must_use] fn is_recognized_schema_uri(uri: &String) -> bool { Self::recognized_schema_uris().contains(uri) } @@ -465,7 +465,12 @@ pub trait DscRepoSchema : JsonSchema { /// types that don't define the `$schema` keyword in their serialized form. /// /// Any DSC type that serializes with the `$schema` keyword **must** define this - /// method to actually validate the instance. + /// method to actually validate the instance. + /// + /// # Errors + /// + /// If the value for the schema field isn't a recognized schema, the method should raise the + /// [`DscError::UnrecognizedSchemaUri`] error. fn validate_schema_uri(&self) -> Result<(), DscError> { Ok(()) } From 6ffad6b189fed5ae71eec0d9e634b67f340c555f Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Tue, 25 Feb 2025 15:21:17 -0600 Subject: [PATCH 11/11] (maint) Address review feedback for style/headers --- dsc_lib/src/configure/config_doc.rs | 10 ++-- dsc_lib/src/dscresources/resource_manifest.rs | 10 ++-- dsc_lib/src/schemas/mod.rs | 56 +++++++++++++------ 3 files changed, 50 insertions(+), 26 deletions(-) diff --git a/dsc_lib/src/configure/config_doc.rs b/dsc_lib/src/configure/config_doc.rs index 3e981e7b..e299cdbf 100644 --- a/dsc_lib/src/configure/config_doc.rs +++ b/dsc_lib/src/configure/config_doc.rs @@ -211,11 +211,13 @@ impl Default for Resource { } } -#[allow(unused_imports)] +#[cfg(test)] mod test { - use serde_json::json; - - use crate::{configure::config_doc::Configuration, dscerror::DscError, dscresources::resource_manifest::{import_manifest, ResourceManifest}, schemas::DscRepoSchema}; + use crate::{ + configure::config_doc::Configuration, + dscerror::DscError, + schemas::DscRepoSchema + }; #[test] fn test_validate_schema_uri_with_invalid_uri() { diff --git a/dsc_lib/src/dscresources/resource_manifest.rs b/dsc_lib/src/dscresources/resource_manifest.rs index 6d2e580d..49825a19 100644 --- a/dsc_lib/src/dscresources/resource_manifest.rs +++ b/dsc_lib/src/dscresources/resource_manifest.rs @@ -300,11 +300,13 @@ pub fn validate_semver(version: &str) -> Result<(), semver::Error> { Ok(()) } -#[allow(unused_imports)] +#[cfg(test)] mod test { - use serde_json::json; - - use crate::{dscerror::DscError, dscresources::resource_manifest::{import_manifest, ResourceManifest}, schemas::DscRepoSchema}; + use crate::{ + dscerror::DscError, + dscresources::resource_manifest::ResourceManifest, + schemas::DscRepoSchema + }; #[test] fn test_validate_schema_uri_with_invalid_uri() { diff --git a/dsc_lib/src/schemas/mod.rs b/dsc_lib/src/schemas/mod.rs index 0f75a12c..0f94f171 100644 --- a/dsc_lib/src/schemas/mod.rs +++ b/dsc_lib/src/schemas/mod.rs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + //! Contains helpers for JSON schemas and DSC use schemars::{schema::{Metadata, Schema}, JsonSchema}; @@ -27,7 +30,8 @@ impl std::fmt::Display for SchemaUriPrefix { impl SchemaUriPrefix { /// Returns every known URI prefix for convenient iteration. - #[must_use] pub fn all() -> Vec { + #[must_use] + pub fn all() -> Vec { vec![ Self::AkaDotMs, Self::Github, @@ -66,7 +70,8 @@ impl SchemaForm { /// The extension for [`Bundled`] and [`Canonical`] schemas is `.json` /// /// The extension for [`VSCode`] schemas is `.vscode.json` - #[must_use] pub fn to_extension(&self) -> String { + #[must_use] + pub fn to_extension(&self) -> String { match self { Self::Bundled | Self::Canonical => ".json".to_string(), Self::VSCode => ".vscode.json".to_string(), @@ -78,7 +83,8 @@ impl SchemaForm { /// The [`Bundled`] and [`VSCode`] schemas are always published in the `bundled` folder /// immediately beneath the version folder. The [`Canonical`] schemas use the folder path /// as defined for that schema. - #[must_use] pub fn to_folder_prefix(&self) -> String { + #[must_use] + pub fn to_folder_prefix(&self) -> String { match self { Self::Bundled | Self::VSCode => "bundled/".to_string(), Self::Canonical => String::new(), @@ -86,7 +92,8 @@ impl SchemaForm { } /// Returns every schema form for convenient iteration. - #[must_use] pub fn all() -> Vec { + #[must_use] + pub fn all() -> Vec { vec![ Self::Bundled, Self::VSCode, @@ -144,7 +151,8 @@ impl std::fmt::Display for RecognizedSchemaVersion { impl RecognizedSchemaVersion { /// Returns every recognized schema version for convenient iteration. - #[must_use] pub fn all() -> Vec { + #[must_use] + pub fn all() -> Vec { vec![ Self::V3, Self::V3_0, @@ -153,17 +161,20 @@ impl RecognizedSchemaVersion { } //// Returns the latest version with major, minor, and patch segments, like `3.0.0`. - #[must_use] pub fn latest() -> RecognizedSchemaVersion { + #[must_use] + pub fn latest() -> RecognizedSchemaVersion { Self::V3_0_0 } /// Returns the latest minor version for the latest major version, like `3.0`. - #[must_use] pub fn latest_minor() -> RecognizedSchemaVersion { + #[must_use] + pub fn latest_minor() -> RecognizedSchemaVersion { Self::V3_0 } /// Returns the latest major version, like `3` - #[must_use] pub fn latest_major() -> RecognizedSchemaVersion { + #[must_use] + pub fn latest_major() -> RecognizedSchemaVersion { Self::V3 } } @@ -251,7 +262,8 @@ pub(crate) fn get_recognized_schema_uris( /// /// This is a convenience function used by the [`DscRepoSchema`] trait. It's not intended for /// direct use. -#[must_use] pub(crate) fn get_recognized_uris_subschema( +#[must_use] +pub(crate) fn get_recognized_uris_subschema( metadata: Metadata, schema_file_base_name: &str, schema_folder_path: &str, @@ -352,7 +364,8 @@ pub trait DscRepoSchema : JsonSchema { /// default when creating an instance is the latest major version of the schema with the /// `aka.ms` prefix. If the schema is published in the bundled form, the default is for the /// bundled schema. Otherwise, the default is for the canonical (non-bundled) schema. - #[must_use] fn default_schema_id_uri() -> String { + #[must_use] + fn default_schema_id_uri() -> String { get_default_schema_uri( Self::SCHEMA_FILE_BASE_NAME, Self::SCHEMA_FOLDER_PATH, @@ -361,7 +374,8 @@ pub trait DscRepoSchema : JsonSchema { } /// Returns the schema URI for a given version, form, and prefix. - #[must_use] fn get_schema_id_uri( + #[must_use] + fn get_schema_id_uri( schema_version: RecognizedSchemaVersion, schema_form: SchemaForm, uri_prefix: SchemaUriPrefix @@ -379,7 +393,8 @@ pub trait DscRepoSchema : JsonSchema { /// version. /// /// If the type isn't published in bundled form, this function returns `None`. - #[must_use] fn get_enhanced_schema_id_uri(schema_version: RecognizedSchemaVersion) -> Option { + #[must_use] + fn get_enhanced_schema_id_uri(schema_version: RecognizedSchemaVersion) -> Option { if !Self::SCHEMA_SHOULD_BUNDLE { return None; } @@ -395,7 +410,8 @@ pub trait DscRepoSchema : JsonSchema { /// Returns the URI for the canonical (non-bundled) form of the schema with the default /// prefix for a given version. - #[must_use] fn get_canonical_schema_id_uri(schema_version: RecognizedSchemaVersion) -> String { + #[must_use] + fn get_canonical_schema_id_uri(schema_version: RecognizedSchemaVersion) -> String { get_recognized_schema_uri( Self::SCHEMA_FILE_BASE_NAME, Self::SCHEMA_FOLDER_PATH, @@ -407,7 +423,8 @@ pub trait DscRepoSchema : JsonSchema { /// Returns the URI for the bundled form of the schema with the default prefix for a given /// version. - #[must_use] fn get_bundled_schema_id_uri(schema_version: RecognizedSchemaVersion) -> Option { + #[must_use] + fn get_bundled_schema_id_uri(schema_version: RecognizedSchemaVersion) -> Option { if !Self::SCHEMA_SHOULD_BUNDLE { return None; } @@ -426,7 +443,8 @@ pub trait DscRepoSchema : JsonSchema { /// This convenience function generates a vector containing every recognized JSON Schema `$id` /// URI for a specific schema. It handles returning the schemas for every recognized prefix, /// version, and form. - #[must_use] fn recognized_schema_uris() -> Vec { + #[must_use] + fn recognized_schema_uris() -> Vec { get_recognized_schema_uris( Self::SCHEMA_FILE_BASE_NAME, Self::SCHEMA_FOLDER_PATH, @@ -441,7 +459,8 @@ pub trait DscRepoSchema : JsonSchema { /// recognized and validated. This method generates the appropriate subschema with every /// valid URI for the schema's `$id` without needing to regularly update an enum for each /// schema and release. - #[must_use] fn recognized_schema_uris_subschema(_: &mut schemars::gen::SchemaGenerator) -> Schema { + #[must_use] + fn recognized_schema_uris_subschema(_: &mut schemars::gen::SchemaGenerator) -> Schema { get_recognized_uris_subschema( Self::schema_metadata(), Self::SCHEMA_FILE_BASE_NAME, @@ -451,7 +470,8 @@ pub trait DscRepoSchema : JsonSchema { } /// Indicates whether a given string is a recognized shema URI. - #[must_use] fn is_recognized_schema_uri(uri: &String) -> bool { + #[must_use] + fn is_recognized_schema_uri(uri: &String) -> bool { Self::recognized_schema_uris().contains(uri) } @@ -476,7 +496,7 @@ pub trait DscRepoSchema : JsonSchema { } } -#[allow(unused_imports)] +#[cfg(test)] mod test { use serde::{Deserialize, Serialize};