{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-networking-services/json-schema/azure-networking-services-connection-analyzer-query-status-result-schema.json",
  "title": "ConnectionAnalyzerQueryStatusResult",
  "description": "Status result returned when querying a connection analyzer for its diagnostic results.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-networking-services-connectionanalyzers-api-openapi.yml#/components/schemas/ConnectionAnalyzerQueryStatusResult",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resource ID of the connection analyzer.",
      "readOnly": true
    },
    "connectionAnalyzerStatus": {
      "$ref": "#/$defs/ConnectionAnalyzerStatus",
      "description": "Current execution status of the connection analyzer."
    },
    "error": {
      "type": "string",
      "description": "Error message if the connection analyzer operation failed."
    },
    "outputStoragePath": {
      "type": "string",
      "description": "Storage path where the connection analyzer output is written."
    },
    "expiryInUtc": {
      "type": "string",
      "format": "date-time",
      "description": "UTC time when the connection analyzer expires."
    },
    "diagnosticOperationResults": {
      "type": "array",
      "description": "Results of the individual diagnostic operations.",
      "items": {
        "$ref": "#/$defs/DiagnosticOperationResult"
      },
      "x-ms-identifiers": [
        "diagnosticOperation"
      ]
    }
  },
  "$defs": {
    "ConnectionAnalyzerStatus": {
      "type": "string",
      "description": "Current execution status of the connection analyzer.",
      "enum": [
        "NotStarted",
        "Running",
        "Succeeded",
        "Failed"
      ],
      "x-ms-enum": {
        "name": "ConnectionAnalyzerStatus",
        "modelAsString": true,
        "values": [
          {
            "name": "NotStarted",
            "value": "NotStarted",
            "description": "The connection analyzer has been created but execution has not yet begun."
          },
          {
            "name": "Running",
            "value": "Running",
            "description": "The connection analyzer is currently running its diagnostic operations."
          },
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "The connection analyzer completed all diagnostic operations successfully."
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "The connection analyzer failed to complete its diagnostic operations."
          }
        ]
      }
    },
    "DiagnosticOperation": {
      "type": "string",
      "description": "The type of diagnostic operation to run on a connection analyzer.",
      "enum": [
        "NextHop",
        "NSG",
        "PortScan",
        "ConnectivityCheck",
        "ExpressRouteDiagnostic"
      ],
      "x-ms-enum": {
        "name": "DiagnosticOperation",
        "modelAsString": true,
        "values": [
          {
            "name": "NextHop",
            "value": "NextHop",
            "description": "Determines the next hop for traffic from the source to the destination."
          },
          {
            "name": "NSG",
            "value": "NSG",
            "description": "Evaluates the network security group rules that apply to the traffic."
          },
          {
            "name": "PortScan",
            "value": "PortScan",
            "description": "Scans the destination ports to determine their reachability."
          },
          {
            "name": "ConnectivityCheck",
            "value": "ConnectivityCheck",
            "description": "Performs an end-to-end connectivity check between the source and destination."
          },
          {
            "name": "ExpressRouteDiagnostic",
            "value": "ExpressRouteDiagnostic",
            "description": "Runs Express Route specific diagnostics for the connection."
          }
        ]
      }
    },
    "DiagnosticOperationResult": {
      "type": "object",
      "description": "Result of an individual diagnostic operation run by a connection analyzer.",
      "properties": {
        "diagnosticOperation": {
          "$ref": "#/$defs/DiagnosticOperation",
          "description": "The diagnostic operation that was run."
        },
        "error": {
          "type": "string",
          "description": "Error encountered while running the diagnostic operation, if any."
        },
        "result": {
          "type": "string",
          "description": "The result of the diagnostic operation, serialized as a JSON string.\n\nThe payload shape varies by `diagnosticOperation`. For example, a\n`ConnectivityCheck` operation returns a JSON object such as\n`{ \"ConnectivityStatus\": \"Reachable\" }`. Consumers should parse this\nstring as JSON according to the corresponding diagnostic operation."
        }
      },
      "required": [
        "diagnosticOperation"
      ]
    }
  }
}