<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Moinz.de Webservices – FS</title><link>http://help.moinz.de/docs/fs/</link><description>Recent content in FS on Moinz.de Webservices</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><atom:link href="http://help.moinz.de/docs/fs/index.xml" rel="self" type="application/rss+xml"/><item><title>Docs: Introduction</title><link>http://help.moinz.de/docs/fs/intro/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>http://help.moinz.de/docs/fs/intro/</guid><description>
&lt;p>FS is a simple file storage with simple rest api.&lt;/p>
&lt;h2 id="access">Access&lt;/h2>
&lt;p>Endpoint: &lt;code>https://apps.moinz.de/fs/fs.php&lt;/code>. See the &lt;a href="http://help.moinz.de/docs/fs/api/">API&lt;/a> page for details.&lt;/p>
&lt;h2 id="authorization">Authorization&lt;/h2>
&lt;p>Access to paths can be finely tuned by an admin (TBD: provide an iam api). Policies can control access to various resources based on username, action and paths.&lt;/p>
&lt;p>The &lt;a href="https://github.com/zeisss/fs-php/blob/master/Docs/Configuration.md#policies">authorization guide&lt;/a> documents the Policy concept.&lt;/p>
&lt;h2 id="clients">Clients&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://raw.githubusercontent.com/zeisss/fs-php/master/fs.bash">fs.bash&lt;/a> - Small bash wrapper around curl.&lt;/li>
&lt;/ul></description></item><item><title>Docs: Objects API</title><link>http://help.moinz.de/docs/fs/api/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>http://help.moinz.de/docs/fs/api/</guid><description>
&lt;p>The &lt;em>Objects API&lt;/em> is accessable under the following URL:&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-url" data-lang="url">http://apps.moinz.de/fs/fs.php
&lt;/code>&lt;/pre>&lt;p>Generally all API responses are JSON responses, if not stated otherwise. If the URL parameter &lt;code>pretty&lt;/code> is set, the responses will be pretty printed.&lt;/p>
&lt;p>NOTE: All examples below are slightly pretty-printed for easier readability.&lt;/p>
&lt;h2 id="authentication">Authentication&lt;/h2>
&lt;p>Authentication can happen over Basic Auth or using JWT as a bearer token and cookies.
A token can be obtained by contacting support.&lt;/p>
&lt;p>NOTE: For all examples below that an authentication header is passed.&lt;/p>
&lt;h2 id="operations">Operations&lt;/h2>
&lt;h3 id="listing-objects">Listing objects&lt;/h3>
&lt;p>Lists all objects in the bucket. Use query parameter &lt;code>prefix&lt;/code> to define a common prefix string. If given, it must
start with a &lt;code>/&lt;/code>.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>GET /fs/fs.php?prefix=/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;prefix&amp;#34;: &amp;#34;/&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;objects&amp;#34;: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {&amp;#34;key&amp;#34;: &amp;#34;/docs/api.md&amp;#34;, &amp;#34;acl&amp;#34;:&amp;#34;public-read&amp;#34;, &amp;#34;size&amp;#34;: 100, &amp;#34;mtime&amp;#34;: &amp;#34;2015-10-10T19:00:00Z&amp;#34;, &amp;#34;mime&amp;#34;: &amp;#34;plain/text&amp;#34;},
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {&amp;#34;key&amp;#34;: &amp;#34;/README.md&amp;#34;, &amp;#34;acl&amp;#34;: &amp;#34;public-read&amp;#34;, size&amp;#34;: 100, &amp;#34;mtime&amp;#34;: &amp;#34;2015-10-10T19:00:00Z&amp;#34;, &amp;#34;mime&amp;#34;: &amp;#34;plain/text&amp;#34;}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>By default, all objects are listed. If you just want to discover, you can pass &lt;code>delimiter=/&lt;/code>, which splits the keys and list the prefix in the field &lt;code>common-prefixes&lt;/code>.
In combination with the &lt;code>prefix&lt;/code> parameter this allows to list
files and folders easily.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>GET /fs/fs.php?prefix=/&amp;amp;delimiter=/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;prefix&amp;#34;: &amp;#34;/&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;delimiter&amp;#34;: &amp;#34;/&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;common-prefixes&amp;#34;: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;/docs/&amp;#34;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;objects&amp;#34;: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {&amp;#34;key&amp;#34;: &amp;#34;/README.md&amp;#34;, &amp;#34;acl&amp;#34;: &amp;#34;public-read&amp;#34;, size&amp;#34;: 100, &amp;#34;mtime&amp;#34;: &amp;#34;2015-10-10T19:00:00Z&amp;#34;, &amp;#34;mime&amp;#34;: &amp;#34;plain/text&amp;#34;}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>GET /fs/fs.php?prefix=/docs&amp;amp;delimiter=/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;prefix&amp;#34;: &amp;#34;/docs&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;delimiter&amp;#34;: &amp;#34;/&amp;#34;,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;#34;objects&amp;#34;: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {&amp;#34;key&amp;#34;: &amp;#34;/docs/api.md&amp;#34;, &amp;#34;acl&amp;#34;:&amp;#34;public-read&amp;#34;, &amp;#34;size&amp;#34;: 100, &amp;#34;mtime&amp;#34;: &amp;#34;2015-10-10T19:00:00Z&amp;#34;, &amp;#34;mime&amp;#34;: &amp;#34;plain/text&amp;#34;}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="get-object">Get Object&lt;/h3>
&lt;p>To read the contents of an objects, provide the key to the object behind the endpoint url. The content-type will be determined by the server.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>GET /fs/fs.php/docs/api.md
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>A &lt;code>404 Not Found&lt;/code> will be returned, if the given key does not exist. Otherwise a &lt;code>200 OK&lt;/code>. If the file has the &lt;code>public-read&lt;/code> acl, no authorization is required.&lt;/p>
&lt;p>A header &lt;code>x-acl&lt;/code> contains the ACL of the object.&lt;/p>
&lt;p>PS: &lt;code>HEAD&lt;/code> is also supported.&lt;/p>
&lt;h3 id="create-an-object">Create an Object&lt;/h3>
&lt;p>Simply use &lt;code>PUT&lt;/code> with the desired key and provide the content in the body.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>PUT /fs/fs.php/demo.md
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>This is the new content
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The server responds with a &lt;code>201 Created&lt;/code> if the upload was successful.&lt;/p>
&lt;p>You can specify a &lt;code>x-acl&lt;/code> header field, which can be either &lt;code>private&lt;/code> or &lt;code>public-read&lt;/code>. &lt;code>private&lt;/code> is the default.
When set to &lt;code>public-read&lt;/code>, &lt;em>reading&lt;/em> this file does not require authentication.&lt;/p>
&lt;h3 id="deleting-an-object">Deleting an Object&lt;/h3>
&lt;p>Use &lt;code>DELETE&lt;/code> to delete an undesired object.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>DELETE /fs/fs.php/demo.md
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The server responds with a &lt;code>204 No Content&lt;/code> if the delete was successful. If no such key exists, a &lt;code>404 Not Found&lt;/code> is returned.&lt;/p>
&lt;h3 id="updating-an-objects-acl">Updating an Objects ACL&lt;/h3>
&lt;p>You can change the ACL of an object after it was created by issuing a PUT to the &lt;code>?acl&lt;/code> resource.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>PUT /fs/fs.php/demo.md?acl
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>public-read
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The servers responds with a &lt;code>204 No Content&lt;/code>. A &lt;code>400 Bad Request&lt;/code> indicates a wrong ACL.&lt;/p>
&lt;h2 id="workarounds">Workarounds&lt;/h2>
&lt;p>All object keys can optionally end in &lt;code>.ignore&lt;/code> which will be dropped when
reading/writing. &lt;code>fs.bash&lt;/code> appends this automatically to all routes.&lt;/p></description></item><item><title>Docs: CLI</title><link>http://help.moinz.de/docs/fs/cli/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>http://help.moinz.de/docs/fs/cli/</guid><description>
&lt;p>A cli is available as &lt;code>fs-client-go&lt;/code>.&lt;/p>
&lt;p>It supports the following subcommands:&lt;/p>
&lt;ul>
&lt;li>&lt;code>ls PREFIX&lt;/code>&lt;/li>
&lt;li>&lt;code>delete KEY&lt;/code>&lt;/li>
&lt;li>&lt;code>set KEY CONTENT&lt;/code>&lt;/li>
&lt;li>&lt;code>set-acl KEY ACL&lt;/code>&lt;/li>
&lt;li>&lt;code>push KEY PATH&lt;/code>&lt;/li>
&lt;li>&lt;code>url KEY&lt;/code>&lt;/li>
&lt;/ul></description></item></channel></rss>