Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend schema manifest to include kind #139

Closed
michaeltlombardi opened this issue Aug 4, 2023 · 1 comment · Fixed by #338
Closed

Extend schema manifest to include kind #139

michaeltlombardi opened this issue Aug 4, 2023 · 1 comment · Fixed by #338
Assignees
Labels
Issue-Enhancement The issue is a feature or idea Need-Review

Comments

@michaeltlombardi
Copy link
Collaborator

michaeltlombardi commented Aug 4, 2023

Summary of the new feature / enhancement

As a resource author and integrating vendor, I want to be able to quickly distinguish between standard command-based DSC Resources, resource groups, and resource providers without having to inspect the full manifest in detail

Proposed technical implementation details (optional)

Add a kind property to the DSC Resource manifest that supports three enum values:

  • standard - a "normal" command-based DSC Resource, not a group or provider. This is the default value if the key isn't specified.
  • group - a resource group, always has nested resources as properties under the resources keyword. May have other properties that influence how the resource group behaves. When kind is set to group, the validate property is required.
  • provider - a resource provider, a special resource group that enables the use of non-command-based DSC Resources. When kind is set to provider, the validate and provider properties are required.

After kind is included in the resource manifest, the dsc resource list command should surface the resource kind in the default output and at the top-level.

@SteveL-MSFT
Copy link
Member

Alternate proposal, in the resource.json, have the kind be the property name instead of the property value:

So instead of what we have today:

{
    "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json",
    "type": "DSC/PowerShellGroup",
    "version": "0.1.0",
    "description": "Resource provider to classic DSC Powershell resources.",
    "tags": [
      "PowerShell"
    ],
    "provider": {
      "list": {
        "executable": "pwsh",
        "args": [
          "-NoLogo",
          "-NonInteractive",
          "-NoProfile",
          "-Command",
          "./powershellgroup.resource.ps1 List"
        ]
        },
      "config": "full"
    },
    "get": {
      "executable": "pwsh",
      "args": [
        "-NoLogo",
        "-NonInteractive",
        "-NoProfile",
        "-Command",
        "$Input | ./powershellgroup.resource.ps1 Get"
      ],
      "input": "stdin"
      },

This becomes:

{
    "$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json",
    "type": "DSC/PowerShellGroup",
    "version": "0.1.0",
    "description": "Resource provider to classic DSC Powershell resources.",
    "tags": [
      "PowerShell"
    ],
    "provider": {
      "list": {
        "executable": "pwsh",
        "args": [
          "-NoLogo",
          "-NonInteractive",
          "-NoProfile",
          "-Command",
          "./powershellgroup.resource.ps1 List"
        ]
        },
      "config": "full",
      "get": {
        "executable": "pwsh",
        "args": [
          "-NoLogo",
          "-NonInteractive",
          "-NoProfile",
          "-Command",
          "$Input | ./powershellgroup.resource.ps1 Get"
        ],
        "input": "stdin"
        },
      },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement The issue is a feature or idea Need-Review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants