{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/cloudera/main/json-schema/cloudera-collect-datalake-diagnostics-request-schema.json",
  "title": "CollectDatalakeDiagnosticsRequest",
  "description": "Request object for collecting DataLake diagnostics.",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudera-datalake-api-openapi.yml#/components/schemas/CollectDatalakeDiagnosticsRequest",
  "type": "object",
  "required": [
    "crn",
    "destination",
    "description"
  ],
  "properties": {
    "crn": {
      "type": "string",
      "description": "CRN of the Datalake cluster."
    },
    "destination": {
      "type": "string",
      "enum": [
        "SUPPORT",
        "CLOUD_STORAGE",
        "ENG",
        "LOCAL"
      ],
      "description": "Destination of the diagnostics collection (Support, Own cloud storage, Engineering or collect only on the nodes)"
    },
    "description": {
      "type": "string",
      "description": "Additional information / title for the diagnostics collection."
    },
    "caseNumber": {
      "type": "string",
      "description": "Optional support case number in case of SUPPORT destination, otherwise only act as additional data."
    },
    "labels": {
      "type": "array",
      "description": "Array of labels that can filter logs that are collected during diagnostics collection.",
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    },
    "startDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date timestamp - collect files only for diagnostics that has higher last modified timestamp value than this."
    },
    "endDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date timestamp - collect files only for diagnostics that has lower created timestamp value than this."
    },
    "additionalLogs": {
      "type": "array",
      "description": "Array of log descriptors that should be additionally collected during diagnostics collection.",
      "items": {
        "$ref": "#/$defs/DatalakeVmLogRequest"
      }
    },
    "hosts": {
      "type": "array",
      "description": "Array of host names (fqdn), collection will run only on the dedicated hosts.",
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    },
    "hostGroups": {
      "type": "array",
      "description": "Array of host groups, collection will run only on the dedicated hosts that belongs to these host groups.",
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    },
    "excludeHosts": {
      "type": "array",
      "description": "Array of host names (fqdn or IP address), collection will not run on the excluded hosts.",
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    },
    "skipUnresponsiveHosts": {
      "type": "boolean",
      "description": "Skip unhealthy hosts from the diagnostics collection."
    },
    "includeNginxReport": {
      "type": "boolean",
      "description": "Include Nginx report generated by GoAccess (if available)."
    },
    "includeSaltLogs": {
      "type": "boolean",
      "description": "Include salt minion/master/api system logs in the diagnostics collection."
    },
    "includeSarOutput": {
      "type": "boolean",
      "description": "Include SAR (System Activity Report) generated outputs in the diagnostics collection (if available)."
    },
    "updatePackage": {
      "type": "boolean",
      "default": false,
      "description": "If enabled, required package (cdp-telemetry) will be upgraded or installed on the nodes. (useful if package is not installed or needs to be upgraded) Network is required for this operation."
    },
    "storageValidation": {
      "type": "boolean",
      "default": false,
      "description": "Enable/disable node level storage validation (can be disabled for example, if you have too many hosts and do not want to do too much parallel writes to s3/abfs)"
    }
  },
  "$defs": {
    "DatalakeVmLogRequest": {
      "type": "object",
      "description": "Log descriptor, contains a path and label pair. Used for diagnostics collections.",
      "required": [
        "path",
        "label"
      ],
      "properties": {
        "path": {
          "type": "string",
          "description": "Path of the log file(s) that needs to be collected. (Can be glob wildcard)"
        },
        "label": {
          "type": "string",
          "description": "Label that will be used to identify a log descriptor. (will be used as a folder inside logs folder)"
        }
      }
    }
  }
}