-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathservice_registry_client.py
More file actions
66 lines (50 loc) · 2 KB
/
Copy pathservice_registry_client.py
File metadata and controls
66 lines (50 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Optional, List
from conductor.client.http.models.service_registry import ServiceRegistry
from conductor.client.http.models.service_method import ServiceMethod
from conductor.client.http.models.proto_registry_entry import ProtoRegistryEntry
from conductor.client.http.models.circuit_breaker_transition_response import CircuitBreakerTransitionResponse
class ServiceRegistryClient(ABC):
@abstractmethod
def get_registered_services(self) -> List[ServiceRegistry]:
pass
@abstractmethod
def get_service(self, name: str) -> ServiceRegistry:
pass
@abstractmethod
def add_or_update_service(self, service_registry: ServiceRegistry) -> None:
pass
@abstractmethod
def remove_service(self, name: str) -> None:
pass
@abstractmethod
def open_circuit_breaker(self, name: str) -> CircuitBreakerTransitionResponse:
pass
@abstractmethod
def close_circuit_breaker(self, name: str) -> CircuitBreakerTransitionResponse:
pass
@abstractmethod
def get_circuit_breaker_status(self, name: str) -> CircuitBreakerTransitionResponse:
pass
@abstractmethod
def add_or_update_method(self, registry_name: str, method: ServiceMethod) -> None:
pass
@abstractmethod
def remove_method(self, registry_name: str, service_name: str, method: str, method_type: str) -> None:
pass
@abstractmethod
def get_proto_data(self, registry_name: str, filename: str) -> bytes:
pass
@abstractmethod
def set_proto_data(self, registry_name: str, filename: str, data: bytes) -> None:
pass
@abstractmethod
def delete_proto(self, registry_name: str, filename: str) -> None:
pass
@abstractmethod
def get_all_protos(self, registry_name: str) -> List[ProtoRegistryEntry]:
pass
@abstractmethod
def discover(self, name: str, create: Optional[bool] = False) -> List[ServiceMethod]:
pass