Пример #1
0
 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)
Пример #3
0
 def test_create_lb_event(self):
     event = EventFactory.create_event('LB.CREATE')
     self.assertEquals(LoadBalancerEvent, event.__class__)
Пример #4
0
 def test_create_volume_event(self):
     event = EventFactory.create_event('VOLUME.CREATE')
     self.assertEquals(VolumeEvent, event.__class__)
Пример #5
0
 def test_create_network_event(self):
     event = EventFactory.create_event('NETWORK.CREATE')
     self.assertEquals(NetworkEvent, event.__class__)
Пример #6
0
 def test_create_vm_event(self):
     event = EventFactory.create_event('VM.CREATE')
     self.assertEquals(VirtualMachineEvent, event.__class__)
Пример #7
0
 def test_create_generic_event(self):
     event = EventFactory.create_event('USER.LOGIN')
     self.assertEquals(Event, event.__class__)
Пример #8
0
 def test_create_router_event(self):
     event = EventFactory.create_event('ROUTER.REBOOT')
     self.assertEquals(RouterEvent, event.__class__)
Пример #9
0
 def test_create_service_offering_event(self):
     event = EventFactory.create_event('SERVICE.OFFERING.CREATE')
     self.assertEquals(ServiceOfferingEvent, event.__class__)
Пример #10
0
 def test_create_project_event(self):
     event = EventFactory.create_event('PROJECT.CREATE')
     self.assertEquals(ProjectEvent, event.__class__)
Пример #11
0
 def test_create_lb_event(self):
     event = EventFactory.create_event('LB.CREATE')
     self.assertEquals(LoadBalancerEvent, event.__class__)
Пример #12
0
 def test_create_volume_event(self):
     event = EventFactory.create_event('VOLUME.CREATE')
     self.assertEquals(VolumeEvent, event.__class__)
Пример #13
0
 def test_create_network_event(self):
     event = EventFactory.create_event('NETWORK.CREATE')
     self.assertEquals(NetworkEvent, event.__class__)
Пример #14
0
 def test_create_vm_event(self):
     event = EventFactory.create_event('VM.CREATE')
     self.assertEquals(VirtualMachineEvent, event.__class__)
Пример #15
0
 def test_create_generic_event(self):
     event = EventFactory.create_event('USER.LOGIN')
     self.assertEquals(Event, event.__class__)
Пример #16
0
 def test_create_project_event(self):
     event = EventFactory.create_event('PROJECT.CREATE')
     self.assertEquals(ProjectEvent, event.__class__)
Пример #17
0
 def test_create_service_offering_event(self):
     event = EventFactory.create_event('SERVICE.OFFERING.CREATE')
     self.assertEquals(ServiceOfferingEvent, event.__class__)
Пример #18
0
 def test_create_router_event(self):
     event = EventFactory.create_event('ROUTER.REBOOT')
     self.assertEquals(RouterEvent, event.__class__)
Пример #19
0
 def test_create_snapshot_event(self):
     event = EventFactory.create_event('VMSNAPSHOT.CREATE')
     self.assertEquals(VirtualMachineSnapshotEvent, event.__class__)
Пример #20
0
 def test_create_snapshot_event(self):
     event = EventFactory.create_event('VMSNAPSHOT.CREATE')
     self.assertEquals(VirtualMachineSnapshotEvent, event.__class__)