Ejemplo n.º 1
0
    def delete(self, params, del_id):

        del_str = '{}{}'.format(params, del_id)
        resp_ok, resp_status, resp_data = self.__request('DELETE', del_str)
        if resp_ok and resp_status == 204:
            return True
        else:
            raise exceptions.DeleteException(resp_data)
Ejemplo n.º 2
0
    def delete(self, params, del_id):

        del_str = '{}{}'.format(params, del_id)
        resp_ok, resp_status, resp_data = self.__request('DELETE', del_str)
        if resp_ok and resp_status == 204:
            return True

        if resp_status == 404:
            raise exceptions.NotFoundException("Unable to found object with id {}".format(del_id), from_con=True)

        raise exceptions.DeleteException(resp_data)
Ejemplo n.º 3
0
    def delete(self, params, del_id):
        if self.auth:
            raise exceptions.AuthException(
                'With basic authentication the API is not writable')
        del_str = '{}{}'.format(params, del_id)
        resp_ok, resp_status, resp_data = self.__request('DELETE', del_str)

        if resp_ok and resp_status == 204:
            return True
        else:
            raise exceptions.DeleteException(resp_data)