summaryrefslogtreecommitdiff
path: root/site/docs/documentation/Input/TopologySchema.md
blob: d01995684d9aa09f8e30bdcbc764a8e5622c0096 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
Below is the schema for the Topology JSON file. This schema can be used to validate a topology file. 
A topology file can be validated using a JSON schema validator, such as https://www.jsonschemavalidator.net/.

```json
{
    "$schema": "OpenDC/Topology",
    "$defs": {
        "cpuModel": {
            "description": "definition of a cpuModel",
            "type": "object",
            "properties": {
                "vendor": {
                    "type": "string",
                    "default": "unknown"
                },
                "modelName": {
                    "type": "string",
                    "default": "unknown"
                },
                "arch": {
                    "type": "string",
                    "default": "unknown"
                },
                "coreCount": {
                    "type": "integer"
                },
                "coreSpeed": {
                    "description": "The core speed of the cpuModel in Mhz",
                    "type": "number"
                },
                "count": {
                    "description": "The amount CPUs of this type present in the cluster",
                    "type": "integer"
                }
            },
            "required": [
                "coreCount",
                "coreSpeed"
            ]
        },
        "memory": {
            "type": "object",
            "properties": {
                "vendor": {
                    "type": "string",
                    "default": "unknown"
                },
                "modelName": {
                    "type": "string",
                    "default": "unknown"
                },
                "arch": {
                    "type": "string",
                    "default": "unknown"
                },
                "memorySize": {
                    "description": "The amount of the memory in B",
                    "type": "integer"
                },
                "memorySpeed": {
                    "description": "The speed of the memory in Mhz. Note: currently, this does nothing",
                    "type": "number",
                    "default": -1
                }
            },
            "required": [
                "memorySize"
            ]
        },
        "powerModel": {
            "type": "object",
            "properties": {
                "modelType": {
                    "description": "The type of model used to determine power draw",
                    "type": "string"
                },
                "power": {
                    "description": "The constant power draw when using the 'constant' power model type in Watt",
                    "type": "number",
                    "default": 400
                },
                "maxPower": {
                    "description": "The power draw of a host when idle in Watt",
                    "type": "number"
                },
                "idlePower": {
                    "description": "The power draw of a host when using max capacity in Watt",
                    "type": "number"
                }
            },
            "required": [
                "modelType",
                "maxPower",
                "idlePower"
            ]
        },
        "host": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "default": "Host"
                },
                "count": {
                    "description": "The amount hosts of this type present in the cluster",
                    "type": "integer",
                    "default": 1
                },
                "cpuModel": {
                    "$ref": "#/$defs/cpuModel"
                },
                "memory": {
                    "$ref": "#/$defs/memory"
                }
            },
            "required": [
                "cpuModel",
                "memory"
            ]
        },
        "cluster": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "default": "Cluster"
                },
                "count": {
                    "description": "The amount clusters of this type present in the Data center",
                    "type": "integer",
                    "default": 1
                },
                "hosts": {
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/host"
                    },
                    "minItems": 1
                }
            },
            "required": [
                "hosts"
            ]
        }
    },
    "properties": {
        "clusters": {
            "description": "Clusters present in the data center",
            "type": "array",
            "items": {
                "$ref": "#/$defs/cluster"
            },
            "minItems": 1
        }
    },
    "required": [
        "clusters"
    ]
}
```