Closed rloomer closed 4 years ago
You're right, that method doesn't seem to exists for that class. But from the RESTServiceClient class is the following method:
def remove_endpoint(self, endpoint_name):
"""Deletes an endpoint through the management API.
Parameters
----------
endpoint_name : str
The endpoint to delete.
"""
self.service_client.DELETE('endpoints/'+endpoint_name)
That class corresponds to the Client service attribute:
self._service = RESTServiceClient(service_client)
So therefore you should be able to run:
client._service.remove_endpoint('GermanCreditCheck')
The fix is added in PR https://github.com/tableau/TabPy/pull/388
The fix is in published package v0.9.0.
Environment information:
Describe the issue I am getting the error "'Client' object has no attribute 'remove'" when attempting to execute: client.remove('myfunction')
To Reproduce Executing from Anaconda prompt (version 4.3.0):
from tabpy.tabpy_tools.client import Client client=Client('http://localhost:9004') client.remove('GermanCreditCheck')
AttributeError: 'Client' object has no attribute 'remove'
Expected behavior The 'GermanCreditCheck' endpoint should have been removed, but the 'remove' method in the Client object was not available to perform the function.
Screenshots
Additional context The tabpy\tabpy_tools\client.py file in prior versions included: def remove(self, name) but it is not available in the current 0.8.9 release.
There is no apparent way to now be able to remove a function from the list of endpoints.