Example #1
0
    def faceset_ipc_unbind(self, faceset_id, device_list):
        '''

        :param faceset_id:
        :param device_list:
        :return:
        '''
        method = 'DELETE'
        path = self.api_version + '/facesets/%s/unbind' % faceset_id

        if not isinstance(device_list, tuple):
            raise ValueError(
                'device_list is a arry[{"device_sn":xx,"threshold":xx}]')

        headers = {'host': self.host, 'content-type': self.content_type}

        data = {'device_list': device_list}

        authorization = self.auth.get_sign(http_method=method,
                                           path=path,
                                           params=None,
                                           headers=headers)
        url = '{0}{1}'.format(self.base_url, path)
        print(url)

        ret, info = dohttp._delete(url,
                                   data=json.dumps(data),
                                   auth=authorization,
                                   headers=headers)

        return ret, info
Example #2
0
    def user_faces_delete(self, faceset_id, face_list):
        '''

        :param faceset_id:
        :param face_list:   array	是	用户id列表, string数组
        :return:
        '''
        method = 'DELETE'
        path = self.api_version + '/facesets/%s/faces' % faceset_id

        headers = {'host': self.host, 'content-type': self.content_type}

        data = {'face_list': face_list}

        authorization = self.auth.get_sign(http_method=method,
                                           path=path,
                                           params=None,
                                           headers=headers)
        url = '{0}{1}'.format(self.base_url, path)
        print(url)

        ret, info = dohttp._delete(url,
                                   data=json.dumps(data),
                                   auth=authorization,
                                   headers=headers)

        return ret, info
Example #3
0
    def device_delete(self, device_sn):
        '''
        从指定设备空间移除设备,设备会回退到默认设备空间;接口是异步接口,可根据返回值的request_id请求获取异步任务状态接口获取请求状态
        :param device_sn:
        :return:
        '''
        method = 'DELETE'
        path = self.api_version + '/devices/%s' % device_sn

        headers = {'host': self.host}

        authorization = self.auth.get_sign(http_method=method,
                                           path=path,
                                           params=None,
                                           headers=headers)
        url = '{0}{1}'.format(self.base_url, path)
        print(url)
        ret, info = dohttp._delete(url, auth=authorization)
        return ret, info
    def delete(self, faceset_id):
        '''
        删除当前api调用者指定的人脸库
        :param faceset_id:
        :return:
        '''
        method = 'DELETE'
        path = self.api_version + '/facesets/%s' % faceset_id

        headers = {'host': self.host}

        authorization = self.auth.get_sign(http_method=method,
                                           path=path,
                                           params=None,
                                           headers=headers)
        url = '{0}{1}'.format(self.base_url, path)
        print(url)

        ret, info = dohttp._delete(url, auth=authorization)

        return ret, info
Example #5
0
    def pf_line_delete(self, device_sn):
        '''
        用于删除客流画线配置信息
        :param device_sn:
        :return:
        '''

        method = 'DELETE'
        path = self.api_version + '/passengerflow/%s' % device_sn

        headers = {'host': self.host}

        authorization = self.auth.get_sign(http_method=method,
                                           path=path,
                                           params=None,
                                           headers=headers)
        url = '{0}{1}'.format(self.base_url, path)
        print(url)

        ret, info = dohttp._delete(url, auth=authorization)

        return ret, info
    def visitor_sub_cancel(self, subscription_id):
        '''
        取消到店记录订阅发起的订阅
        :param subscription_id:
        :return:
        '''
        method = 'DELETE'
        path = self.api_version + '/analysis_tools/visitors/sub/%s' % subscription_id

        headers = {'host': self.host}

        authorization = self.auth.get_sign(http_method=method,
                                           path=path,
                                           params=None,
                                           headers=headers)

        url = '{0}{1}'.format(self.base_url, path)
        print(url)

        ret, info = dohttp._delete(url, auth=authorization)

        return ret, info
Example #7
0
    def delete(self, space_id):
        '''
        删除当前api调用者指定的一个设备空间,当设备空间中有挂载设备时不能删除,需要先清除设备空间中挂载的设备后方可删除
        :param space_id:
        :return:
        '''
        method = 'DELETE'
        path = self.api_version + '/device_spaces/%s' % space_id

        headers = {'host': self.host}

        authorization = self.auth.get_sign(http_method=method,
                                           path=path,
                                           params=None,
                                           headers=headers)

        url = '{0}{1}'.format(self.base_url, path)
        print(url)

        ret, info = dohttp._delete(url, auth=authorization)

        return ret, info
Example #8
0
    def faceset_delete(self, faceset_id):
        '''
        OpenAPI获取删除人脸库指令,删除人脸库,返回状态码与错误信息。
        人脸库删除前,必须先解除该人脸库与所有IPC的绑定关系。存在绑定关系的人脸库,删除会返回错误。
        :param faceset_id:
        :return:
        '''

        method = 'DELETE'
        path = self.api_version + '/facesets/%s' % faceset_id

        headers = {'host': self.host}

        authorization = self.auth.get_sign(http_method=method,
                                           path=path,
                                           params=None,
                                           headers=headers)
        url = '{0}{1}'.format(self.base_url, path)
        print(url)

        ret, info = dohttp._delete(url, auth=authorization)

        return ret, info