def _create_allocation_source(self, request_data):
        payload = {}
        payload['name'] = request_data.get('name')
        payload['compute_allowed'] = request_data.get('compute_allowed')
        payload['renewal_strategy'] = request_data.get('renewal_strategy')

        creation_event = EventTable(name='allocation_source_created',
                                    payload=payload)

        creation_event.save()
        return AllocationSource.objects.filter(
            source_id=creation_event.entity_id).last()
    def _create_allocation_source(self,request_data):
        payload = {}
        payload['name'] = request_data.get('name')
        payload['compute_allowed'] = request_data.get('compute_allowed')
        payload['renewal_strategy'] = request_data.get('renewal_strategy')

        creation_event = EventTable(
             name='allocation_source_created',
             payload=payload)

        creation_event.save()
        return AllocationSource.objects.filter(source_id=creation_event.entity_id).last()
Esempio n. 3
0
    def _create_allocation_source(self, request_data):

        payload = {}
        payload['uuid'] = str(uuid.uuid4())
        payload['allocation_source_name'] = request_data.get('name')
        payload['compute_allowed'] = request_data.get('compute_allowed')
        payload['renewal_strategy'] = request_data.get('renewal_strategy')

        creation_event = EventTable(
            name='allocation_source_created_or_renewed',
            entity_id=payload['allocation_source_name'],
            payload=payload)

        creation_event.save()

        return get_allocation_source_object(payload['uuid'])
Esempio n. 4
0
    def _create_allocation_source(self, request_data):

        payload = {}
        payload['uuid'] = str(uuid.uuid4())
        payload['allocation_source_name'] = request_data.get('name')
        payload['compute_allowed'] = request_data.get('compute_allowed')
        payload['renewal_strategy'] = request_data.get('renewal_strategy')

        creation_event = EventTable(
            name='allocation_source_created_or_renewed',
            entity_id=payload['allocation_source_name'],
            payload=payload)

        creation_event.save()

        return get_allocation_source_object(payload['uuid'])