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
def _validate_max_instances(value): if int(value) <= 0: raise GcpFieldValidationException( "The max instances parameter has to be greater than 0")
def _validate_available_memory_in_mb(value): if int(value) <= 0: raise GcpFieldValidationException("The available memory has to be greater than 0")