'Instruct Cinder to manage a storage snapshot object.
Manages an existing backend storage snapshot object (e.g. a Linux
logical volume or a SAN disk) by creating the Cinder objects required
to manage it, and possibly renaming the backend storage snapshot object
(driver dependent).
From an API perspective, this operation behaves very much like a
snapshot creation operation.
Required HTTP Body:
.. code-block:: json
"snapshot":
"volume_id": "<Cinder volume already exists in volume backend>",
"ref":
"<Driver-specific reference to the existing storage object>"
See the appropriate Cinder drivers\' implementations of the
manage_snapshot method to find out the accepted format of \'ref\'.
For example,in LVM driver, it will be the logic volume name of snapshot
which you want to manage.
This API call will return with an error if any of the above elements
are missing from the request, or if the \'volume_id\' element refers to
a cinder volume that could not be found.
The snapshot will later enter the error state if it is discovered that
\'ref\' is bad.
Optional elements to \'snapshot\' are::
name           A name for the new snapshot.
description    A description for the new snapshot.
metadata       Key/value pairs to be associated with the new snapshot.'

@wsgi.response(http_client.ACCEPTED)
def create(self, req, body):

    context = req.environ['cinder.context']
    authorize_manage(context)
    if (not self.is_valid_body(body, 'snapshot')):
        msg = _('Missing    required    element    snapshot    in    request    body.')
        raise exc.HTTPBadRequest(explanation=msg)
    snapshot = body['snapshot']
    required_keys = ('ref', 'volume_id')
    missing_keys = (set(required_keys) - set(snapshot.keys()))
    if missing_keys:
        msg = (_('The    following    elements    are    required:    %s') % ',    '.join(missing_keys))
        raise exc.HTTPBadRequest(explanation=msg)
    volume_id = snapshot['volume_id']
    volume = self.volume_api.get(context, volume_id)
    LOG.debug('Manage    snapshot    request    body:    %s', body)
    snapshot_parameters = {}
    snapshot_parameters['metadata'] = snapshot.get('metadata', None)
    snapshot_parameters['description'] = snapshot.get('description', None)
    snapshot_parameters['name'] = snapshot.get('name')
    new_snapshot = self.volume_api.manage_existing_snapshot(context, snapshot['ref'], volume, **snapshot_parameters)
    return self._view_builder.detail(req, new_snapshot)
