{
  "$id": "https://schemas.sand.binaryedge.io/minion/modules/service",
  "title": "Service Module Body",
  "type": "object",
  "properties": {
    "scripts": {
      "$ref": "#/$defs/scripts"
    },
    "service": {
      "$ref": "#/$defs/service"
    },
    "state": {
      "$ref": "#/$defs/state"
    }
  },
  "required": [
    "service",
    "state"
  ],
  "additionalProperties": false,
  "$defs": {
    "scripts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "output": {
            "type": "string"
          },
          "results": {
            "type": "array"
          }
        },
        "required": [
          "id",
          "output"
        ],
        "additionalProperties": false
      }
    },
    "service": {
      "type": "object",
      "properties": {
        "cpe": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "devicetype": {
          "type": "string"
        },
        "extrainfo": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "ostype": {
          "type": "string"
        },
        "product": {
          "type": "string"
        },
        "version": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "state": {
      "type": "object",
      "properties": {
        "reason": {
          "type": "string"
        },
        "reason_ip": {
          "type": "string"
        },
        "reason_ttl": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "enum": [
            "closed",
            "closed|filtered",
            "filtered",
            "open",
            "open|filtered",
            "unfiltered"
          ]
        }
      },
      "required": [
        "reason",
        "reason_ttl",
        "state"
      ],
      "additionalProperties": false
    }
  }
}
