Freigeben über


dsc-Schema

Zusammenfassung

Ruft das JSON-Schema für einen DSC-Typ ab.

Syntax

dsc schema [Options] --type <TYPE>

BESCHREIBUNG

Der schema Befehl gibt das JSON-Schema für einen bestimmten DSC-Typ zurück. Diese Schemas können verwendet werden, um die Rückgabedaten aus der Anwendung zu überprüfen oder kompatible Typdefinitionen für ein integrationsfähiges Tool zu generieren.

Die Anwendung verwendet diese Schemas, um Daten intern zu überprüfen, wenn sie empfangen oder die Ausgabe für einen der Befehle der Anwendung darstellen.

Beispiele

Beispiel 1: Abrufen des Schemas für das Get-Befehlsergebnis der dsc-Ressource

dsc schema --type get-result
$schema: http://json-schema.org/draft-07/schema#
title: GetResult
anyOf:
- $ref: '#/definitions/ResourceGetResponse'
- type: array
  items:
    $ref: '#/definitions/ResourceGetResult'
definitions:
  ResourceGetResponse:
    type: object
    required:
    - actualState
    properties:
      actualState:
        description: The state of the resource as it was returned by the Get method.
    additionalProperties: false
  ResourceGetResult:
    type: object
    required:
    - name
    - result
    - type
    properties:
      metadata:
        anyOf:
        - $ref: '#/definitions/Metadata'
        - type: 'null'
      name:
        type: string
      type:
        type: string
      result:
        $ref: '#/definitions/GetResult'
    additionalProperties: false
  Metadata:
    type: object
    properties:
      Microsoft.DSC:
        anyOf:
        - $ref: '#/definitions/MicrosoftDscMetadata'
        - type: 'null'
  MicrosoftDscMetadata:
    type: object
    properties:
      version:
        description: Version of DSC
        type:
        - string
        - 'null'
      operation:
        description: The operation being performed
        anyOf:
        - $ref: '#/definitions/Operation'
        - type: 'null'
      executionType:
        description: The type of execution
        anyOf:
        - $ref: '#/definitions/ExecutionKind'
        - type: 'null'
      startDatetime:
        description: The start time of the configuration operation
        type:
        - string
        - 'null'
      endDatetime:
        description: The end time of the configuration operation
        type:
        - string
        - 'null'
      duration:
        description: The duration of the configuration operation
        type:
        - string
        - 'null'
      securityContext:
        description: The security context of the configuration operation, can be specified to be required
        anyOf:
        - $ref: '#/definitions/SecurityContextKind'
        - type: 'null'
      context:
        description: Identifies if the operation is part of a configuration
        anyOf:
        - $ref: '#/definitions/ContextKind'
        - type: 'null'
  Operation:
    type: string
    enum:
    - Get
    - Set
    - Test
    - Export
  ExecutionKind:
    type: string
    enum:
    - Actual
    - WhatIf
  SecurityContextKind:
    type: string
    enum:
    - Current
    - Elevated
    - Restricted
  ContextKind:
    type: string
    enum:
    - Configuration
    - Resource
  GetResult:
    anyOf:
    - $ref: '#/definitions/ResourceGetResponse'
    - type: array
      items:
        $ref: '#/definitions/ResourceGetResult'

Optionen

-t, --type

Diese Option ist für den schema Befehl obligatorisch. Der Wert für diese Option bestimmt, welches Schema die Anwendung zurückgibt:

  • dsc-resource (Referenzdokumentation): Stellt eine DSC-Ressource wie vom dsc resource list Befehl zurückgegeben dar.
  • resource-manifest (Referenzdokumentation): Überprüft das Manifest einer befehlsbasierten DSC-Ressource. Wenn das Manifest ungültig ist, löst DSC einen Fehler aus.
  • get-result (Referenzdokumentation): Stellt die Ausgabe des dsc resource get Befehls dar.
  • set-result (Referenzdokumentation): Stellt die Ausgabe des dsc resource set Befehls dar.
  • test-result (Referenzdokumentation): Stellt die Ausgabe des dsc resource test Befehls dar.
  • configuration (Referenzdokumentation): Überprüft ein DSC-Konfigurationsdokument. Wenn das Dokument ungültig ist, löst DSC einen Fehler aus.
  • configuration-get-result (Referenzdokumentation): Stellt die Ausgabe des dsc config get Befehls dar.
  • configuration-set-result (Referenzdokumentation): Stellt die Ausgabe des dsc config set Befehls dar.
  • configuration-test-result (Referenzdokumentation): Stellt die Ausgabe des dsc config test Befehls dar.
Type:        String
Mandatory:   true
ValidValues: [
               dsc-resource,
               resource-manifest,
               get-result,
               set-result,
               test-result,
               configuration,
               configuration-get-result,
               configuration-set-result,
               configuration-test-result
             ]

-f, --format

Die --format Option steuert das Konsolenausgabeformat für den Befehl. Wenn die Befehlsausgabe umgeleitet oder als Variable erfasst wird, ist die Ausgabe immer JSON.

Type:         String
Mandatory:    false
DefaultValue: yaml
ValidValues:  [json, pretty-json, yaml]

-h, --help

Zeigt die Hilfe für den aktuellen Befehl oder Unterbefehl an. Wenn Sie diese Option angeben, ignoriert die Anwendung alle Optionen und Argumente nach dieser Option.

Type:      Boolean
Mandatory: false