-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapi.html
More file actions
482 lines (437 loc) · 32.2 KB
/
Copy pathapi.html
File metadata and controls
482 lines (437 loc) · 32.2 KB
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>API Reference — nextcode-python-sdk 0.2.10 documentation</title>
<link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Query Service" href="api_query.html" />
<link rel="prev" title="Jupyter Notebooks Integration" href="jupyter.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="_static/js/jquery-1.11.0.min.js "></script>
<script type="text/javascript" src="_static/js/jquery-fix.js "></script>
<script type="text/javascript" src="_static/bootstrap-3.3.7/js/bootstrap.min.js "></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js "></script>
</head><body>
<div id="navbar" class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
nextcode-python-sdk</a>
<span class="navbar-text navbar-version pull-left"><b>0.2.11</b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li class="dropdown globaltoc-container">
<a role="button"
id="dLabelGlobalToc"
data-toggle="dropdown"
data-target="#"
href="index.html">Contents <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc"
role="menu"
aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="jupyter.html">Jupyter Notebooks Integration</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">API Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="notebook.html">Example Jupyter Notebook</a></li>
<li class="toctree-l1"><a class="reference internal" href="apidoc.html">Server API Documention</a></li>
</ul>
</ul>
</li>
<li class="dropdown">
<a role="button"
id="dLabelLocalToc"
data-toggle="dropdown"
data-target="#"
href="#">Page <b class="caret"></b></a>
<ul class="dropdown-menu localtoc"
role="menu"
aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">API Reference</a><ul>
<li><a class="reference internal" href="#client">client</a></li>
<li><a class="reference internal" href="#session">session</a></li>
<li><a class="reference internal" href="#config">config</a></li>
<li><a class="reference internal" href="#utils">utils</a></li>
<li><a class="reference internal" href="#available-services">Available Services</a></li>
</ul>
</li>
</ul>
</ul>
</li>
<li>
<a href="jupyter.html" title="Previous Chapter: Jupyter Notebooks Integration"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">« Jupyter Noteb...</span>
</a>
</li>
<li>
<a href="api_query.html" title="Next Chapter: Query Service"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Query Service »</span>
</a>
</li>
</ul>
<form class="navbar-form navbar-right" action="search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="body col-md-12 content" role="main">
<div class="section" id="api-reference">
<h1>API Reference<a class="headerlink" href="#api-reference" title="Permalink to this headline">¶</a></h1>
<p>These pages feature low-level documentation of the functionality of the SDK.</p>
<p>When using the SDK you always start by getting a <cite>Client</cite> instance using an API Key. With this object you can connect to various services.</p>
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">nextcode</span>
<span class="n">client</span> <span class="o">=</span> <span class="n">nextcode</span><span class="o">.</span><span class="n">Client</span><span class="p">(</span><span class="n">api_key</span><span class="o">=</span><span class="s2">"xxx"</span><span class="p">)</span>
<span class="n">svc</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">service</span><span class="p">(</span><span class="s2">"query"</span><span class="p">)</span>
<span class="n">svc</span><span class="o">.</span><span class="n">status</span><span class="p">()</span>
</pre></div>
</td></tr></table></div>
<span class="target" id="module-nextcode.client"></span><div class="section" id="client">
<h2>client<a class="headerlink" href="#client" title="Permalink to this headline">¶</a></h2>
<p>This is the basic entrypoint to interact with services.</p>
<dl class="class">
<dt id="nextcode.client.Client">
<em class="property">class </em><code class="sig-prename descclassname">nextcode.client.</code><code class="sig-name descname">Client</code><span class="sig-paren">(</span><em class="sig-param">api_key=None</em>, <em class="sig-param">profile=None</em>, <em class="sig-param">root_url=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/client.html#Client"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.client.Client" title="Permalink to this definition">¶</a></dt>
<dd><p>A base client object from which to access various services</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>api_key</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – api key to use for this client</p></li>
<li><p><strong>profile</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – name of a saved profile to use with this client</p></li>
<li><p><strong>root_url</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – override the URL of the server root. e.g. <a class="reference external" href="https://server.wuxinextcode.com">https://server.wuxinextcode.com</a></p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>InvalidProfile</p>
</dd>
</dl>
<p>Order of precedence:
1) passed in ‘profile’
2) passed in ‘api_key’
3) NEXTCODE_PROFILE from environment
3) GOR_API_KEY from environment</p>
<dl class="method">
<dt id="nextcode.client.Client.available_profiles">
<em class="property">classmethod </em><code class="sig-name descname">available_profiles</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/client.html#Client.available_profiles"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.client.Client.available_profiles" title="Permalink to this definition">¶</a></dt>
<dd><p>List profiles that that are installed into the system and can be used
with the constructor client.Client()</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">List</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="nextcode.client.Client.available_services">
<em class="property">classmethod </em><code class="sig-name descname">available_services</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/client.html#Client.available_services"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.client.Client.available_services" title="Permalink to this definition">¶</a></dt>
<dd><p>List services that can be intantiated via an client object client.service(<cite>service</cite>)</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">List</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="nextcode.client.Client.get_access_token">
<code class="sig-name descname">get_access_token</code><span class="sig-paren">(</span><em class="sig-param">decode=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/client.html#Client.get_access_token"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.client.Client.get_access_token" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the JWT access token that is generated from the current api key.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>decode</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>) – Decode the token and return a dictionary instead of the raw string</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>InvalidToken</p>
</dd>
</dl>
<p>Example usage:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">client</span> <span class="o">=</span> <span class="n">nextcode</span><span class="o">.</span><span class="n">Client</span><span class="p">(</span><span class="n">api_key</span><span class="o">=</span><span class="s2">"xxx.yyy.zzz"</span><span class="p">)</span>
<span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">get_access_token</span><span class="p">())</span>
<span class="go">"iii.jjj.kkk"</span>
</pre></div>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">client</span> <span class="o">=</span> <span class="n">nextcode</span><span class="o">.</span><span class="n">Client</span><span class="p">(</span><span class="n">api_key</span><span class="o">=</span><span class="s2">"xxx.yyy.zzz"</span><span class="p">)</span>
<span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="n">client</span><span class="o">.</span><span class="n">get_access_token</span><span class="p">(</span><span class="n">decode</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">{"jti": "...", ...}</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">Dict</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="nextcode.client.Client.service">
<code class="sig-name descname">service</code><span class="sig-paren">(</span><em class="sig-param">service_name</em>, <em class="sig-param">**kw</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/client.html#Client.service"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.client.Client.service" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve an instance to a service.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>service_name</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – The name of the service</p>
</dd>
</dl>
<p>Available services can be listed by calling class method <cite>available_services</cite>.</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="nextcode.client.get_service">
<code class="sig-prename descclassname">nextcode.client.</code><code class="sig-name descname">get_service</code><span class="sig-paren">(</span><em class="sig-param">service_name</em>, <em class="sig-param">api_key=None</em>, <em class="sig-param">profile=None</em>, <em class="sig-param">**kw</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/client.html#get_service"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.client.get_service" title="Permalink to this definition">¶</a></dt>
<dd><p>Helper method which returns a service handle and creates a client object automatically</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>api_key</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – api key to use for this client</p></li>
<li><p><strong>profile</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – name of a saved profile to use with this client</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>InvalidProfile, ServiceNotFound</p>
</dd>
</dl>
</dd></dl>
</div>
<span class="target" id="module-nextcode.session"></span><div class="section" id="session">
<h2>session<a class="headerlink" href="#session" title="Permalink to this headline">¶</a></h2>
<p>Service Session, low-level object for communicating with RESTFul services.</p>
<dl class="class">
<dt id="nextcode.session.ServiceSession">
<em class="property">class </em><code class="sig-prename descclassname">nextcode.session.</code><code class="sig-name descname">ServiceSession</code><span class="sig-paren">(</span><em class="sig-param">api_name</em>, <em class="sig-param">url_base</em>, <em class="sig-param">api_key</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/session.html#ServiceSession"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.session.ServiceSession" title="Permalink to this definition">¶</a></dt>
<dd><p>A wrapped requests session object with base_url and exported endpoints
from nextcode service api’s</p>
<dl class="method">
<dt id="nextcode.session.ServiceSession.delete">
<code class="sig-name descname">delete</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kw</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/session.html#ServiceSession.delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.session.ServiceSession.delete" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a DELETE request. Returns <code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code> object.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>requests.Response</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="nextcode.session.ServiceSession.get">
<code class="sig-name descname">get</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kw</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/session.html#ServiceSession.get"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.session.ServiceSession.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a GET request. Returns <code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code> object.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>requests.Response</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="nextcode.session.ServiceSession.post">
<code class="sig-name descname">post</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kw</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/session.html#ServiceSession.post"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.session.ServiceSession.post" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a POST request. Returns <code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code> object.</p></li>
<li><p><strong>data</strong> – (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code>.</p></li>
<li><p><strong>json</strong> – (optional) json to send in the body of the <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code>.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>requests.Response</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="nextcode.session.ServiceSession.put">
<code class="sig-name descname">put</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kw</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/session.html#ServiceSession.put"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.session.ServiceSession.put" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a PUT request. Returns <code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – URL for the new <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code> object.</p></li>
<li><p><strong>data</strong> – (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code>.</p></li>
<li><p><strong>**kwargs</strong> – Optional arguments that <code class="docutils literal notranslate"><span class="pre">request</span></code> takes.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>requests.Response</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="nextcode.session.ServiceSession.request">
<code class="sig-name descname">request</code><span class="sig-paren">(</span><em class="sig-param">method</em>, <em class="sig-param">url</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/session.html#ServiceSession.request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.session.ServiceSession.request" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructs a <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code>, prepares it and sends it.
Returns <code class="xref py py-class docutils literal notranslate"><span class="pre">Response</span></code> object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>method</strong> – method for the new <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code> object.</p></li>
<li><p><strong>url</strong> – URL for the new <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code> object.</p></li>
<li><p><strong>params</strong> – (optional) Dictionary or bytes to be sent in the query
string for the <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code>.</p></li>
<li><p><strong>data</strong> – (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the <code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code>.</p></li>
<li><p><strong>json</strong> – (optional) json to send in the body of the
<code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code>.</p></li>
<li><p><strong>headers</strong> – (optional) Dictionary of HTTP Headers to send with the
<code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code>.</p></li>
<li><p><strong>cookies</strong> – (optional) Dict or CookieJar object to send with the
<code class="xref py py-class docutils literal notranslate"><span class="pre">Request</span></code>.</p></li>
<li><p><strong>files</strong> – (optional) Dictionary of <code class="docutils literal notranslate"><span class="pre">'filename':</span> <span class="pre">file-like-objects</span></code>
for multipart encoding upload.</p></li>
<li><p><strong>auth</strong> – (optional) Auth tuple or callable to enable
Basic/Digest/Custom HTTP Auth.</p></li>
<li><p><strong>timeout</strong> (<em>float</em><em> or </em><em>tuple</em>) – (optional) How long to wait for the server to send
data before giving up, as a float, or a <span class="xref std std-ref">(connect timeout,
read timeout)</span> tuple.</p></li>
<li><p><strong>allow_redirects</strong> (<em>bool</em>) – (optional) Set to True by default.</p></li>
<li><p><strong>proxies</strong> – (optional) Dictionary mapping protocol or protocol and
hostname to the URL of the proxy.</p></li>
<li><p><strong>stream</strong> – (optional) whether to immediately download the response
content. Defaults to <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p></li>
<li><p><strong>verify</strong> – (optional) Either a boolean, in which case it controls whether we verify
the server’s TLS certificate, or a string, in which case it must be a path
to a CA bundle to use. Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p></li>
<li><p><strong>cert</strong> – (optional) if String, path to ssl client cert file (.pem).
If Tuple, (‘cert’, ‘key’) pair.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>requests.Response</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
<span class="target" id="module-nextcode.config"></span><div class="section" id="config">
<h2>config<a class="headerlink" href="#config" title="Permalink to this headline">¶</a></h2>
<p>Configuration, caching and profile management for nextcode sdk.</p>
<dl class="class">
<dt id="nextcode.config.Config">
<em class="property">class </em><code class="sig-prename descclassname">nextcode.config.</code><code class="sig-name descname">Config</code><span class="sig-paren">(</span><em class="sig-param">data=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/config.html#Config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.config.Config" title="Permalink to this definition">¶</a></dt>
<dd><p>Borg pattern Config class see:
<a class="reference external" href="http://code.activestate.com/recipes/66531-singleton-we-dont-need-no-stinkin-singleton-the-bo/">http://code.activestate.com/recipes/66531-singleton-we-dont-need-no-stinkin-singleton-the-bo/</a></p>
<p>Example usage:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">config</span> <span class="o">=</span> <span class="n">Config</span><span class="p">({</span><span class="s1">'my'</span><span class="p">:</span> <span class="s1">'config'</span><span class="p">})</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="nextcode.config.create_profile">
<code class="sig-prename descclassname">nextcode.config.</code><code class="sig-name descname">create_profile</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">api_key</em>, <em class="sig-param">root_url=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/config.html#create_profile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.config.create_profile" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new profile from api key and persist to disk</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – Unique name of the profile for referencing later</p></li>
<li><p><strong>api_key</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – API Key from keycloak for the server</p></li>
<li><p><strong>root_url</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – root url of the server. If not set, the url from the api key is used</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>InvalidProfile</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">None</span></code></p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="nextcode.config.set_default_profile">
<code class="sig-prename descclassname">nextcode.config.</code><code class="sig-name descname">set_default_profile</code><span class="sig-paren">(</span><em class="sig-param">name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/config.html#set_default_profile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.config.set_default_profile" title="Permalink to this definition">¶</a></dt>
<dd><p>Set a named profile as the default one if no profile is specified or GOR_API_KEY is not set</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – Name of the profile</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>InvalidProfile</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">None</span></code></p>
</dd>
</dl>
</dd></dl>
</div>
<span class="target" id="module-nextcode.utils"></span><div class="section" id="utils">
<h2>utils<a class="headerlink" href="#utils" title="Permalink to this headline">¶</a></h2>
<p>Various utilities for nextcode-sdk functionality.</p>
<dl class="function">
<dt id="nextcode.utils.get_access_token">
<code class="sig-prename descclassname">nextcode.utils.</code><code class="sig-name descname">get_access_token</code><span class="sig-paren">(</span><em class="sig-param">api_key</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/nextcode/utils.html#get_access_token"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nextcode.utils.get_access_token" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</div>
<div class="section" id="available-services">
<h2>Available Services<a class="headerlink" href="#available-services" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="api_query.html">Query Service</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api_query.html#query-api-service">Query-API Service</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_query.html#query-api-query">Query-API Query</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_query.html#id1">Query-API Service</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api_workflow.html">Workflow Service</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api_workflow.html#id1">Workflow Service</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api_exceptions.html">Exceptions</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
<br/>
<div id="sourcelink">
<a href="_sources/api.rst.txt"
rel="nofollow">Source</a>
</div>
</p>
<p>
© Copyright 2019, Wuxi Nextcode.<br/>
Last updated on 2019-11-07.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.1.<br/>
</p>
</div>
</footer>
</body>
</html>