def _http_post_common(self, request, obj_type, obj_dict):
        if not obj_dict:
            # TODO check api + resource perms etc.
            return (True, None)

        # Fail if object exists already
        try:
            obj_uuid = self._db_conn.fq_name_to_uuid(obj_type, obj_dict['fq_name'])
            bottle.abort(409, '' + pformat(obj_dict['fq_name']) + ' already exists with uuid: ' + obj_uuid)
        except NoIdError:
            pass

        # Ensure object has atleast default permissions set
        self._ensure_id_perms_present(obj_type, obj_dict)

        # TODO check api + resource perms etc.

        uuid_in_req = obj_dict.get('uuid', None)

        fq_name_str = ":".join(obj_dict['fq_name'])
        apiConfig = VncApiCommon(identifier_name = fq_name_str)
        apiConfig.operation = 'post'
        apiConfig.url = request.url
        if uuid_in_req:
            apiConfig.identifier_uuid = uuid_in_req
        ## TODO should be from x-auth-token
        apiConfig.user = ''
        uveLog = None

        if obj_type == "virtual_machine" or obj_type == "virtual-machine":
            log = VMLog(api_log = apiConfig, sandesh=self._sandesh)
        elif obj_type == "virtual_network" or obj_type == "virtual-network":
            vn_log = UveVirtualNetworkConfig(name = fq_name_str,
                                             attached_policies=[])
            self.add_virtual_network_refs(vn_log, obj_dict)
            uveLog = UveVirtualNetworkConfigTrace(data = vn_log,
                                               sandesh=self._sandesh)
            log = VNLog(api_log = apiConfig, sandesh=self._sandesh)
        elif obj_type == "virtual_router" or obj_type == "virtual-router":
            log = VRLog(api_log = apiConfig, sandesh=self._sandesh)
        else:
            log = VncApiConfigLog(api_log = apiConfig, sandesh=self._sandesh)

        if uveLog:
            uveLog.send(sandesh=self._sandesh)
        log.send(sandesh=self._sandesh)

        return (True, uuid_in_req)
    def _http_put_common(self, request, obj_type, obj_dict, obj_uuid):
        if obj_dict:
            fq_name_str = ":".join(obj_dict['fq_name'])

            # TODO keep _id_perms.uuid_xxlong immutable in future
            # dsetia - check with ajay regarding comment above
            #if 'id_perms' in obj_dict:
            #    del obj_dict['id_perms']
            if 'id_perms' in obj_dict and obj_dict['id_perms']['uuid']:
                if not self._db_conn.match_uuid(obj_dict, obj_uuid):
                    log_msg = 'UUID mismatch from %s:%s' \
                        %(request.environ['REMOTE_ADDR'], request.environ['HTTP_USER_AGENT'])
                    self.config_object_error(obj_uuid, fq_name_str, obj_type, 'put', log_msg)
                    self._db_conn.set_uuid(obj_dict, uuid.UUID(obj_uuid))

            apiConfig = VncApiCommon()
            apiConfig.operation = 'put'
            apiConfig.url = request.url
            apiConfig.identifier_uuid = obj_uuid
            # TODO should be from x-auth-token
            apiConfig.user = ''
            apiConfig.identifier_name = fq_name_str
            uveLog = None

            if obj_type == "virtual_machine" or obj_type == "virtual-machine":
                log = VMLog(api_log = apiConfig, sandesh=self._sandesh)
            elif obj_type == "virtual_network" or obj_type == "virtual-network":
                vn_log = UveVirtualNetworkConfig(name = fq_name_str,
                                                 attached_policies=[])
                self.add_virtual_network_refs(vn_log, obj_dict)
                uveLog = UveVirtualNetworkConfigTrace(data = vn_log,
                                                   sandesh=self._sandesh)
                log = VNLog(api_log = apiConfig, sandesh=self._sandesh)
            elif obj_type == "virtual_router" or obj_type == "virtual-router":
                log = VRLog(api_log = apiConfig, sandesh=self._sandesh)
            else:
                log = VncApiConfigLog(api_log = apiConfig,
                                      sandesh=self._sandesh)

            if uveLog:
                uveLog.send(sandesh=self._sandesh)
            log.send(sandesh=self._sandesh)

        # TODO check api + resource perms etc.
        if self._args.multi_tenancy:
            return self._permissions.check_perms_write(request, obj_uuid)

        return (True, '')