'Mofidy an existing retention policy for a database.
:param name: the name of the retention policy to modify
:type name: str
:param database: the database for which the retention policy is
modified. Defaults to current client\'s database
:type database: str
:param duration: the new duration of the existing retention policy.
Durations such as 1h, 90m, 12h, 7d, and 4w, are all supported
and mean 1 hour, 90 minutes, 12 hours, 7 day, and 4 weeks,
respectively. For infinite retention, meaning the data will
never be deleted, use \'INF\' for duration.
The minimum retention period is 1 hour.
:type duration: str
:param replication: the new replication of the existing
retention policy
:type replication: int
:param default: whether or not to set the modified policy as default
:type default: bool
.. note:: at least one of duration, replication, or default flag
should be set. Otherwise the operation will fail.'

def alter_retention_policy(self, name, database=None, duration=None, replication=None, default=None):

    query_string = u'ALTER    RETENTION    POLICY    {0}    ON    {1}'.format(quote_ident(name), quote_ident((database or self._database)))
    if duration:
        query_string += u'    DURATION    {0}'.format(duration)
    if replication:
        query_string += u'    REPLICATION    {0}'.format(replication)
    if (default is True):
        query_string += u'    DEFAULT'
    self.query(query_string)
