def _create_event(self, event_data, event_json_string): params = dict( resource_id=event_data.get('entityuuid'), description=event_data.get('description'), username=self._get_user_name(event_data.get('user')), account=self._get_account_name(event_data.get('account')), date=parse(event_data.get('eventDateTime')).replace(tzinfo=None), region=self.region, original_event=event_json_string ) return EventFactory.create_event(event_key=event_data.get('event'), **params)
def _create_event(self, event_data, event_json_string): params = dict( resource_id=event_data.get('entityuuid'), description=event_data.get('description'), username=self._get_user_name(event_data.get('user')), account=self._get_account_name(event_data.get('account')), date=parse(event_data.get('eventDateTime')).replace(tzinfo=None), region=self.region, original_event=event_json_string) return EventFactory.create_event(event_key=event_data.get('event'), **params)
def test_create_lb_event(self): event = EventFactory.create_event('LB.CREATE') self.assertEquals(LoadBalancerEvent, event.__class__)
def test_create_volume_event(self): event = EventFactory.create_event('VOLUME.CREATE') self.assertEquals(VolumeEvent, event.__class__)
def test_create_network_event(self): event = EventFactory.create_event('NETWORK.CREATE') self.assertEquals(NetworkEvent, event.__class__)
def test_create_vm_event(self): event = EventFactory.create_event('VM.CREATE') self.assertEquals(VirtualMachineEvent, event.__class__)
def test_create_generic_event(self): event = EventFactory.create_event('USER.LOGIN') self.assertEquals(Event, event.__class__)
def test_create_router_event(self): event = EventFactory.create_event('ROUTER.REBOOT') self.assertEquals(RouterEvent, event.__class__)
def test_create_service_offering_event(self): event = EventFactory.create_event('SERVICE.OFFERING.CREATE') self.assertEquals(ServiceOfferingEvent, event.__class__)
def test_create_project_event(self): event = EventFactory.create_event('PROJECT.CREATE') self.assertEquals(ProjectEvent, event.__class__)
def test_create_snapshot_event(self): event = EventFactory.create_event('VMSNAPSHOT.CREATE') self.assertEquals(VirtualMachineSnapshotEvent, event.__class__)