{
  "$id": "https://schemas.sand.binaryedge.io/minion/modules/service-simple",
  "title": "Service Simple Module Output Body",
  "type": "object",
  "properties": {
    "failed_probes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/probe_failed"
      }
    },
    "probe": {
      "$ref": "#/$defs/probe"
    },
    "service": {
      "$ref": "#/$defs/service"
    },
    "state": {
      "$ref": "#/$defs/state"
    },
    "total_delta": {
      "type": "number"
    }
  },
  "required": [
    "service",
    "state"
  ],
  "additionalProperties": false,
  "$defs": {
    "probe": {
      "type": "object",
      "properties": {
        "data": {
          "type": "object",
          "properties": {
            "recv": {
              "type": "string"
            },
            "sent": {
              "type": "string"
            }
          },
          "required": [
            "recv",
            "sent"
          ],
          "additionalProperties": false
        },
        "info": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "stats": {
          "type": "object",
          "properties": {
            "matching_delta": {
              "type": "number"
            },
            "probing_delta": {
              "type": "number"
            }
          },
          "required": [
            "matching_delta",
            "probing_delta"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "data",
        "info"
      ],
      "additionalProperties": false
    },
    "probe_failed": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "recv": {
          "type": "string"
        },
        "sent": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "recv",
        "sent"
      ],
      "additionalProperties": false
    },
    "service": {
      "type": "object",
      "properties": {
        "cpe": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "device": {
          "type": "string"
        },
        "directive": {
          "type": "string",
          "enum": [
            "extract",
            "match",
            "softmatch",
            "table"
          ]
        },
        "extrainfo": {
          "type": "string"
        },
        "hostname": {
          "$comment": "This field is not restricted to valid hostnames because the contents are often non-compliant, such as including underscores.",
          "type": "string"
        },
        "method": {
          "type": "string",
          "enum": [
            "probe_extraction",
            "probe_matching",
            "probe_matching/probe_extraction",
            "table_default"
          ]
        },
        "name": {
          "type": "string"
        },
        "ostype": {
          "type": "string"
        },
        "product": {
          "type": "string"
        },
        "version": {
          "type": "string"
        }
      },
      "required": [
        "method",
        "name"
      ],
      "additionalProperties": false
    },
    "state": {
      "$comment": "This field previously allowed more states, but now we only emit results for open ports.",
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "open"
          ]
        }
      },
      "required": [
        "state"
      ],
      "additionalProperties": false
    }
  }
}
