-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheputil.1.html
More file actions
191 lines (188 loc) · 6.87 KB
/
eputil.1.html
File metadata and controls
191 lines (188 loc) · 6.87 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
<!DOCTYPE html>
<html>
<head>
<title>eprinttools - eputil.1.html</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/css/site.css">
<script type="module" src="https://caltechlibrary.github.io/CL-web-components/src/footer-global.js"></script>
</head>
<body>
<header>
<a href="http://library.caltech.edu" title="link to Caltech Library Homepage"><img src="/assets/liblogo.gif" alt="Caltech Library logo"></a>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="README.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="search.html">Search Docs</a></li>
<li><a href="about.html">About</a></li>
<li><a href="https://github.com/caltechlibrary/eprinttools">GitHub</a></li>
</ul>
</nav>
<section>
<h1 id="name">NAME</h1>
<p>eputil</p>
<h1 id="synopsis">SYNOPSIS</h1>
<p>eputil <a href="#options">OPTIONS</a> EPRINT_REST_URL</p>
<h1 id="description">DESCRIPTION</h1>
<p>eputil is a command line program for exploring the EPrints Extended
API (provided by ep3apid) or EPrint’s own REST API. Records are returned
in either JSON or EPrints XML. Lists of eprint ids are returned in
JSON.</p>
<h2 id="detail-for-eprints-extended-api">DETAIL FOR EPrints Extended
API</h2>
<p>The extended API is expected to be present on the local machine at
http://localhost:8484. eputil will convert the command line parameters
into the appropriate URL encoding the command line as necessary and
return the values from the Extended API end points.</p>
<p>The format of the command working with the EPrints extended API is
<code>eputil REPO_ID END_POINT_NAME [PARAMETER ...]</code> You must
specify the repository id in the command. E.g.</p>
<pre><code> eputil caltechauthors keys
eputil caltechauthors doi
eputil caltechauthors doi "10.5062/F4NP22DV"
eputil caltechauthors creator-name "Morrell" "Thomas"
eputil caltechauthors grant-number
eputil caltechauthors grant-number "kzcx3-sw-147"
eputil caltechauthors eprint 18339
eputil -json caltechauthors eprint 18339</code></pre>
<p>See website for a full list of available end points.</p>
<pre><code> https://caltechlibrary.github.io/eprinttools/docs/ep3apid.html</code></pre>
<h2 id="detail-for-eprints-rest-api">DETAIL FOR EPrints REST API</h2>
<p>eputil parses XML content retrieved from EPrints 3.x. REST API. It
will render results in JSON or XML. With the <code>-raw</code> option
you can get the unmodified EPrintXML from the REST API otherwise the XML
is parsed before final rendering as JSON or XML. It requires a basic
knowledge of the layout of EPrint 3.x’s REST API. It supports both
unauthenticated and basic authentication access to the API. The REST API
authentication mechanism appears indepent of the primary website
authentication setup of the installed EPrints (at least at Caltech
Library). See the examples to start exploring the API.</p>
<h1 id="options">OPTIONS</h1>
<dl>
<dt>-help</dt>
<dd>
display help
</dd>
<dt>-license</dt>
<dd>
display license
</dd>
<dt>-version</dt>
<dd>
display version
</dd>
<dt>-auth string</dt>
<dd>
set the authentication type for access, default is basic (default
“basic”)
</dd>
<dt>-document</dt>
<dd>
Retrieve a document from the provided url
</dd>
<dt>-i, -input</dt>
<dd>
(string) input file name (read the URL connection string from the input
file
</dd>
<dt>-json</dt>
<dd>
attempt to parse XML into generaic JSON structure
</dd>
<dt>-nl, -newline</dt>
<dd>
if true add a trailing newline
</dd>
<dt>-o, -output</dt>
<dd>
(string) output file name
</dd>
<dt>-password</dt>
<dd>
Prompt for the password for authenticated access
</dd>
<dt>-quiet</dt>
<dd>
suppress error messages
</dd>
<dt>-raw</dt>
<dd>
get the raw EPrint REST API response
</dd>
<dt>-s, -simple</dt>
<dd>
Return the object in a simplified JSON data structure.
</dd>
<dt>-u, -un, -user, -username</dt>
<dd>
(string) set the username for authenticated access
</dd>
<dt>-verbose</dt>
<dd>
verbose output
</dd>
</dl>
<h1 id="examples">EXAMPLES</h1>
<p>Fetch the raw unmarshaled EPrint XML via the EPrint REST API for id
123.</p>
<pre><code> eputil -raw https://example.org/rest/eprint/123.xml</code></pre>
<p>Fetch the EPrint XML marshaled as XML using the EPrints REST API for
id 123.</p>
<pre><code> eputil https://example.org/rest/eprint/123.xml</code></pre>
<p>Fetch the EPrint XML marshaled as JSON using the EPrints REST API for
id 123.</p>
<pre><code> eputil -json https://example.org/rest/eprint/123.xml</code></pre>
<p>Get a JSON array of eprint ids from the REST API</p>
<pre><code> eputil -json https://example.org/rest/eprint/</code></pre>
<p>Get the last modified date for id 123 from REST API</p>
<pre><code> eputil -raw https://example.org/rest/eprint/123/lastmod.txt</code></pre>
<p>If the EPrint REST API is protected by basic authentication you can
pass the username and password via command line options. You will be
prompted for the password value. or via the URL. In this example the
username is “user” and password is “secret”. In this example you will be
prompted to enter your secret.</p>
<pre><code> eputil -username=user -password \
https://example.org/rest/eprint/123.xml</code></pre>
<p>You can also pass the username and secret via the URL but this leaves
you vunerable to the password being recorded in your command history or
if another person has access to the process table. You SHOULD NOT use
this approach on a shared machine!</p>
<pre><code> eputil https://user:secret@example.org/rest/eprint/123.xml</code></pre>
<p>Getting IDs doesn’t typically require authentication but seeing
specific records may depending on the roles and security setup
implemented in the EPrint instance.</p>
<p>Supported Environment Variables</p>
<pre><code> EPRINT_USER sets the default username used by eputil
EPRINT_PASSWORD sets the default password used by eputil
EPRINT_BASE_URL sets the default base URL to access the
EPrints REST API</code></pre>
<p>eputil 1.2.4</p>
</section>
<footer-global></footer-global>
<!-- START: PrettyFi from https://github.com/google/code-prettify -->
<script>
/* We want to add the class "prettyprint" to all the pre elements */
var pre_list = document.querySelectorAll("pre");
pre_list.forEach(function(elem) {
elem.classList.add("prettyprint");
elem.classList.add("linenums");/**/
elem.classList.add("json"); /**/
});
</script>
<style>
li.L0, li.L1, li.L2, li.L3, li.L4, li.L5, li.L6, li.L7, li.L8, li.L9
{
color: #555;
list-style-type: decimal;
}
</style>
<link rel="stylesheet" type="text/css" href="/css/prettify.css">
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_
prettify.js"></script>
<!-- END: PrettyFi from https://github.com/google/code-prettify -->
</body>
</html>