{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-arc/json-schema/microsoft-azure-arc-machine-extension-schema.json",
  "title": "MachineExtension",
  "description": "Describes a Machine Extension.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-arc-machineextensions-api-openapi.yml#/components/schemas/MachineExtension",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/MachineExtensionProperties",
      "description": "Describes Machine Extension Properties."
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/TrackedResource"
    }
  ],
  "$defs": {
    "MachineExtensionInstanceView": {
      "type": "object",
      "description": "Describes the Machine Extension Instance View.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The machine extension name."
        },
        "type": {
          "type": "string",
          "description": "Specifies the type of the extension; an example is \"CustomScriptExtension\"."
        },
        "typeHandlerVersion": {
          "type": "string",
          "description": "Specifies the version of the script handler."
        },
        "status": {
          "$ref": "#/$defs/MachineExtensionInstanceViewStatus",
          "description": "Instance view status."
        }
      }
    },
    "MachineExtensionInstanceViewStatus": {
      "type": "object",
      "description": "Instance view status.",
      "properties": {
        "code": {
          "type": "string",
          "description": "The status code."
        },
        "level": {
          "$ref": "#/$defs/StatusLevelTypes",
          "description": "The level code."
        },
        "displayStatus": {
          "type": "string",
          "description": "The short localizable label for the status."
        },
        "message": {
          "type": "string",
          "description": "The detailed status message, including for alerts and error messages."
        },
        "time": {
          "type": "string",
          "format": "date-time",
          "description": "The time of the status."
        }
      }
    },
    "MachineExtensionProperties": {
      "type": "object",
      "description": "Describes the properties of a Machine Extension.",
      "properties": {
        "forceUpdateTag": {
          "type": "string",
          "description": "How the extension handler should be forced to update even if the extension configuration has not changed."
        },
        "publisher": {
          "type": "string",
          "description": "The name of the extension handler publisher."
        },
        "type": {
          "type": "string",
          "description": "Specifies the type of the extension; an example is \"CustomScriptExtension\"."
        },
        "typeHandlerVersion": {
          "type": "string",
          "description": "Specifies the version of the script handler."
        },
        "enableAutomaticUpgrade": {
          "type": "boolean",
          "description": "Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available."
        },
        "autoUpgradeMinorVersion": {
          "type": "boolean",
          "description": "Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true."
        },
        "settings": {
          "type": "object",
          "description": "Json formatted public settings for the extension.",
          "additionalProperties": {}
        },
        "protectedSettings": {
          "type": "object",
          "description": "The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.",
          "additionalProperties": {}
        },
        "provisioningState": {
          "type": "string",
          "description": "The provisioning state, which only appears in the response.",
          "readOnly": true
        },
        "instanceView": {
          "$ref": "#/$defs/MachineExtensionInstanceView",
          "description": "The machine extension instance view."
        }
      }
    },
    "StatusLevelTypes": {
      "type": "string",
      "description": "The level code.",
      "enum": [
        "Info",
        "Warning",
        "Error"
      ],
      "x-ms-enum": {
        "name": "StatusLevelTypes",
        "modelAsString": true,
        "values": [
          {
            "name": "Info",
            "value": "Info",
            "description": "Info"
          },
          {
            "name": "Warning",
            "value": "Warning",
            "description": "Warning"
          },
          {
            "name": "Error",
            "value": "Error",
            "description": "Error"
          }
        ]
      }
    },
    "TrackedResource": {
      "type": "object",
      "title": "Tracked Resource",
      "description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'",
      "properties": {
        "tags": {
          "type": "object",
          "description": "Resource tags.",
          "additionalProperties": {
            "type": "string"
          },
          "x-ms-mutability": [
            "read",
            "create",
            "update"
          ]
        },
        "location": {
          "type": "string",
          "description": "The geo-location where the resource lives",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        }
      },
      "required": [
        "location"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ]
    }
  }
}