~drizzle-trunk/drizzle/jenkins-Drizzle-Builder-48

« back to all changes in this revision

Viewing changes to plugin/json_server/docs/index.rst

added:
  plugin/json_server/http_server.cc
  plugin/json_server/http_server.h
modified:
  plugin/json_server/docs/index.rst
  plugin/json_server/json_server.cc
  plugin/json_server/plugin.ini
  plugin/json_server/tests/r/basic.result
  plugin/json_server/tests/t/basic.test
pending merge tips: (use -v to see all merge revisions)
  srivastavamohit91... 2012-07-17 changes in _api01

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
   :Default: 8086
41
41
   :Variable: :ref:`json_server_port <json_server_port>`
 
42
   :Since: 0.1
42
43
 
43
44
   Port number to use for connection or 0 for default (port 8086)
44
45
 
46
47
 
47
48
   :Default: test
48
49
   :Variable: :ref:`json_server_schema <json_server_schema>`
 
50
   :Since: 0.3
49
51
 
50
52
   Schema which is used when not explicitly specified in request URI.
51
53
   Note: Currently this is in the /json API only.
54
56
 
55
57
   :Default:
56
58
   :Variable: :ref:`json_server_table <json_server_table>`
 
59
   :Since: 0.3
57
60
 
58
61
   Table which is used when not explicitly specified in request URI.
59
62
   Note: Currently this is in the /json API only.
62
65
 
63
66
   :Default: OFF
64
67
   :Variable: :ref:`json_server_allow_drop_table <json_server_allow_drop_table>`
 
68
   :Since: 0.3
65
69
 
66
70
   When json-server.allow_drop_table is set to ON, it is possible to drop
67
71
   a table with a HTTP DELETE request with no _id specified. When set to OFF
68
72
   (the default), omitting _id will result in an error.
69
73
 
 
74
.. option:: --json-server.max_threads ARG
 
75
 
 
76
   :Default: 32
 
77
   :Variable: :ref:`json_server_max_threads <json_server_max_threads>`
 
78
   :Since: 0.3
 
79
 
 
80
   Number of worker threads used by json server to handle http requests. Note
 
81
   that despite the name, current implementation is to immediately spawn as many
 
82
   threads as defined here.
 
83
 
70
84
.. _json_server_variables:
71
85
 
72
86
Variables
81
95
 
82
96
   :Scope: Global
83
97
   :Dynamic: No
 
98
    :Since: 0.1
84
99
 
85
100
   Port number to use for connection or 0 for default (port 8086) 
86
101
 
90
105
 
91
106
    :Scope: Global
92
107
    :Dynamic: yes
 
108
    :Since: 0.3
93
109
 
94
110
   Schema which is used when not explicitly specified in request URI.
95
111
   Note: Currently this is in the /json API only.
100
116
 
101
117
    :Scope: Global
102
118
    :Dynamic: yes
 
119
    :Since: 0.3
103
120
 
104
121
   Table which is used when not explicitly specified in request URI.
105
122
   Note: Currently this is in the /json API only.
110
127
 
111
128
    :Scope: Global
112
129
    :Dynamic: yes
 
130
    :Since: 0.3
113
131
 
114
132
   When json-server.allow_drop_table is set to ON, it is possible to drop
115
133
   a table with a HTTP DELETE request with no _id specified. When set to OFF
116
134
   (the default), omitting _id will result in an error.
117
135
 
 
136
.. _json_server_max_threads:
 
137
 
 
138
* ``json_server_max_threads``
 
139
 
 
140
    :Scope: Global
 
141
    :Dynamic: yes
 
142
    :Since: 0.3
 
143
 
 
144
   Number of threads used by json server to handle request. Note that despite 
 
145
   the name, current implementation is to immediately spawn as many threads as 
 
146
   defined here. Currently this variable can be increased dynamically, but an
 
147
   attempt to set a value that is lower than the current value will be silently
 
148
   ignored. (You have to restart drizzled to set a lower value as a startup
 
149
   option.)
 
150
 
 
151
 
118
152
.. _json_server_apis:
119
153
 
120
154
APIs
133
167
 
134
168
.. code-block:: none
135
169
 
136
 
    /0.1/sql
137
 
    /0.2/sql
 
170
    /0.3/sql
 
171
    /latest/sql
138
172
    /sql
139
173
 
140
 
Because the SQL API did not change between 0.1 and 0.2, all of the above URIs
141
 
are exactly the same.
 
174
The ``/sql`` URI used to handle SQL-over-HTTP requests (examples below).
 
175
 
 
176
Note that /0.1/sql and /0.2/sql have been removed since crashing bugs were
 
177
found in them. Therefore, only the latest versions of this functionality
 
178
are available.
142
179
 
143
180
.. code-block:: none
144
181
 
145
 
    /0.2/json
 
182
    /0.3/json
 
183
    /latest/json
146
184
    /json
147
185
 
148
 
The pure JSON API did not exist in the 0.1 release, as you can see from above.
 
186
The ``/json`` URI used to handle pure json requests (examples below).
 
187
 
 
188
Note that /0.2/json has been removed since crashing bugs was
 
189
found in the first version. Therefore, only the latest versions of this 
 
190
functionality are available.
149
191
 
150
192
.. code-block:: none
151
193
 
 
194
    /0.1/version
 
195
    /0.2/version
 
196
    /0.3/version
 
197
    /lastest/version
152
198
    /version
153
 
    /
 
199
 
154
200
 
155
201
The ``/version`` URI will return the version of Drizzle (in a JSON document, of 
156
202
course):
163
209
      "version" : "7.1.31.2451-snapshot"
164
210
    }
165
211
 
 
212
The key ``json_server_version`` was introduced in plugin version 0.3.
 
213
 
 
214
.. code-block:: none
 
215
 
 
216
    /
 
217
 
166
218
The root URI / returns a simple HTML GUI that can be used to test both the SQL 
167
219
and pure JSON APIs. Just point your browser to http://localhost:8086/ and try 
168
220
it!
307
359
  POST /json?schema=test&table=people HTTP/1.1
308
360
 
309
361
  {
310
 
    query:
 
362
    "query":
311
363
    {
312
364
      "_id" : 2, 
313
365
      "document" : { "firstname" : "Henrik", "lastname" : "Ingo", "age" : 35}
519
571
* Changed structure of the query document to be 
520
572
  ``{ "query" : <old query document> }`` This is to allow for future 
521
573
  extensibility.
522
 
* New options json_server.schema, json_server.table and 
523
 
  json_server.allow_drop_table
 
 
b'\\ No newline at end of file'
 
574
* Support for multi-threading.
 
575
* New options json_server.schema, json_server.table ,json_server.allow_drop_table and json_server.max_threads .