-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcold_api_test.1.html
More file actions
70 lines (70 loc) · 2.58 KB
/
cold_api_test.1.html
File metadata and controls
70 lines (70 loc) · 2.58 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
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>cold</title>
<link rel="stylesheet" href="https://caltechlibrary.github.io/css/site.css">
<link rel="stylesheet" href="https://media.library.caltech.edu/cl-webcomponents/css/code-blocks.css">
<script type="module" src="https://media.library.caltech.edu/cl-webcomponents/copyToClipboard.js"></script>
<script type="module" src="https://media.library.caltech.edu/cl-webcomponents/footer-global.js"></script>
</head>
<body>
<header>
<a href="https://library.caltech.edu"><img src="https://media.library.caltech.edu/assets/caltechlibrary-logo.png" alt="Caltech Library logo"></a>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="index.html">README</a></li>
<li><a href="LICENSE">LICENSE</a></li>
<li><a href="INSTALL.html">INSTALL</a></li>
<li><a href="user_manual.html">User Manual</a></li>
<li><a href="about.html">About</a></li>
<li><a href="search.html">Search</a></li>
<li><a href="https://github.com/caltechlibrary/cold">GitHub</a></li>
</ul>
</nav>
<section>
<h1 id="name">NAME</h1>
<p>cold_api_test</p>
<h1 id="synopsis">SYNOPSIS</h1>
<p>cold_api_test C_NAME METHOD API_PATH [JSON_PAYLOAD]</p>
<h1 id="description">DESCRIPTION</h1>
<p>cold_api_test tests the COLD API as defined by the cold_api.yaml
file.</p>
<p>For paths that include a query you need to map the query parameters
form the JSON object into the path. The JSON_PAYLOAD can be provided as
either a final parameter or read from standard input.</p>
<p>NOTE: Both GET and HEAD requests ignore JSON_PAYLOAD.</p>
<h1 id="options">OPTIONS</h1>
<dl>
<dt>-h, –help</dt>
<dd>
display help
</dd>
<dt>-l, –license</dt>
<dd>
display license
</dd>
<dt>-v, –version</dt>
<dd>
display version
</dd>
</dl>
<h1 id="example">EXAMPLE</h1>
<p>Retrieve the locally hosted ROR data for <a
href="https://ror.org/05dxps055"
class="uri">https://ror.org/05dxps055</a>.</p>
<pre><code>cold_api_test ror.ds get object/05dxps055</code></pre>
<p>Run the lookup_by_acronym query.</p>
<pre><code>cold_api_test ror.ds post query/lookup_by_acronym/q '{"q":"NSF"}'</code></pre>
<p>In this example there are two parameters in the SQL query. We need to
name them in the JSON payload but also map them as an ordered array in
the path. The two parameters in this example map to “name” and
“acronym”. Even though we are search for one value the parameters are
each provided.</p>
<p>~~~ cold_api_test ror.ds post query/lookup_by_name_or_acronym/n/a
‘{“n”:“NSF”,“a”:“NSF”}’</p>
</section>
<footer-global></footer-global>
</body>
</html>