Mark a cache storage device as offline. The storage is identified by a path
    which must match exactly a path specified in storage.config. This removes
    the storage from the cache and redirects requests that would have used this
    storage to other storage. This has exactly the same effect as a disk
    failure for that storage. This does not persist across restarts of the
    traffic_server process.

    .. code-block:: yaml

        offline_ats_path:
          trafficserver.offline:
            - path: /path/to/cache

def offline(name, path):
    '''
    Mark a cache storage device as offline. The storage is identified by a path
    which must match exactly a path specified in storage.config. This removes
    the storage from the cache and redirects requests that would have used this
    storage to other storage. This has exactly the same effect as a disk
    failure for that storage. This does not persist across restarts of the
    traffic_server process.

    .. code-block:: yaml

        offline_ats_path:
          trafficserver.offline:
            - path: /path/to/cache
    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    if __opts__['test']:
        ret['comment'] = 'Setting {0} to offline'.format(path)
        return ret

    __salt__['trafficserver.offline'](path)

    ret['result'] = True
    ret['comment'] = 'Set {0} as offline'.format(path)
    return ret