{
    "$schema": "http://json-schema.org/draft-04/schema",
    "title": "SuPPReMM Schema Definition",
    "description": "The mapping for the metrics from a SuPReMM resource to the unified format.",
    "type": "object",
    "properties": {
        "fields": {
            "type": "object",
            "additionalProperties": {
                "$ref": "#/definitions/supremm_data"
            },
            "required": [
                "local_job_id",
                "resource_name",
                "resource_id",
                "organization_id",
                "account",
                "username",
                "cwd",
                "executable",
                "exit_status",
                "granted_pe",
                "queue",
                "requested_nodes",
                "hosts",
                "nodes",
                "shared",
                "cores",
                "cores_avail",
                "submit_time_ts",
                "eligible_time_ts",
                "start_time_ts",
                "end_time_ts",
                "wall_time",
                "requested_wall_time",
                "wait_time",
                "cpu_time",
                "cpu_idle",
                "cpu_system",
                "cpu_user",
                "error",
                "flops",
                "flops_cov",
                "cpiref",
                "catastrophe",
                "cpldref",
                "cpiref_cov",
                "mem_transferred",
                "mem_transferred_cov",
                "cpu_user_imbalance",
                "cpu_user_cv",
                "memory_used",
                "memory_used_cov",
                "mem_used_including_os_caches",
                "mem_used_including_os_caches_cov",
                "ib_rx_bytes",
                "block_(sd[a-z])_wr_ios",
                "block_(sd[a-z])_wr_bytes",
                "block_(sd[a-z])_wr_bytes_cov",
                "block_(sd[a-z])_rd_ios",
                "block_(sd[a-z])_rd_bytes",
                "block_(sd[a-z])_rd_bytes_cov",
                "netdir_(projects|work|scratch|home)_read",
                "netdir_(projects|work|scratch|home)_write",
                "netdir_(projects|work|scratch|home)_write_cov",
                "netdrv_([a-z]+)_rx",
                "netdrv_([a-z]+)_rx_cov",
                "netdrv_([a-z]+)_rx_msgs",
                "netdrv_([a-z]+)_tx",
                "netdrv_([a-z]+)_tx_cov",
                "netdrv_([a-z]+)_tx_msgs",
                "net_([a-z]+[0-9]+)_rx",
                "net_([a-z]+[0-9]+)_rx_cov",
                "net_([a-z]+[0-9]+)_rx_packets",
                "net_([a-z]+[0-9]+)_tx",
                "net_([a-z]+[0-9]+)_tx_cov",
                "net_([a-z]+[0-9]+)_tx_packets",
                "gpu([0-9]+)_nv_mem_used",
                "gpu([0-9]+)_nv_utilization"
            ]
        },
        "version": {
            "type": "number"
        }
    },
    "definitions": {
        "supremm_data": {
            "type": "object",
            "properties": {
                "unit": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "type": {
                    "enum": [
                        "uint32",
                        "string",
                        "int32",
                        "array",
                        "double"
                    ]
                },
                "nullable": {
                    "type": "boolean"
                },
                "def": {
                    "type": [
                        "string",
                        "number",
                        "array",
                        "null"
                    ]
                },
                "comments": {
                    "type": "string"
                },
                "per": {
                    "enum": [
                        "job",
                        "core",
                        "node",
                        "gpu"
                    ]
                },
                "raw_per": {
                    "enum": [
                        "job",
                        "core",
                        "node",
                        "gpu"
                    ]
                },
                "algorithm": {
                    "type": "string"
                },
                "algorithm_description": {
                    "type": "string"
                },
                "typical_usage": {
                    "type": "string"
                }
            },
            "required": [
                "unit",
                "type",
                "nullable",
                "def",
                "comments",
                "per"
            ],
            "additionalProperties": false
        }
    },
    "required": [
        "version",
        "fields"
    ]
}