<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Documentation – Online Storage</title><link>/users/data/storage/</link><description>Recent content in Online Storage on Documentation</description><generator>Hugo -- gohugo.io</generator><atom:link href="/users/data/storage/index.xml" rel="self" type="application/rss+xml"/><item><title>Users: Object Storage</title><link>/users/data/storage/object-storage/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/users/data/storage/object-storage/</guid><description>
&lt;!--
// jscpd:ignore-start
-->
&lt;h2 id="what-is-it">What is it?&lt;/h2>
&lt;p>Object storage is a standalone service that &lt;strong>stores data as individual objects,
organized into containers&lt;/strong>. It is a highly scalable, reliable, fast, and
inexpensive data storage. It has a simple web services interface that can be
used to store and retrieve any amount of data, at any time, from anywhere on the
web.&lt;/p>
&lt;p>The main features of object storage:&lt;/p>
&lt;ul>
&lt;li>Storage containers and objects have unique URLs, which can be used to access,
manage, and share them.&lt;/li>
&lt;li>Data can be accessed from anywhere, using standard HTTP requests to a REST API
(e.g. VMs running in the EGI Cloud or in other cloud provider&amp;rsquo;s cloud, from
any browser/laptop, etc.)&lt;/li>
&lt;li>Access can be public or can be restricted using access control lists.&lt;/li>
&lt;li>There is virtually no limit to the amount of data you can store, only the
space used is accounted for.&lt;/li>
&lt;/ul>
&lt;h2 id="concepts">Concepts&lt;/h2>
&lt;p>To use object storage effectively, you need to understand the following key
concepts and terminology:&lt;/p>
&lt;h3 id="storage-containers">Storage containers&lt;/h3>
&lt;p>Storage containers (aka buckets) are the fundamental holders of data. Every
object is stored in a storage container. You can store any number of objects in
a storage container.&lt;/p>
&lt;p>Storage containers have an unique name and act as the root folders of the
storage space.&lt;/p>
&lt;p>Each storage container has a unique URL (that includes the name) by which anyone
can refer to it.&lt;/p>
&lt;h3 id="objects">Objects&lt;/h3>
&lt;p>Objects are the fundamental entities stored in object storage. Objects consist
of object data and metadata. The data portion is opaque to object storage. The
metadata is a set of name-value pairs that describe the object. These include
some default metadata, such as the date last modified, and standard HTTP
metadata, such as &lt;code>Content-Type&lt;/code>. You can also specify custom metadata at the
time the object is stored.&lt;/p>
&lt;p>An object is uniquely identified within a storage container by a key (name) and
a version.&lt;/p>
&lt;p>Each object has a unique URL, based on the storage container&amp;rsquo;s URL (that
includes the key, and optionally the version) by which anyone can refer to it.&lt;/p>
&lt;h3 id="permissions">Permissions&lt;/h3>
&lt;p>Storage containers and objects can be shared by sharing their URLs. However,
access to a storage container or to an object is controlled by access control
lists (ACLs). When a request is received against a resource, object storage
checks the corresponding ACL to verify that the requester has the necessary
access permissions.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
It is possible to set permissions so
that the storage container or object can be accessed publicly.
&lt;/div>
&lt;h2 id="usage-from-your-application">Usage from your application&lt;/h2>
&lt;p>The object storage in the EGI Cloud is offered via
&lt;a href="https://openstack.org/">OpenStack&lt;/a> deployments that implement the
&lt;a href="https://docs.openstack.org/swift/latest/">Swift&lt;/a> service.&lt;/p>
&lt;p>Users can manage object storage using the
&lt;a href="https://docs.openstack.org/horizon/latest/user/">OpenStack Horizon dashboard&lt;/a>
of a provider or from the &lt;a href="#access-from-the-command-line">command-line&lt;/a> (CLI).
More advanced usage include access via the
&lt;a href="#access-via-the-s3-protocol">S3 protocol&lt;/a>, via the
&lt;a href="https://docs.openstack.org/api-ref/object-store/">OpenStack Object Store API&lt;/a>,
or using the &lt;a href="#access-via-egi-data-transfer">EGI Data Transfer service&lt;/a>.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
Available object storage resources can
be discovered in the
&lt;a href="https://goc.egi.eu/portal/index.php?Page_Type=Services&amp;amp;serviceType=org.openstack.swift&amp;amp;selectItemserviceType=org.openstack.swift&amp;amp;ngi=&amp;amp;searchTerm=&amp;amp;production=TRUE&amp;amp;monitored=TRUE&amp;amp;certStatus=Certified&amp;amp;scopeMatch=all&amp;amp;servKeyNames=&amp;amp;servKeyValue=">Configuration Database&lt;/a>
(GOCDB).
&lt;/div>
&lt;h2 id="access-from-the-command-line">Access from the command-line&lt;/h2>
&lt;p>Multiple command-line interfaces (CLIs) are available to manage object storage:&lt;/p>
&lt;ul>
&lt;li>The &lt;a href="https://docs.openstack.org/python-openstackclient/latest">OpenStack CLI&lt;/a>&lt;/li>
&lt;li>The &lt;a href="../../../getting-started/cli">FedCloud Client&lt;/a> is a high-level CLI for
interaction with the EGI Federated Cloud (&lt;strong>recommended&lt;/strong>)&lt;/li>
&lt;li>The &lt;a href="https://docs.openstack.org/mitaka/cli-reference/swift.html">Swift CLI&lt;/a>
has some advanced features that are not available through the OpenStack CLI&lt;/li>
&lt;/ul>
&lt;h3 id="access-with-the-fedcloud-cli">Access with the FedCloud CLI&lt;/h3>
&lt;p>The main FedCloud commands for managing storage containers and storage objects
are described below.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
See
&lt;a href="https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/container.html">here&lt;/a>
for documentation on all storage container-related commands, and
&lt;a href="https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/object.html">here&lt;/a>
for all object-related commands.
&lt;/div>
&lt;h4 id="list-storage-containers">List storage containers&lt;/h4>
&lt;p>For example, to access to the SWIFT endpoint at IFCA-LCG2 via the Pilot VO
(vo.access.egi.eu), and
&lt;a href="https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/container.html#container-list">list the available storage containers&lt;/a>,
use the FedCloud command below:&lt;/p>
&lt;ul class="nav nav-tabs" id="tabs-3" role="tablist">
&lt;li class="nav-item">
&lt;a class="nav-link active"
id="tabs-3-0-tab" data-toggle="tab" href="#tabs-3-0" role="tab"
aria-controls="tabs-3-0" aria-selected="true">
Linux / Mac
&lt;/a>
&lt;/li>
&lt;li class="nav-item">
&lt;a class="nav-link"
id="tabs-3-1-tab" data-toggle="tab" href="#tabs-3-1" role="tab"
aria-controls="tabs-3-1" aria-selected="false">
Windows
&lt;/a>
&lt;/li>
&lt;li class="nav-item">
&lt;a class="nav-link"
id="tabs-3-2-tab" data-toggle="tab" href="#tabs-3-2" role="tab"
aria-controls="tabs-3-2" aria-selected="false">
PowerShell
&lt;/a>
&lt;/li>
&lt;/ul>
&lt;div class="tabx-content" id="tabs-3-content">
&lt;div class="tab-pane show active"
id="tabs-3-0" role="tabpanel" aria-labelled-by="tabs-3-0-tab">
&lt;p>To avoid passing the site, VO, etc. each time, you can use
&lt;a href="../../../getting-started/cli#environment-variables">FedCloud CLI environment variables&lt;/a>
to set them once and reuse them with each command invocation.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ &lt;span style="color:#204a87">export&lt;/span> &lt;span style="color:#000">EGI_SITE&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>IFCA-LCG2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ &lt;span style="color:#204a87">export&lt;/span> &lt;span style="color:#000">EGI_VO&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>vo.access.egi.eu
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ fedcloud openstack container list --site &lt;span style="color:#000">$EGI_SITE&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+------------------+
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> Name &lt;span style="color:#000;font-weight:bold">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+------------------+
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> test-egi &lt;span style="color:#000;font-weight:bold">|&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>
&lt;div class="tab-pane "
id="tabs-3-1" role="tabpanel" aria-labelled-by="tabs-3-1-tab">
&lt;p>To avoid passing the site, VO, etc. each time, you can use
&lt;a href="../../../getting-started/cli#environment-variables">FedCloud CLI environment variables&lt;/a>
to set them once and reuse them with each command invocation.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>&amp;gt; &lt;span style="color:#204a87">set&lt;/span> &lt;span style="color:#000">EGI_SITE&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>IN2P3-IRES
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;gt; &lt;span style="color:#204a87">set&lt;/span> &lt;span style="color:#000">EGI_VO&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>vo.access.egi.eu
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;gt; fedcloud openstack container list --site %EGI_SITE%
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+------------------+
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> Name &lt;span style="color:#000;font-weight:bold">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+------------------+
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> test-egi &lt;span style="color:#000;font-weight:bold">|&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>
&lt;div class="tab-pane "
id="tabs-3-2" role="tabpanel" aria-labelled-by="tabs-3-2-tab">
&lt;p>To avoid passing the site, VO, etc. each time, you can use
&lt;a href="../../../getting-started/cli#environment-variables">FedCloud CLI environment variables&lt;/a>
to set them once and reuse them with each command invocation.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-powershell" data-lang="powershell">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">&amp;gt;&lt;/span> &lt;span style="color:#000">$Env:EGI_SITE&lt;/span>&lt;span style="color:#000;font-weight:bold">=&lt;/span>&lt;span style="color:#4e9a06">&amp;#34;IN2P3-IRES&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">&amp;gt;&lt;/span> &lt;span style="color:#000">$Env:EGI_VO&lt;/span>&lt;span style="color:#000;font-weight:bold">=&lt;/span>&lt;span style="color:#4e9a06">&amp;#34;vo.access.egi.eu&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">&amp;gt;&lt;/span> &lt;span style="color:#000">fedcloud&lt;/span> &lt;span style="color:#000">openstack&lt;/span> &lt;span style="color:#000">container&lt;/span> &lt;span style="color:#000">list&lt;/span> &lt;span style="color:#000;font-weight:bold">-&lt;/span>&lt;span style="color:#000">-site&lt;/span> &lt;span style="color:#000">$Env:EGI_SITE&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">+------------------+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> &lt;span style="color:#000">Name&lt;/span> &lt;span style="color:#000;font-weight:bold">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">+------------------+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> &lt;span style="color:#204a87">test-egi&lt;/span> &lt;span style="color:#000;font-weight:bold">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">+------------------+&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;/div>
&lt;/div>
&lt;h4 id="create-new-storage-container">Create new storage container&lt;/h4>
&lt;p>To
&lt;a href="https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/container.html#container-create">create a new storage container&lt;/a>
named &lt;code>test-egi&lt;/code>, use the following FedCloud command:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ fedcloud openstack container create test-egi
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+---------+-----------+------------------------------------------------------+
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> account &lt;span style="color:#000;font-weight:bold">|&lt;/span> container &lt;span style="color:#000;font-weight:bold">|&lt;/span> x-trans-id &lt;span style="color:#000;font-weight:bold">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+---------+-----------+------------------------------------------------------+
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> v1 &lt;span style="color:#000;font-weight:bold">|&lt;/span> test-egi &lt;span style="color:#000;font-weight:bold">|&lt;/span> tx000000000000000000afc-005f845160-2bb3ed4-RegionOne &lt;span style="color:#000;font-weight:bold">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+---------+-----------+------------------------------------------------------+
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="create-new-object-by-uploading-a-file">Create new object by uploading a file&lt;/h4>
&lt;p>To
&lt;a href="https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/object.html#object-create">upload a file as a new object&lt;/a>
into a storage container named &lt;code>test-egi&lt;/code>, use the following FedCloud command:&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Tip&lt;/h4>
The newly created object can have a
different name than the file being uploaded, use the &lt;code>--name&lt;/code> command flag for
this.
&lt;/div>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Tip&lt;/h4>
Multiple files can be uploaded at once,
but in that case the resulting objects will have the same names as the uploaded
files.
&lt;/div>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ fedcloud openstack object create test-egi file1.txt
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+-----------+-----------+----------------------------------+
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> object &lt;span style="color:#000;font-weight:bold">|&lt;/span> container &lt;span style="color:#000;font-weight:bold">|&lt;/span> etag &lt;span style="color:#000;font-weight:bold">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+-----------+-----------+----------------------------------+
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> file1.txt &lt;span style="color:#000;font-weight:bold">|&lt;/span> test-egi &lt;span style="color:#000;font-weight:bold">|&lt;/span> 5bbf5a52328e7439ae6e719dfe712200 &lt;span style="color:#000;font-weight:bold">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+-----------+-----------+----------------------------------+
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="list-objects-in-a-storage-container">List objects in a storage container&lt;/h4>
&lt;p>To
&lt;a href="https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/object.html#object-list">list the objects in a storage container&lt;/a>
use the FedCloud command below:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ fedcloud openstack object list test-egi
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+-----------+
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> Name &lt;span style="color:#000;font-weight:bold">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+-----------+
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">|&lt;/span> file1.txt &lt;span style="color:#000;font-weight:bold">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>+-----------+
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="download-the-content-of-an-object">Download (the content of) an object&lt;/h4>
&lt;p>To
&lt;a href="https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/object.html#object-save">download an object&lt;/a>
named &lt;code>file1.txt&lt;/code> located in storage container &lt;code>test-egi&lt;/code>, and save its content
to a file use the FedCloud command below:&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Tip&lt;/h4>
The object can be saved into a file named
differently than the object itself, by using the &lt;code>--filename&lt;/code> command flag.
&lt;/div>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Tip&lt;/h4>
Multiple files can be downloaded at once,
but in that case the resulting files will have the same names as the downloaded
objects.
&lt;/div>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ fedcloud openstack object save test-egi file1.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="add-metadata-to-an-object">Add metadata to an object&lt;/h4>
&lt;p>You can
&lt;a href="https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/object.html#object-set">add/update object metadata&lt;/a>,
stored as key-value pairs among the object properties. E.g. to add a property
named &lt;code>key1&lt;/code> with the value &lt;code>value2&lt;/code> to an object named &lt;code>file1.txt&lt;/code> located in
the storage container named &lt;code>test-egi&lt;/code>, you can use the FedCloud command below:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ fedcloud openstack object &lt;span style="color:#204a87">set&lt;/span> &lt;span style="color:#4e9a06">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&lt;/span> --property &lt;span style="color:#000">key1&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>value2 test-egi file1.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="remove-metadata-from-an-object">Remove metadata from an object&lt;/h4>
&lt;p>You can also
&lt;a href="https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/container.html#container-unset">remove metadata from objects&lt;/a>.
E.g. to remove the property named &lt;code>key1&lt;/code> from the object named &lt;code>file1.txt&lt;/code>
located in the storage container named &lt;code>test-egi&lt;/code>, you can use the FedCloud
command below:&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
Only metadata added by users can be
removed (system properties cannot be removed).
&lt;/div>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ fedcloud openstack object &lt;span style="color:#204a87">unset&lt;/span> &lt;span style="color:#4e9a06">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&lt;/span> --property key test-egi file1.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="remove-an-object-from-a-storage-container">Remove an object from a storage container&lt;/h4>
&lt;p>To
&lt;a href="https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/object.html#object-delete">delete an object&lt;/a>
named &lt;code>file1.txt&lt;/code> from the storage container &lt;code>test-egi&lt;/code>, use the following
FedCloud command:&lt;/p>
&lt;div class="alert alert-warning" role="alert">
&lt;h4 class="alert-heading">Caution&lt;/h4>
Deleting object from storage
containers is final, there is no way to recover deleted objects. Unlike in
&lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html">AWS S3&lt;/a>,
objects in OpenStack storage containers cannot be protected against deletion.
&lt;/div>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ fedcloud openstack object delete test-egi file1.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="removing-an-entire-container">Removing an entire container&lt;/h4>
&lt;p>To
&lt;a href="https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/container.html#container-delete">delete a storage container&lt;/a>,
including all objects in it, use the FedCloud command below.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Tip&lt;/h4>
You can add the &lt;code>-r&lt;/code> option to
recursively remove sub-containers.
&lt;/div>
&lt;div class="alert alert-warning" role="alert">
&lt;h4 class="alert-heading">Caution&lt;/h4>
Deleting all objects from a
storage container is final, there is no way to recover deleted objects. Unlike
in
&lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html">AWS S3&lt;/a>,
objects in OpenStack storage containers cannot be protected against deletion.
&lt;/div>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ fedcloud openstack container delete test-egi
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="access-via-rclone">Access via Rclone&lt;/h3>
&lt;p>&lt;a href="https://rclone.org/">Rclone&lt;/a> is a command-line program to manage files on cloud
storage. This section explains how to use &lt;code>rclone&lt;/code> to interact with
&lt;a href="https://docs.openstack.org/swift/latest/">OpenStack Swift&lt;/a> available in the EGI
Federated Cloud.&lt;/p>
&lt;p>As a prerequisite, we need to configure the following environment variables:
&lt;code>OS_AUTH_URL&lt;/code>, &lt;code>OS_AUTH_TOKEN&lt;/code>, &lt;code>OS_STORAGE_URL&lt;/code>. Use the
&lt;a href="../../../getting-started/cli">FedCloud Client&lt;/a> to get their values:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># explore sites with swift storage&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ fedcloud endpoint list --service-type org.openstack.swift --site ALL_SITES
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># get OS_AUTH_URL&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ fedcloud openstack --site &amp;lt;site&amp;gt; --vo &amp;lt;virtual-organisation&amp;gt; catalog show keystone
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># get OS_AUTH_TOKEN&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ fedcloud openstack --site &amp;lt;site&amp;gt; --vo &amp;lt;virtual-organisation&amp;gt; token issue &lt;span style="color:#4e9a06">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&lt;/span> -c id &lt;span style="color:#4e9a06">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&lt;/span> -f value
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># get OS_STORAGE_URL for your site and Virtual Organisation&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ fedcloud openstack --site &amp;lt;site&amp;gt; --vo &amp;lt;virtual-organisation&amp;gt; catalog show swift
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Now configure &lt;code>rclone&lt;/code> to work with the environment variables:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ rclone config create egiswift swift env_auth &lt;span style="color:#204a87">true&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Finally, check that you have access to swift:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ &lt;span style="color:#204a87">export&lt;/span> &lt;span style="color:#000">OS_AUTH_TOKEN&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>&amp;lt;token&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ &lt;span style="color:#204a87">export&lt;/span> &lt;span style="color:#000">OS_AUTH_URL&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>&amp;lt;keystone-url&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ &lt;span style="color:#204a87">export&lt;/span> &lt;span style="color:#000">OS_STORAGE_URL&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>&amp;lt;swift-url&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ rclone lsd egiswift:
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For more information, please see
&lt;a href="https://rclone.org/swift/">Rclone documentation for Swift&lt;/a>.&lt;/p>
&lt;h3 id="access-via-the-s3-protocol">Access via the S3 protocol&lt;/h3>
&lt;p>The OpenStack &lt;a href="https://docs.openstack.org/swift/latest/">Swift&lt;/a> service is
compatible with the S3 protocol, therefore when properly configured, it can be
accessed as any other S3-compatible object store.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
The S3 protocol was created by
&lt;a href="https://www.aws.com">Amazon Web Services&lt;/a> (AWS) for their object storage,
called
&lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html">Simple Storage Service&lt;/a>
(S3), but it was
&lt;a href="https://www.architecting.it/blog/object-storage-standardising-on-the-s3-api/">adopted as the de-facto standard&lt;/a>
to access object storage offered by other providers.
&lt;/div>
&lt;p>In order to access the storage via S3, an EGI Federated Cloud site admin needs
to create and associate to your EGI credentials both &lt;code>access&lt;/code> and &lt;code>secret&lt;/code> keys
which could then be used by clients to have access to the storage.&lt;/p>
&lt;h4 id="aws-cli">AWS CLI&lt;/h4>
&lt;p>The &lt;a href="https://aws.amazon.com/cli/">AWS CLI&lt;/a> can be used to manage object storages
having S3 interface.&lt;/p>
&lt;p>First of all the configuration of the access and secret keys need to be done:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ aws configure
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>then it offers many commands to list, create buckets, objects, e.g.:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ aws s3 ls --no-sign-request &lt;span style="color:#4e9a06">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&lt;/span> --endpoint-url https://object-store.cloud.muni.cz &lt;span style="color:#4e9a06">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&lt;/span> s3://test-egi-public
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
In order to access public buckets the
&lt;code>--no-sign-request&lt;/code> is needed
&lt;/div>
&lt;h4 id="minio-client">Minio Client&lt;/h4>
&lt;p>The &lt;a href="https://docs.min.io/docs/minio-client-quickstart-guide">MinIO CLI&lt;/a> supports
filesystems and Amazon S3 compatible cloud storage services.&lt;/p>
&lt;p>It offers a modern alternative to UNIX commands like ls, cat, e.g.:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"># key and secret are not mandatory in case of public buckets&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ ./mc &lt;span style="color:#204a87">alias&lt;/span> &lt;span style="color:#204a87">set&lt;/span> cesnet https://object-store.cloud.muni.cz
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ ./mc ls cesnet/test-egi-public
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ ./mc cat cesnet/test-egi-public/file1.txt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="davix">Davix&lt;/h4>
&lt;p>The &lt;a href="https://davix.web.cern.ch">Davix Client&lt;/a>, developed at CERN for RHEL and
Debian environments, is another alternative for working with S3-compatible
object storage.&lt;/p>
&lt;p>For example, to list containers/objects via the S3 protocol, use the command:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ davix-ls --s3accesskey &lt;span style="color:#4e9a06">&amp;#39;access&amp;#39;&lt;/span> --s3secretkey &lt;span style="color:#4e9a06">&amp;#39;secret&amp;#39;&lt;/span> &lt;span style="color:#4e9a06">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&lt;/span> --s3alternate s3s://s3.cl2.du.cesnet.cz/&amp;lt;bucket-name&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;code>davix-get&lt;/code>, &lt;code>davix-put&lt;/code> and &lt;code>davix-del&lt;/code> are also available to download, store
and delete objects from the storage.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
The Davix Client does not support access
to public buckets
&lt;/div>
&lt;h4 id="access-via-python">Access via Python&lt;/h4>
&lt;p>The possibility to access programmatically via S3 object storage is also quite
important, for instance in the case of interactive computing via EGI Notebooks.&lt;/p>
&lt;p>When using Python for instance, &lt;a href="https://s3fs.readthedocs.io/en/latest/">S3Fs&lt;/a>
is a practical Pythonic file interface to S3.&lt;/p>
&lt;p>The top-level class &lt;code>S3FileSystem&lt;/code> holds connection information and allows
typical file-system style operations like cp, mv, ls, du, glob, etc., as well as
put/get of local files to/from S3.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87;font-weight:bold">import&lt;/span> &lt;span style="color:#000">s3fs&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">fs&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span> &lt;span style="color:#000">s3fs&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">.&lt;/span>&lt;span style="color:#000">S3FileSystem&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#000">anon&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>&lt;span style="color:#204a87;font-weight:bold">True&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#000">client_kwargs&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span>&lt;span style="color:#000;font-weight:bold">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;endpoint_url&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;https://object-store.cloud.muni.cz&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#000;font-weight:bold">})&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87">print&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#000">fs&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">.&lt;/span>&lt;span style="color:#000">ls&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#4e9a06">&amp;#39;s3://test-egi-public&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">))&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">s3path&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;s3://test-egi-public/file1.txt&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87;font-weight:bold">with&lt;/span> &lt;span style="color:#000">fs&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">.&lt;/span>&lt;span style="color:#000">open&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#000">s3path&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;rb&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">)&lt;/span> &lt;span style="color:#204a87;font-weight:bold">as&lt;/span> &lt;span style="color:#000">f&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87">print&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#000">f&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">.&lt;/span>&lt;span style="color:#000">read&lt;/span>&lt;span style="color:#000;font-weight:bold">())&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>There is a good collection of examples on the
&lt;a href="https://github.com/minio/minio-py/tree/master/examples">S3Fs GitHub repository&lt;/a>.&lt;/p>
&lt;h2 id="access-via-egi-data-transfer">Access via EGI Data Transfer&lt;/h2>
&lt;p>The &lt;a href="../../../data/management/data-transfer">EGI Data Transfer&lt;/a> service can move
files to and from object storages that are compatible with the S3 protocol. You
will have to upload the &lt;code>access&lt;/code> keys to the EGI Data Transfer service, which
will be able to generate properly signed URLs for the objects in the storage.&lt;/p>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
Please contact support at &lt;code>support&lt;/code>
&lt;code>&amp;lt;at&amp;gt;&lt;/code> &lt;code>egi.eu&lt;/code> for more details.
&lt;/div>
&lt;p>You can then refer to this
&lt;a href="../../../tutorials/adhoc/data-transfer-object-storage">tutorial&lt;/a> to see how to
transfer to/from an Object storage endpoint.&lt;/p>
&lt;!--
// jscpd:ignore-end
--></description></item></channel></rss>