mirror of
https://github.com/wassname/ray.git
synced 2026-07-04 02:28:23 +08:00
[serve] Add list_backends and list_endpoints (#8737)
This commit is contained in:
@@ -141,6 +141,16 @@ def delete_endpoint(endpoint):
|
||||
retry_actor_failures(master_actor.delete_endpoint, endpoint)
|
||||
|
||||
|
||||
@_ensure_connected
|
||||
def list_endpoints():
|
||||
"""Returns a dictionary of all registered endpoints.
|
||||
|
||||
The dictionary keys are endpoint names and values are dictionaries
|
||||
of the form: {"methods": List[str], "traffic": Dict[str, float]}.
|
||||
"""
|
||||
return retry_actor_failures(master_actor.get_all_endpoints)
|
||||
|
||||
|
||||
@_ensure_connected
|
||||
def update_backend_config(backend_tag, config_options):
|
||||
"""Update a backend configuration for a backend tag.
|
||||
@@ -200,6 +210,15 @@ def create_backend(backend_tag,
|
||||
backend_config, replica_config)
|
||||
|
||||
|
||||
@_ensure_connected
|
||||
def list_backends():
|
||||
"""Returns a dictionary of all registered backends.
|
||||
|
||||
Dictionary maps backend tags to backend configs.
|
||||
"""
|
||||
return retry_actor_failures(master_actor.get_all_backends)
|
||||
|
||||
|
||||
@_ensure_connected
|
||||
def delete_backend(backend_tag):
|
||||
"""Delete the given backend.
|
||||
|
||||
Reference in New Issue
Block a user