Managing S3 User and Bucket Limits via REST API
-----------------------------------------------

This section describes limits you can define for users and buckets via REST API. You can apply the limits according to specific options that can be a part of your service plan.

Setting Operations per Second for Users
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can limit operations rate with the ``ostor-limits`` service and the following parameters: ``emailAddress`` specifying the email address, ``ops`` specifying the limit type, and ``default=``, ``get=``, ``put=``, ``list=``, or ``delete=`` specifying the limit value:

.. only:: html

   ::
   
       # s3_curl PUT "http://s3.example.com/?ostor-limits&emailAddress=client@example.com&limit-type=ops&limit-resource=get&limit-value=3600"

.. only:: latex

   ::
   
       # s3_curl PUT "http://s3.example.com/?ostor-limits&emailAddress=client@example.com&limit-type=ops\
        &limit-resource=get&limit-value=3600"

Setting Bandwidth per Second for Users
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can limit outgoing bandwidth of a response with the ``ostor-limits`` service and the following parameters: ``emailAddress`` specifying the email address, ``bandwidth`` specifying the limit type, and ``out=`` specifying the limit value:

.. only:: html

   ::
   
       # s3_curl PUT "http://s3.example.com/?ostor-limits&emailAddress=client@example.com&limit-type=bandwidth&limit-resource=out&limit-value=100"

.. only:: latex

   ::
   
       # s3_curl PUT "http://s3.example.com/?ostor-limits&emailAddress=client@example.com\
        &limit-type=bandwidth&limit-resource=out&limit-value=100"

Querying User Limits
~~~~~~~~~~~~~~~~~~~~

You can display the current limits with the ``ostor-limits`` service and parameter ``emailAddress`` specifying the email address:

::

   # s3_curl GET "http://s3.example.com/?ostor-limits&emailAddress=client@example.com"
   {
       "ops:default": "0.00",
       "ops:get": "3600.00",
       "ops:put": "0.00",
       "ops:list": "0.00",
       "ops:delete": "0.00",
       "bandwidth:out": "100"
   }

Deleting User Limits
~~~~~~~~~~~~~~~~~~~~

You can delete the current limits with the ``ostor-limits`` service and parameter ``emailAddress`` specifying the email address:

::

   # s3_curl DELETE "http://s3.example.com/?ostor-limits&emailAddress=client@example.com"

Setting Operations per Second for Buckets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can limit operations rate with the ``ostor-limits`` service and the following parameters: ``bucket`` specifying the bucket name, ``ops`` specifying the limit type, and ``default=``, ``get=``, ``put=``, ``list=``, or ``delete=`` specifying the limit value:

.. only:: html

   ::
   
       # s3_curl PUT "http://s3.example.com/?ostor-limits&bucket=client&limit-type=ops&limit-resource=get&limit-value=3600"

.. only:: latex

   ::
   
       # s3_curl PUT "http://s3.example.com/?ostor-limits&bucket=client&limit-type=ops\
        &limit-resource=get&limit-value=3600"

Setting Bandwidth per Second for Buckets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can limit outgoing bandwidth of a response with the ``ostor-limits`` service and the following parameters: ``bucket`` specifying the bucket name, ``bandwidth`` specifying the limit type, and ``out=`` specifying the limit value:

.. only:: html

   ::
   
       # s3_curl PUT "http://s3.example.com/?ostor-limits&bucket=client&limit-type=bandwidth&limit-resource=out&limit-value=100"

.. only:: latex

   ::
   
       # s3_curl PUT "http://s3.example.com/?ostor-limits&bucket=client&limit-type=bandwidth\
        &limit-resource=out&limit-value=100"

Querying Bucket Limits
~~~~~~~~~~~~~~~~~~~~~~

You can display the current limits with the ``ostor-limits`` service and parameter ``bucket`` specifying the bucket name:

::

   # s3_curl GET "http://s3.example.com/?ostor-limits&bucket=client"
   {
       "ops:default": "0.00",
       "ops:get": "3600.00",
       "ops:put": "0.00",
       "ops:list": "0.00",
       "ops:delete": "0.00",
       "bandwidth:out": "100"
   }

Deleting Bucket Limits
~~~~~~~~~~~~~~~~~~~~~~

You can delete the current limits with the ``ostor-limits`` service and parameter ``bucket`` specifying the bucket name:

::

   # s3_curl DELETE "http://s3.example.com/?ostor-limits&bucket=client"
