{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://apidocs.iqrf.org/openapi/iqrf-gateway-webapp/latest/schemas/gatewayInfo.json",
    "type": "object",
    "title": "Gateway Information",
    "additionalProperties": false,
    "required": [
        "board",
        "gwId",
        "gwImage",
        "os",
        "versions",
        "hostname",
        "uptime",
        "interfaces",
        "diskUsages",
        "memoryUsage",
        "swapUsage",
        "emmcHealth"
    ],
    "properties": {
        "board": {
            "type": "string",
            "title": "Board",
            "example": "MICRORISC s.r.o. IQD-GW-01"
        },
        "gwId": {
            "type": [
                "string",
                "null"
            ],
            "title": "IQRF Gateway ID",
            "example": "02424D1D2D2E7580"
        },
        "gwImage": {
            "type": [
                "string",
                "null"
            ],
            "title": "IQRF Gateway image version",
            "example": "iqaros-armbian-v1.2.0"
        },
        "os": {
            "type": "object",
            "title": "Operating system information",
            "example": {
                "name": "Armbian 21.11.0-trunk Buster",
                "homePage": "https://www.debian.org/"
            },
            "additionalProperties": false,
            "required": [
                "name",
                "homePage"
            ],
            "properties": {
                "name": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "title": "Operating system name",
                    "example": "Armbian 21.11.0-trunk Buster"
                },
                "homePage": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "title": "Operating system home page",
                    "example": "https://www.debian.org/"
                }
            }
        },
        "versions": {
            "type": "object",
            "title": "IQRF software versions",
            "example": {
                "controller": "v1.0.0",
                "daemon": "v2.3.0",
                "influxdbBridge": "v1.0.0",
                "menderClient": "4.0.0",
                "menderConnect": "2.2.0",
                "setter": "v1.0.0",
                "uploader": "v1.0.0",
                "webapp": "v2.0.0"
            },
            "additionalProperties": false,
            "required": [
                "controller",
                "daemon",
                "influxdbBridge",
                "setter",
                "uploader",
                "webapp"
            ],
            "properties": {
                "controller": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "title": "IQRF Gateway Controller version",
                    "example": "v1.0.0"
                },
                "daemon": {
                    "type": "string",
                    "title": "IQRF Gateway Daemon version",
                    "example": "v2.3.0"
                },
                "influxdbBridge": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "title": "IQRF Gateway InfluxDB Bridge version",
                    "example": "v1.0.0"
                },
                "menderClient": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "title": "Mender client version",
                    "example": "4.0.0"
                },
                "menderConnect": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "title": "Mender connect version",
                    "example": "2.2.0"
                },
                "setter": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "title": "IQRF Gateway Setter version",
                    "example": "v1.0.0"
                },
                "uploader": {
                    "type": [
                        "string",
                        "null"
                    ],
                    "title": "IQRF Gateway Uploader version",
                    "example": "v1.0.0"
                },
                "webapp": {
                    "type": "string",
                    "title": "IQRF Gateway Webapp version",
                    "example": "v2.0.0"
                }
            }
        },
        "hostname": {
            "type": "string",
            "title": "Hostname",
            "example": "iqd-gw-01.local"
        },
        "uptime": {
            "title": "Gateway uptime",
            "type": "string",
            "example": "up 2 hours, 30 minutes"
        },
        "interfaces": {
            "type": "array",
            "title": "Network interfaces",
            "example": [
                {
                    "macAddress": "02:42:4d:2e:75:80",
                    "name": "eth0",
                    "ipAddresses": [
                        "192.168.1.130"
                    ]
                }
            ],
            "items": {
                "type": "object",
                "title": "Network interface",
                "example": {
                    "ipAddresses": [
                        "192.168.1.130"
                    ],
                    "macAddress": "02:42:4d:2e:75:80",
                    "name": "eth0"
                },
                "additionalProperties": false,
                "required": [
                    "name",
                    "macAddress",
                    "ipAddresses"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "title": "Interface name",
                        "example": "eth0"
                    },
                    "macAddress": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "title": "MAC address",
                        "example": "02:42:4d:2e:75:80"
                    },
                    "ipAddresses": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "title": "IP addresses",
                        "example": [
                            "192.168.1.130"
                        ],
                        "items": {
                            "type": "string",
                            "title": "IP address",
                            "oneOf": [
                                {
                                    "format": "ipv4"
                                },
                                {
                                    "format": "ipv6"
                                }
                            ],
                            "example": "192.168.1.130"
                        }
                    }
                }
            }
        },
        "diskUsages": {
            "type": "array",
            "title": "Disk usages",
            "examples": [
                [
                    {
                        "size": "7 GB",
                        "available": "4.88 GB",
                        "fsName": "/dev/mmcblk0p1",
                        "mount": "/",
                        "used": "2.01 GB",
                        "fsType": "ext4",
                        "usage": "28.78%"
                    },
                    {
                        "fsName": "/dev/zram0",
                        "mount": "/var/log",
                        "used": "3.46 MB",
                        "fsType": "ext4",
                        "usage": "7.15%",
                        "size": "48.42 MB",
                        "available": "41.46 MB"
                    }
                ]
            ],
            "items": {
                "type": "object",
                "title": "Disk usage",
                "example": {
                    "used": "2.01 GB",
                    "fsType": "ext4",
                    "usage": "28.78%",
                    "size": "7 GB",
                    "available": "4.88 GB",
                    "fsName": "/dev/mmcblk0p1",
                    "mount": "/"
                },
                "additionalProperties": false,
                "required": [
                    "fsName",
                    "fsType",
                    "size",
                    "used",
                    "available",
                    "usage",
                    "mount"
                ],
                "properties": {
                    "fsName": {
                        "type": "string",
                        "title": "Name",
                        "example": "/dev/mmcblk0p1"
                    },
                    "fsType": {
                        "type": "string",
                        "title": "Filesystem",
                        "example": "ext4"
                    },
                    "size": {
                        "type": "string",
                        "title": "Total size",
                        "example": "7 GB"
                    },
                    "used": {
                        "type": "string",
                        "title": "Used",
                        "example": "2.01 GB"
                    },
                    "available": {
                        "type": "string",
                        "title": "Available",
                        "example": "4.88 GB"
                    },
                    "usage": {
                        "type": "string",
                        "title": "Usage",
                        "example": "28.78%"
                    },
                    "mount": {
                        "type": "string",
                        "title": "Mount",
                        "example": "/"
                    }
                }
            }
        },
        "memoryUsage": {
            "type": "object",
            "title": "Memory usage",
            "example": {
                "cache": "259.53 MB",
                "buffers": "14.23 MB",
                "used": "164.84 MB",
                "usage": "33.42%",
                "free": "54.62 MB",
                "size": "493.21 MB",
                "available": "222.13 MB",
                "shared": "96.43 MB"
            },
            "additionalProperties": false,
            "required": [
                "size",
                "used",
                "free",
                "shared",
                "buffers",
                "cache",
                "available",
                "usage"
            ],
            "properties": {
                "size": {
                    "type": "string",
                    "title": "Total size",
                    "example": "493.21 MB"
                },
                "used": {
                    "type": "string",
                    "title": "Used",
                    "example": "164.84 MB"
                },
                "free": {
                    "type": "string",
                    "title": "Free",
                    "example": "54.62 MB"
                },
                "shared": {
                    "type": "string",
                    "title": "Shared",
                    "example": "96.43 MB"
                },
                "buffers": {
                    "type": "string",
                    "title": "Buffers",
                    "example": "14.23 MB"
                },
                "cache": {
                    "type": "string",
                    "title": "Cache",
                    "example": "259.53 MB"
                },
                "available": {
                    "type": "string",
                    "title": "Available",
                    "example": "222.13 MB"
                },
                "usage": {
                    "type": "string",
                    "title": "Usage",
                    "example": "33.42%"
                }
            }
        },
        "swapUsage": {
            "type": [
                "object",
                "null"
            ],
            "title": "Swap usage",
            "example": {
                "usage": "32.54%",
                "free": "166.35 MB",
                "size": "246.6 MB",
                "used": "80.25 MB"
            },
            "additionalProperties": false,
            "required": [
                "size",
                "used",
                "free",
                "usage"
            ],
            "properties": {
                "size": {
                    "type": "string",
                    "title": "Total Size",
                    "example": "246.6 MB"
                },
                "used": {
                    "type": "string",
                    "title": "Used",
                    "example": "80.25 MB"
                },
                "free": {
                    "type": "string",
                    "title": "Free",
                    "example": "166.35 MB"
                },
                "usage": {
                    "type": "string",
                    "title": "Usage",
                    "example": "32.54%"
                }
            }
        },
        "emmcHealth": {
            "type": [
                "object",
                "null"
            ],
            "title": "eMMC health",
            "example": {
                "slcRegion": 90,
                "mlcRegion": 90,
                "status": "normal"
            },
            "additionalProperties": false,
            "required": [
                "slcRegion",
                "mlcRegion",
                "status"
            ],
            "properties": {
                "slcRegion": {
                    "type": "integer",
                    "title": "eMMC SLC area life time estimation",
                    "minimum": 0,
                    "maximum": 100,
                    "example": 90
                },
                "mlcRegion": {
                    "type": "integer",
                    "title": "eMMC MLC area life time estimation",
                    "minimum": 0,
                    "maximum": 100,
                    "example": 90
                },
                "status": {
                    "enum": [
                        "undefined",
                        "normal",
                        "warning",
                        "urgent"
                    ],
                    "type": "string",
                    "title": "eMMC pre EOL status information",
                    "example": "normal"
                }
            }
        }
    }
}
