Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OSUG
RESIF
ws-ph5-availability
Commits
b7b345c3
Commit
b7b345c3
authored
Apr 23, 2021
by
Jerome Touvier
Browse files
documentation howto
parent
b79c4b3d
Changes
9
Hide whitespace changes
Inline
Side-by-side
apps/globals.py
View file @
b7b345c3
...
...
@@ -24,8 +24,8 @@ ORDERBY = (
)
# error message constants
DOCUMENTATION_URI
=
"http://ws.resif.fr/
resifws/ph5
ws/availability/1/"
SERVICE
=
"
resifws-
ph5-availability"
DOCUMENTATION_URI
=
"http://
ph5
ws.resif.fr/
fdsn
ws/availability/1/"
SERVICE
=
"ph5
ws
-availability"
VERSION
=
"1.0.0"
...
...
apps/utils.py
View file @
b7b345c3
...
...
@@ -41,7 +41,7 @@ def is_valid_float(dimension, mini=sys.float_info.epsilon, maxi=sys.float_info.m
def
is_valid_datetime
(
date
):
for
df
in
(
"%Y-%m-%d"
,
"%Y-%m-%dT%H:%M:%S"
,
"%Y-%m-%dT%H:%M:%S.%f"
):
try
:
return
datetime
.
strptime
(
date
,
df
)
return
datetime
.
strptime
(
date
.
replace
(
"Z"
,
""
)
,
df
)
except
(
ValueError
,
TypeError
):
pass
...
...
docs/README.md
0 → 100755
View file @
b7b345c3
### The HTML documentation located in "templates/" directory is generated as follows:
1) Modify your markdown files: USAGE_
*
.md
2) Run md2html.sh script:
bash md2html.sh "markdown file name" "html file name" "html page title"
### Examples:
bash md2html.sh USAGE_FR.md doc.html "RESIF: RESIFWS: PH5-availability Docs: v1"
bash md2html.sh USAGE_EN.md doc_en.html "RESIF: RESIFWS: PH5-availability Docs: v1"
### Requirements:
pandoc
docs/USAGE_EN.md
View file @
b7b345c3
...
...
@@ -60,16 +60,16 @@ query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01
## Sample Queries
### with /extent
<a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01
</a>
<a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01
</a>
<a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount
</a>
<a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount
</a>
### with /query
<a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01
</a>
<a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01
</a>
<a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000
</a>
<a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000
</a>
## Detailed descriptions of each query parameter
...
...
docs/USAGE_FR.md
View file @
b7b345c3
...
...
@@ -60,16 +60,16 @@ Au moins une station ou un réseau doit être précisé.
## Exemples de requêtes
### avec /extent
<a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01
</a>
<a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01
</a>
<a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount
</a>
<a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount
</a>
### avec /query
<a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01
</a>
<a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01
</a>
<a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000
</a>
<a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000
</a>
## Descriptions détaillées de chaque paramètre de la requête
...
...
docs/md2html.sh
0 → 100755
View file @
b7b345c3
README
=
$1
FILE
=
$2
TITLE
=
$3
pandoc
-f
markdown
-t
html
-s
"
$README
"
-o
"
$FILE
"
--metadata
title
=
"
$TITLE
"
perl
-i
-0pe
's/__\*__/<strong>\*<\/strong>/s'
$FILE
perl
-i
-0pe
's/loc=\–/loc=--/s'
$FILE
perl
-i
-0pe
's/<header.*<\/header>/<p style="text-align:center;"> <img src=".\/static\/images\/logoresif.png" alt="logoresif" width="341" height="95"><\/p>/s'
$FILE
if
[[
$FILE
==
*
doc.html
]]
;
then
perl
-i
-0pe
's/<\/head>/<link rel="stylesheet" href=".\/static\/resifws.css"\/>
<a href=".\/local=en"> <img src=".\/static\/images\/en.png" alt="Français - Anglais"> <\/a>\n<\/head>/gms'
$FILE
elif
[[
$FILE
==
*
doc_en.html
]]
;
then
perl
-i
-0pe
's/<\/head>/<link rel="stylesheet" href=".\/static\/resifws.css"\/>
<a href=".\/local=fr"> <img src=".\/static\/images\/fr.png" alt="Anglais - Français"> <\/a>\n<\/head>/gms'
$FILE
fi
# perl -i -0pe
# -i in-place
# -0 read entire file in one shot (without the multiline searches failed).
# -p run Perl code
# -e Perl will not look for a script filename in the argument list.
templates/doc.html
View file @
b7b345c3
...
...
@@ -61,11 +61,11 @@ format-options :: [format=<TEXT|geocsv|json|request|zip>]
les valeurs par défaut sont en majuscules
</code></pre>
<h2
id=
"exemples-de-requêtes"
>
Exemples de requêtes
</h2>
<h3
id=
"avec-extent"
>
avec /extent
</h3>
<p><a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
</a></p>
<p><a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
&
show=latestupdate
&
orderby=timespancount
</a></p>
<p><a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
</a></p>
<p><a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
&
show=latestupdate
&
orderby=timespancount
</a></p>
<h3
id=
"avec-query"
>
avec /query
</h3>
<p><a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
</a></p>
<p><a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
&
merge=samplerate
&
mergegaps=36000
</a></p>
<p><a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
</a></p>
<p><a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
&
merge=samplerate
&
mergegaps=36000
</a></p>
<h2
id=
"descriptions-détaillées-de-chaque-paramètre-de-la-requête"
>
Descriptions détaillées de chaque paramètre de la requête
</h2>
<h3
id=
"format-autorisé-pour-la-station"
>
Format autorisé pour la station
</h3>
<p>
Les quatre paramètres (network, station, location, channel) déterminent les canaux d’intérêt.
</p>
...
...
templates/doc_en.html
View file @
b7b345c3
...
...
@@ -60,11 +60,11 @@ format-options :: [format=<TEXT|geocsv|json|request|zip>]</code></p
<pre><code>
default values are uppercase
</code></pre>
<h2
id=
"sample-queries"
>
Sample Queries
</h2>
<h3
id=
"with-extent"
>
with /extent
</h3>
<p><a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
</a></p>
<p><a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/extent?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
&
show=latestupdate
&
orderby=timespancount
</a></p>
<p><a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
</a></p>
<p><a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&show=latestupdate&orderby=timespancount"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/extent?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
&
show=latestupdate
&
orderby=timespancount
</a></p>
<h3
id=
"with-query"
>
with /query
</h3>
<p><a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
</a></p>
<p><a
href=
"http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000"
>
http://ws.resif.fr/
resifws/ph5-
availability/1/query?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
&
merge=samplerate
&
mergegaps=36000
</a></p>
<p><a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
</a></p>
<p><a
href=
"http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C&sta=N02,N08&start=2019-01-01&end=2020-01-01&merge=samplerate&mergegaps=36000"
>
http://
ph5
ws.resif.fr/
fdsnws/
availability/1/query?net=3C
&
sta=N02,N08
&
start=2019-01-01
&
end=2020-01-01
&
merge=samplerate
&
mergegaps=36000
</a></p>
<h2
id=
"detailed-descriptions-of-each-query-parameter"
>
Detailed descriptions of each query parameter
</h2>
<h3
id=
"station-code-details"
>
Station code details
</h3>
<p>
The four parameters (network, station, location, channel) determine channels of interest.
</p>
...
...
templates/wadl.xml
View file @
b7b345c3
<?xml version="1.0" encoding="UTF-8"?>
<application>
<doc
title=
"RESIF ph5-availability web service 1.0"
/>
<resources
base=
"http://ws.resif.fr/
resifws/ph5
ws/availability/1"
>
<resources
base=
"http://
ph5
ws.resif.fr/
fdsn
ws/availability/1"
>
<resource
path=
"/"
>
<method
name=
"GET"
>
<response>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment