Exemplo n.º 1
0
 def _check_if_function_exists(self):
     name = self.body.get('name')
     if not name:
         raise GcpFieldValidationException("The 'name' field should be present in "
                                           "body: '{}'.".format(self.body))
     try:
         self._hook.get_function(name)
     except HttpError as e:
         status = e.resp.status
         if status == 404:
             return False
         raise e
     return True
Exemplo n.º 2
0
def _validate_max_instances(value):
    if int(value) <= 0:
        raise GcpFieldValidationException(
            "The max instances parameter has to be greater than 0")
Exemplo n.º 3
0
def _validate_available_memory_in_mb(value):
    if int(value) <= 0:
        raise GcpFieldValidationException("The available memory has to be greater than 0")