Exemplo n.º 1
0
 def test_create_pvc(self, insert, create_pvc):
     insert.__enter__.return_value = True
     create_pvc.__enter__.return_value = 2
     try:
         pvc = PvcService.create_pvc(self.pvc, self.ou_id, self.ou_name)
         print(pvc)
     except Exception as e:
         print(e)
def create_pvc(body):  # noqa: E501
    """Create a pvc.

     # noqa: E501

        :param body:
            :type body: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        pvc = Pvc.from_dict(connexion.request.get_json())  # noqa: E501
        ou_name = util.get_user(request=connexion.request)
        ou_id = util.get_ou_id(request=connexion.request)
        data = PvcService.create_pvc(pvc=pvc, ou_id=ou_id, ou_name=ou_name)
        return ApiStatus(code=0, msg='success', data=data)