'Create encryption specs for an existing volume type.'

def create(self, req, type_id, body=None):

    context = req.environ['cinder.context']
    authorize(context)
    if self._encrypted_type_in_use(context, type_id):
        expl = _('Cannot    create    encryption    specs.    Volume    type    in    use.')
        raise webob.exc.HTTPBadRequest(explanation=expl)
    self.assert_valid_body(body, 'encryption')
    self._check_type(context, type_id)
    encryption_specs = self._get_volume_type_encryption(context, type_id)
    if encryption_specs:
        raise exception.VolumeTypeEncryptionExists(type_id=type_id)
    encryption_specs = body['encryption']
    self._check_encryption_input(encryption_specs)
    db.volume_type_encryption_create(context, type_id, encryption_specs)
    notifier_info = dict(type_id=type_id, specs=encryption_specs)
    notifier = rpc.get_notifier('volumeTypeEncryption')
    notifier.info(context, 'volume_type_encryption.create', notifier_info)
    return body
