forked from MetPX/wmo_mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
message-schema.json
175 lines (175 loc) · 5.4 KB
/
message-schema.json
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "github.com/MetPX/wmo_mesh/message-schema.json",
"type": "object",
"title": "The WIS mesh data notification schema",
"description": "Formal description of the messages send as notification about data/file availability.",
"required": [
"pubTime",
"baseUrl",
"relPath",
"integrity"
],
"properties": {
"pubTime": {
"$id": "#/properties/pubTime",
"format": "regex",
"pattern": "[0-9]{8}T[0-9]{6}(\\.[0-9]+)?Z?",
"type": "string",
"title": "Publication time",
"description": "Time of ingestion into the mesh. ISO 8601.",
"examples": [
"20190213T123456.789Z"
]
},
"baseUrl": {
"$id": "#/properties/baseUrl",
"type": "string",
"title": "Base URL of the service",
"description": "URL pointing to the server that send this notification and where the data (file) is available. For historical reasons the URL is spelled 'Url'.",
"examples": [
"https://host.example.com/data"
]
},
"relPath": {
"$id": "#/properties/relPath",
"type": "string",
"title": "Relative path",
"description": "Relative path identifies location of the file (relative to the base URL) but also can be considered as very brief metadata as the path is expected to contain standardised components such as name of producing organization.",
"examples": [
"20190213/wis/int/wmo/example/test.txt"
],
"pattern": "^(.*)$"
},
"retPath": {
"$id": "#/properties/retPath",
"type": "string",
"title": "Retrieval path",
"description": "If the relPath cannot be used to construct a URL that unambiguously identifies the data instance, than this value can be used to override it. In other words, this can be a very ugly string that together with the baseUrl forms a URL that your web server understands, while the relPath is a nice and structured and standardised and human readable identifier.",
"examples": [
"hgmpf/pfrck?instanceID=61686f79"
],
"pattern": "^(.*)$"
},
"integrity": {
"$id": "#/properties/integrity",
"type": "object",
"title": "Checksum or a digital signature of the file.",
"required": [
"method",
"value"
],
"properties": {
"method": {
"$id": "#/properties/sum/properties/method",
"type": "string",
"title": "Checksumming (or signature) method",
"examples": [
"sha512", "md5", "remove", "link", "cod", "arbitrary", "md5name", "random"
]
},
"value": {
"$id": "#/properties/sum/properties/value",
"type": "string",
"title": "The Value Schema",
"description": "Base 64 encoded checksum or digital signature",
"examples": [
"sZRqySSS0jR8YjW00mERhA=="
]
}
}
},
"partitionStrategy": {
"$id": "#/properties/partitionStrategy",
"type": "object",
"title": "Partition strategy",
"description": "Optional way of anouncing patrialy available files.",
"required": [
"method",
"size",
"count",
"remainder",
"number"
],
"properties": {
"method": {
"$id": "#/properties/partitionStrategy/properties/method",
"type": "string",
"title": "The Method Schema",
"default": "",
"examples": [
"partitioned", "inplace"
],
"pattern": "^(.*)$"
},
"size": {
"$id": "#/properties/partitionStrategy/properties/blockSize",
"type": "integer",
"title": "The Blocksize Schema",
"default": 0,
"examples": [
65535
],
"pattern": "^(.*)$"
},
"count": {
"$id": "#/properties/partitionStrategy/properties/count",
"type": "integer",
"title": "The Blockcount Schema",
"default": 0,
"examples": [
65535
],
"pattern": "^(.*)$"
},
"remainder": {
"$id": "#/properties/partitionStrategy/properties/lastBlock",
"type": "integer",
"title": "The size of the Lastblock Schema",
"default": 0,
"examples": [
1, 21352352
]
},
"number": {
"$id": "#/properties/partitionStrategy/properties/blockNumber",
"type": "integer",
"title": "The Blocknumber Schema",
"default": 0,
"examples": [
0
]
}
}
},
"content": {
"$id": "#/properties/content",
"type": "object",
"title": "Content (body) of the file",
"description": "Optional way how to send the content of a file to optimize transfer of small files.",
"required": [
"encoding",
"value"
],
"properties": {
"encoding": {
"$id": "#/properties/content/properties/encoding",
"type": "string",
"title": "Message encoding",
"examples": [
"utf-8", "base64"
]
},
"value": {
"$id": "#/properties/content/properties/value",
"type": "string",
"title": "The file data",
"examples": [
"Hello world!"
]
}
}
}
}
}