{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-networking-services/json-schema/azure-networking-services-connection-monitor-schema.json",
  "title": "ConnectionMonitor",
  "description": "Parameters that define the operation to create a connection monitor.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-networking-services-connectionmonitors-api-openapi.yml#/components/schemas/ConnectionMonitor",
  "type": "object",
  "properties": {
    "location": {
      "type": "string",
      "description": "Connection monitor location."
    },
    "tags": {
      "type": "object",
      "description": "Connection monitor tags.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "properties": {
      "$ref": "#/$defs/ConnectionMonitorParameters",
      "description": "Properties of the connection monitor.",
      "x-ms-client-flatten": true
    }
  },
  "required": [
    "properties"
  ],
  "$defs": {
    "ConnectionMonitorDestination": {
      "type": "object",
      "description": "Describes the destination of connection monitor.",
      "properties": {
        "resourceId": {
          "type": "string",
          "description": "The ID of the resource used as the destination by connection monitor."
        },
        "address": {
          "type": "string",
          "description": "Address of the connection monitor destination (IP or domain name)."
        },
        "port": {
          "type": "integer",
          "format": "int32",
          "description": "The destination port used by connection monitor.",
          "minimum": 0,
          "maximum": 65535
        }
      }
    },
    "ConnectionMonitorEndpoint": {
      "type": "object",
      "description": "Describes the connection monitor endpoint.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the connection monitor endpoint."
        },
        "type": {
          "$ref": "#/$defs/EndpointType",
          "description": "The endpoint type."
        },
        "resourceId": {
          "type": "string",
          "description": "Resource ID of the connection monitor endpoint are supported for AzureVM, AzureVMSS, AzureVNet, AzureSubnet, MMAWorkspaceMachine, MMAWorkspaceNetwork, AzureArcVM endpoint type."
        },
        "address": {
          "type": "string",
          "description": "Address of the connection monitor endpoint. Supported for AzureVM, ExternalAddress, ArcMachine, MMAWorkspaceMachine endpoint type."
        },
        "filter": {
          "$ref": "#/$defs/ConnectionMonitorEndpointFilter",
          "description": "Filter field is getting deprecated and should not be used. Instead use Include/Exclude scope fields for it."
        },
        "scope": {
          "$ref": "#/$defs/ConnectionMonitorEndpointScope",
          "description": "Endpoint scope defines which target resource to monitor in case of compound resource endpoints like VMSS, AzureSubnet, AzureVNet, MMAWorkspaceNetwork, AzureArcNetwork."
        },
        "coverageLevel": {
          "$ref": "#/$defs/CoverageLevel",
          "description": "Test coverage for the endpoint."
        },
        "locationDetails": {
          "$ref": "#/$defs/ConnectionMonitorEndpointLocationDetails",
          "description": "Location details is optional and only being used for 'AzureArcNetwork' type endpoints, which contains region details."
        },
        "subscriptionId": {
          "type": "string",
          "description": "Subscription ID for connection monitor endpoint. It's an optional parameter which is being used for 'AzureArcNetwork' type endpoint."
        }
      },
      "required": [
        "name"
      ]
    },
    "ConnectionMonitorEndpointFilter": {
      "type": "object",
      "description": "Describes the connection monitor endpoint filter.",
      "properties": {
        "type": {
          "$ref": "#/$defs/ConnectionMonitorEndpointFilterType",
          "description": "The behavior of the endpoint filter. Currently only 'Include' is supported."
        },
        "items": {
          "type": "array",
          "description": "List of items in the filter.",
          "items": {
            "$ref": "#/$defs/ConnectionMonitorEndpointFilterItem"
          }
        }
      }
    },
    "ConnectionMonitorEndpointFilterItem": {
      "type": "object",
      "description": "Describes the connection monitor endpoint filter item.",
      "properties": {
        "type": {
          "$ref": "#/$defs/ConnectionMonitorEndpointFilterItemType",
          "description": "The type of item included in the filter. Currently only 'AgentAddress' is supported."
        },
        "address": {
          "type": "string",
          "description": "The address of the filter item."
        }
      }
    },
    "ConnectionMonitorEndpointFilterItemType": {
      "type": "string",
      "description": "The type of item included in the filter. Currently only 'AgentAddress' is supported.",
      "enum": [
        "AgentAddress"
      ],
      "x-ms-enum": {
        "name": "ConnectionMonitorEndpointFilterItemType",
        "modelAsString": true,
        "values": [
          {
            "name": "AgentAddress",
            "value": "AgentAddress",
            "description": "AgentAddress"
          }
        ]
      }
    },
    "ConnectionMonitorEndpointFilterType": {
      "type": "string",
      "description": "The behavior of the endpoint filter. Currently only 'Include' is supported.",
      "enum": [
        "Include"
      ],
      "x-ms-enum": {
        "name": "ConnectionMonitorEndpointFilterType",
        "modelAsString": true,
        "values": [
          {
            "name": "Include",
            "value": "Include",
            "description": "Include"
          }
        ]
      }
    },
    "ConnectionMonitorEndpointLocationDetails": {
      "type": "object",
      "description": "Connection monitor endpoint location details only being used for 'AzureArcNetwork' type endpoints, which contains the region details.",
      "properties": {
        "region": {
          "type": "string",
          "description": "Region for connection monitor endpoint."
        }
      }
    },
    "ConnectionMonitorEndpointScope": {
      "type": "object",
      "description": "Describes the connection monitor endpoint scope.",
      "properties": {
        "include": {
          "type": "array",
          "description": "List of items which needs to be included to the endpoint scope.",
          "items": {
            "$ref": "#/$defs/ConnectionMonitorEndpointScopeItem"
          }
        },
        "exclude": {
          "type": "array",
          "description": "List of items which needs to be excluded from the endpoint scope.",
          "items": {
            "$ref": "#/$defs/ConnectionMonitorEndpointScopeItem"
          }
        }
      }
    },
    "ConnectionMonitorEndpointScopeItem": {
      "type": "object",
      "description": "Describes the connection monitor endpoint scope item.",
      "properties": {
        "address": {
          "type": "string",
          "description": "The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or IPv4/IPv6 IP address."
        }
      }
    },
    "ConnectionMonitorHttpConfiguration": {
      "type": "object",
      "description": "Describes the HTTP configuration.",
      "properties": {
        "port": {
          "type": "integer",
          "format": "int32",
          "description": "The port to connect to.",
          "minimum": 0,
          "maximum": 65535
        },
        "method": {
          "$ref": "#/$defs/HTTPConfigurationMethod",
          "description": "The HTTP method to use."
        },
        "path": {
          "type": "string",
          "description": "The path component of the URI. For instance, \"/dir1/dir2\"."
        },
        "requestHeaders": {
          "type": "array",
          "description": "The HTTP headers to transmit with the request.",
          "items": {
            "$ref": "#/$defs/HTTPHeader"
          }
        },
        "validStatusCodeRanges": {
          "type": "array",
          "description": "HTTP status codes to consider successful. For instance, \"2xx,301-304,418\".",
          "items": {
            "type": "string"
          }
        },
        "preferHTTPS": {
          "type": "boolean",
          "description": "Value indicating whether HTTPS is preferred over HTTP in cases where the choice is not explicit."
        }
      }
    },
    "ConnectionMonitorIcmpConfiguration": {
      "type": "object",
      "description": "Describes the ICMP configuration.",
      "properties": {
        "disableTraceRoute": {
          "type": "boolean",
          "description": "Value indicating whether path evaluation with trace route should be disabled."
        }
      }
    },
    "ConnectionMonitorOutput": {
      "type": "object",
      "description": "Describes a connection monitor output destination.",
      "properties": {
        "type": {
          "$ref": "#/$defs/OutputType",
          "description": "Connection monitor output destination type. Currently, only \"Workspace\" is supported."
        },
        "workspaceSettings": {
          "$ref": "#/$defs/ConnectionMonitorWorkspaceSettings",
          "description": "Describes the settings for producing output into a log analytics workspace."
        }
      }
    },
    "ConnectionMonitorParameters": {
      "type": "object",
      "description": "Parameters that define the operation to create a connection monitor.",
      "properties": {
        "source": {
          "$ref": "#/$defs/ConnectionMonitorSource",
          "description": "Describes the source of connection monitor."
        },
        "destination": {
          "$ref": "#/$defs/ConnectionMonitorDestination",
          "description": "Describes the destination of connection monitor."
        },
        "autoStart": {
          "type": "boolean",
          "description": "Determines if the connection monitor will start automatically once created.",
          "default": true
        },
        "monitoringIntervalInSeconds": {
          "type": "integer",
          "format": "int32",
          "description": "Monitoring interval in seconds.",
          "default": 60,
          "minimum": 30,
          "maximum": 1800
        },
        "endpoints": {
          "type": "array",
          "description": "List of connection monitor endpoints.",
          "items": {
            "$ref": "#/$defs/ConnectionMonitorEndpoint"
          }
        },
        "testConfigurations": {
          "type": "array",
          "description": "List of connection monitor test configurations.",
          "items": {
            "$ref": "#/$defs/ConnectionMonitorTestConfiguration"
          }
        },
        "testGroups": {
          "type": "array",
          "description": "List of connection monitor test groups.",
          "items": {
            "$ref": "#/$defs/ConnectionMonitorTestGroup"
          }
        },
        "outputs": {
          "type": "array",
          "description": "List of connection monitor outputs.",
          "items": {
            "$ref": "#/$defs/ConnectionMonitorOutput"
          }
        },
        "notes": {
          "type": "string",
          "description": "Optional notes to be associated with the connection monitor."
        }
      }
    },
    "ConnectionMonitorSource": {
      "type": "object",
      "description": "Describes the source of connection monitor.",
      "properties": {
        "resourceId": {
          "type": "string",
          "description": "The ID of the resource used as the source by connection monitor."
        },
        "port": {
          "type": "integer",
          "format": "int32",
          "description": "The source port used by connection monitor.",
          "minimum": 0,
          "maximum": 65535
        }
      },
      "required": [
        "resourceId"
      ]
    },
    "ConnectionMonitorSuccessThreshold": {
      "type": "object",
      "description": "Describes the threshold for declaring a test successful.",
      "properties": {
        "checksFailedPercent": {
          "type": "integer",
          "format": "int32",
          "description": "The maximum percentage of failed checks permitted for a test to evaluate as successful."
        },
        "roundTripTimeMs": {
          "type": "number",
          "format": "float",
          "description": "The maximum round-trip time in milliseconds permitted for a test to evaluate as successful."
        }
      }
    },
    "ConnectionMonitorTcpConfiguration": {
      "type": "object",
      "description": "Describes the TCP configuration.",
      "properties": {
        "port": {
          "type": "integer",
          "format": "int32",
          "description": "The port to connect to.",
          "minimum": 0,
          "maximum": 65535
        },
        "disableTraceRoute": {
          "type": "boolean",
          "description": "Value indicating whether path evaluation with trace route should be disabled."
        },
        "destinationPortBehavior": {
          "$ref": "#/$defs/DestinationPortBehavior",
          "description": "Destination port behavior."
        }
      }
    },
    "ConnectionMonitorTestConfiguration": {
      "type": "object",
      "description": "Describes a connection monitor test configuration.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the connection monitor test configuration."
        },
        "testFrequencySec": {
          "type": "integer",
          "format": "int32",
          "description": "The frequency of test evaluation, in seconds."
        },
        "protocol": {
          "$ref": "#/$defs/ConnectionMonitorTestConfigurationProtocol",
          "description": "The protocol to use in test evaluation."
        },
        "preferredIPVersion": {
          "$ref": "#/$defs/PreferredIPVersion",
          "description": "The preferred IP version to use in test evaluation. The connection monitor may choose to use a different version depending on other parameters."
        },
        "httpConfiguration": {
          "$ref": "#/$defs/ConnectionMonitorHttpConfiguration",
          "description": "The parameters used to perform test evaluation over HTTP."
        },
        "tcpConfiguration": {
          "$ref": "#/$defs/ConnectionMonitorTcpConfiguration",
          "description": "The parameters used to perform test evaluation over TCP."
        },
        "icmpConfiguration": {
          "$ref": "#/$defs/ConnectionMonitorIcmpConfiguration",
          "description": "The parameters used to perform test evaluation over ICMP."
        },
        "successThreshold": {
          "$ref": "#/$defs/ConnectionMonitorSuccessThreshold",
          "description": "The threshold for declaring a test successful."
        }
      },
      "required": [
        "name",
        "protocol"
      ]
    },
    "ConnectionMonitorTestConfigurationProtocol": {
      "type": "string",
      "description": "The protocol to use in test evaluation.",
      "enum": [
        "Tcp",
        "Http",
        "Icmp"
      ],
      "x-ms-enum": {
        "name": "ConnectionMonitorTestConfigurationProtocol",
        "modelAsString": true,
        "values": [
          {
            "name": "Tcp",
            "value": "Tcp",
            "description": "Tcp"
          },
          {
            "name": "Http",
            "value": "Http",
            "description": "Http"
          },
          {
            "name": "Icmp",
            "value": "Icmp",
            "description": "Icmp"
          }
        ]
      }
    },
    "ConnectionMonitorTestGroup": {
      "type": "object",
      "description": "Describes the connection monitor test group.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the connection monitor test group."
        },
        "disable": {
          "type": "boolean",
          "description": "Value indicating whether test group is disabled."
        },
        "testConfigurations": {
          "type": "array",
          "description": "List of test configuration names.",
          "items": {
            "type": "string"
          }
        },
        "sources": {
          "type": "array",
          "description": "List of source endpoint names.",
          "items": {
            "type": "string"
          }
        },
        "destinations": {
          "type": "array",
          "description": "List of destination endpoint names.",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "name",
        "testConfigurations",
        "sources",
        "destinations"
      ]
    },
    "ConnectionMonitorWorkspaceSettings": {
      "type": "object",
      "description": "Describes the settings for producing output into a log analytics workspace.",
      "properties": {
        "workspaceResourceId": {
          "type": "string",
          "description": "Log analytics workspace resource ID."
        }
      }
    },
    "CoverageLevel": {
      "type": "string",
      "description": "Test coverage for the endpoint.",
      "enum": [
        "Default",
        "Low",
        "BelowAverage",
        "Average",
        "AboveAverage",
        "Full"
      ],
      "x-ms-enum": {
        "name": "CoverageLevel",
        "modelAsString": true,
        "values": [
          {
            "name": "Default",
            "value": "Default",
            "description": "Default"
          },
          {
            "name": "Low",
            "value": "Low",
            "description": "Low"
          },
          {
            "name": "BelowAverage",
            "value": "BelowAverage",
            "description": "BelowAverage"
          },
          {
            "name": "Average",
            "value": "Average",
            "description": "Average"
          },
          {
            "name": "AboveAverage",
            "value": "AboveAverage",
            "description": "AboveAverage"
          },
          {
            "name": "Full",
            "value": "Full",
            "description": "Full"
          }
        ]
      }
    },
    "DestinationPortBehavior": {
      "type": "string",
      "description": "Destination port behavior.",
      "enum": [
        "None",
        "ListenIfAvailable"
      ],
      "x-ms-enum": {
        "name": "DestinationPortBehavior",
        "modelAsString": true,
        "values": [
          {
            "name": "None",
            "value": "None",
            "description": "None"
          },
          {
            "name": "ListenIfAvailable",
            "value": "ListenIfAvailable",
            "description": "ListenIfAvailable"
          }
        ]
      }
    },
    "EndpointType": {
      "type": "string",
      "description": "The endpoint type.",
      "enum": [
        "AzureVM",
        "AzureVNet",
        "AzureSubnet",
        "ExternalAddress",
        "MMAWorkspaceMachine",
        "MMAWorkspaceNetwork",
        "AzureArcVM",
        "AzureVMSS",
        "AzureArcNetwork"
      ],
      "x-ms-enum": {
        "name": "EndpointType",
        "modelAsString": true,
        "values": [
          {
            "name": "AzureVM",
            "value": "AzureVM",
            "description": "AzureVM"
          },
          {
            "name": "AzureVNet",
            "value": "AzureVNet",
            "description": "AzureVNet"
          },
          {
            "name": "AzureSubnet",
            "value": "AzureSubnet",
            "description": "AzureSubnet"
          },
          {
            "name": "ExternalAddress",
            "value": "ExternalAddress",
            "description": "ExternalAddress"
          },
          {
            "name": "MMAWorkspaceMachine",
            "value": "MMAWorkspaceMachine",
            "description": "MMAWorkspaceMachine"
          },
          {
            "name": "MMAWorkspaceNetwork",
            "value": "MMAWorkspaceNetwork",
            "description": "MMAWorkspaceNetwork"
          },
          {
            "name": "AzureArcVM",
            "value": "AzureArcVM",
            "description": "AzureArcVM"
          },
          {
            "name": "AzureVMSS",
            "value": "AzureVMSS",
            "description": "AzureVMSS"
          },
          {
            "name": "AzureArcNetwork",
            "value": "AzureArcNetwork",
            "description": "AzureArcNetwork"
          }
        ]
      }
    },
    "HTTPConfigurationMethod": {
      "type": "string",
      "description": "The HTTP method to use.",
      "enum": [
        "Get",
        "Post"
      ],
      "x-ms-enum": {
        "name": "HTTPConfigurationMethod",
        "modelAsString": true,
        "values": [
          {
            "name": "Get",
            "value": "Get",
            "description": "Get"
          },
          {
            "name": "Post",
            "value": "Post",
            "description": "Post"
          }
        ]
      }
    },
    "HTTPHeader": {
      "type": "object",
      "description": "The HTTP header.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name in HTTP header."
        },
        "value": {
          "type": "string",
          "description": "The value in HTTP header."
        }
      }
    },
    "OutputType": {
      "type": "string",
      "description": "Connection monitor output destination type. Currently, only \"Workspace\" is supported.",
      "enum": [
        "Workspace"
      ],
      "x-ms-enum": {
        "name": "OutputType",
        "modelAsString": true,
        "values": [
          {
            "name": "Workspace",
            "value": "Workspace",
            "description": "Workspace"
          }
        ]
      }
    },
    "PreferredIPVersion": {
      "type": "string",
      "description": "The preferred IP version to use in test evaluation. The connection monitor may choose to use a different version depending on other parameters.",
      "enum": [
        "IPv4",
        "IPv6"
      ],
      "x-ms-enum": {
        "name": "PreferredIPVersion",
        "modelAsString": true,
        "values": [
          {
            "name": "IPv4",
            "value": "IPv4",
            "description": "IPv4"
          },
          {
            "name": "IPv6",
            "value": "IPv6",
            "description": "IPv6"
          }
        ]
      }
    }
  }
}