'Creates a new snapshot.'

@extensions.expected_errors(400)
@validation.schema(assisted_volume_snapshots.snapshots_create)
def create(self, req, body):

    context = req.environ['nova.context']
    context.can((avs_policies.POLICY_ROOT % 'create'))
    snapshot = body['snapshot']
    create_info = snapshot['create_info']
    volume_id = snapshot['volume_id']
    try:
        return self.compute_api.volume_snapshot_create(context, volume_id, create_info)
    except (exception.VolumeBDMNotFound, exception.VolumeBDMIsMultiAttach, exception.InvalidVolume) as error:
        raise exc.HTTPBadRequest(explanation=error.format_message())
    except (exception.InstanceInvalidState, exception.InstanceNotReady) as e:
        raise exc.HTTPBadRequest(explanation=e.format_message())
