def create_event(ctx, **kwargs): values = { 'stack_id': 'test_stack_id', 'resource_action': 'create', 'resource_status': 'complete', 'resource_name': 'res', 'physical_resource_id': UUID1, 'resource_status_reason': "create_complete", 'resource_properties': {'name': 'foo'} } values.update(kwargs) return db_api.event_create(ctx, values)
def create(cls, context, values): # Using dict() allows us to be done with the sqlalchemy/model # layer in one call, rather than hitting that layer for every # field in _from_db_object(). return cls._from_db_object(context, cls(context=context), dict(db_api.event_create(context, values)))
def create(cls, context, values): return cls._from_db_object(context, cls(), db_api.event_create(context, values))