File: json.html

package info (click to toggle)
condor 8.6.8~dfsg.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 79,476 kB
  • sloc: cpp: 649,368; perl: 108,260; python: 22,654; ansic: 20,588; sh: 19,729; fortran: 3,340; yacc: 1,844; makefile: 1,213; xml: 1,003; sql: 767; java: 703; ruby: 512; awk: 505; lex: 248; f90: 64; csh: 24
file content (165 lines) | stat: -rw-r--r-- 3,852 bytes parent folder | download
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
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>HTCondor View JSON Formats</title>
<link rel="stylesheet" href="htcondor.css" />
<style>
body {
  max-width: 50em;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0.5em;
  padding-right: 0.5em;
}
dt {
  font-weight: bold;
  font-family: monospace;
  font-size: 150%;
  margin-bottom: 0.5em;
}
dd { margin-bottom: 1.5em; }
em.variable {
  text-decoration:  underline;
  font-family: monospace;
}
table.example {
  margin-left: auto;
  margin-right: auto;
  border-collapse: collapse;  
}
table.example td, table.example th {
  padding: 0.3em;
}
table.example th {
  background-color: #4444CC;
  color: white;
}
table.example tr:nth-child(odd) {
  background-color: #CCCCFF;
}
table.example tr:nth-child(even) {
}
pre {
  margin: 0 3em;
  padding: 0.5em;
  background-color: #CCCCFF;
}
</style>
</head>
<body>


<h1 class="htclogo"><img src="HTCondor-View.svg" alt="HTCondor View"></h1>
<h1>JSON Formats </h1>

<p>Data for HTCondor View is provided in JSON or JSONP format.

<p>The data is a series of records, each with one or more named fields.

<p>The data must be a single array, either of objects or nested array.  An
array of objects has one property for each value, with the name of the
property being the field name.  A nested array begins with an array of field
names, then has one array for each record, with the values matching the
field names with the same index.

<p>Given the data set

<table class="example">
<tr><th>Color</th><th>Shape</th><th>Count</th></tr>
<tr><td>red</td><td>sphere</td><td>14</tr>
<tr><td>blue</td><td>cube</td><td>6</tr>
</table>

<p>It could be represented as

<pre>
[
{
  "Color": "red",
  "Shape": "sphere",
  "Count": 14,
},
{
  "Color": "blue",
  "Shape": "cube",
  "Count": 6,
}
]
</pre>

<p>or

<pre>
[
  [ "Color", "Shape", "Count"],
  [ "red",   "sphere", 14],
  [ "blue",  "cube",   6]
]
</pre>

<p>In JSON format, the framing "[" "]" are optional. In JSON format, an
extra comma at the end is also allowed, but in that case the framing "["
"]" <em>must</em> be omitted.  This may be useful for files where
additional records are regularly appended, eliminating the need to keep
moving the "]" and allowing every record to end with a comma.  For example,
the first example could be written as:

<pre>
{
  "Color": "red",
  "Shape": "sphere",
  "Count": 14,
},
{
  "Color": "blue",
  "Shape": "cube",
  "Count": 6,
},
</pre>

<p>The JSONP is the same as the JSON format with a wrapper function.
The function must be "jsonp".  The first 6 characters
must be exactly "jsonp(" and the last two ");".  The contents must be
strictly valid JSON; the framing "[" "]" must be present and there must
not be a comma after the last record.

<p> This is the first JSON example modified to be JSONP:

<pre>
jsonp([
{
  "Color": "red",
  "Shape": "sphere",
  "Count": 14,
},
{
  "Color": "blue",
  "Shape": "cube",
  "Count": 6,
}
]);
</pre>

<p>Values can be strings, numbers, dates, time/date pairs, or boolean values.  The system attempts
to deduce the correct type for a given field by examining values.  Numbers
can be placed in quotes; they will be interpreted as numbers if all values
for that field can be.  Dates can be in a variety of
formats, including:

<table class="example">
<tr><th>Format</th><th>Example</th></tr>
<tr><td>"YYYY-MM-DDThh:mm:ss.mmm"</td><td>"2015-12-31T23:59:59.999"</td>
<tr><td>"YYYY-MM-DDThh:mm:ss"</td><td>"2015-12-31T23:59:59"</td>
<tr><td>"YYYY-MM-DDThh:mm"</td><td>"2015-12-31T23:59"</td>
<tr><td>"YYYY-MM-DD hh:mm"</td><td>"2015-12-31 23:59"</td>
<tr><td>"YYYY-MM-DD"</td><td>"2015-12-31"</td>
<tr><td>"Date(YYYY,MM,DD)"</td><td>"Date(2015,12,31)"</td></tr>
<tr><td>"Date(YYYY,MM,DD,hh,mm,ss)"</td><td>"Date(2015,12,31,23,59,59)"</td></tr>
</table>

<p>Years must always be four digits.

</body>
</html>