Exemplo n.º 1
0
 def delete_application_credential(self, application_credential_id):
     with sql.session_for_write() as session:
         query = session.query(ApplicationCredentialModel)
         app_cred_ref = query.filter_by(
             id=application_credential_id).first()
         if not app_cred_ref:
             raise exception.ApplicationCredentialNotFound(
                 application_credential_id=application_credential_id)
         session.delete(app_cred_ref)
Exemplo n.º 2
0
 def get_application_credential(self, application_credential_id):
     with sql.session_for_read() as session:
         query = session.query(ApplicationCredentialModel).filter_by(
             id=application_credential_id)
         ref = query.first()
         if ref is None:
             raise exception.ApplicationCredentialNotFound(
                 application_credential_id=application_credential_id)
         app_cred_dict = self._to_dict(ref)
         return app_cred_dict