]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | # This is an interface definition of classes that are generated within C++. |
2 | # Used by mypy to do proper type checking of mgr modules. | |
3 | # Without this file, all classes have undefined base classes. | |
4 | ||
f67539c2 TL |
5 | from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple, Union |
6 | try: | |
7 | from typing import Protocol # Protocol was added in Python 3.8 | |
8 | except ImportError: | |
9 | class Protocol: # type: ignore | |
10 | pass | |
11 | ||
12 | ||
9f95a23c TL |
13 | class BasePyOSDMap(object): |
14 | def _get_epoch(self): ... | |
15 | def _get_crush_version(self): ... | |
16 | def _dump(self):... | |
17 | def _new_incremental(self):... | |
f67539c2 | 18 | def _apply_incremental(self, inc: 'BasePyOSDMapIncremental'):... |
9f95a23c TL |
19 | def _get_crush(self):... |
20 | def _get_pools_by_take(self, take):... | |
21 | def _calc_pg_upmaps(self, inc, max_deviation, max_iterations, pool):... | |
22 | def _map_pool_pgs_up(self, poolid):... | |
23 | def _pg_to_up_acting_osds(self, pool_id, ps):... | |
24 | def _pool_raw_used_rate(self, pool_id):... | |
25 | ||
26 | class BasePyOSDMapIncremental(object): | |
27 | def _get_epoch(self):... | |
28 | def _dump(self):... | |
29 | def _set_osd_reweights(self, weightmap):... | |
30 | def _set_crush_compat_weight_set_weights(self, weightmap):... | |
31 | ||
32 | class BasePyCRUSH(object): | |
33 | def _dump(self):... | |
34 | def _get_item_weight(self, item):... | |
35 | def _get_item_name(self, item):... | |
b3b6e05e | 36 | def _find_roots(self):... |
9f95a23c TL |
37 | def _find_takes(self):... |
38 | def _get_take_weight_osd_map(self, root):... | |
39 | ||
40 | class BaseMgrStandbyModule(object): | |
41 | def __init__(self, capsule): pass | |
b3b6e05e | 42 | def _ceph_get(self, data_name: str) -> Dict[str, Any]: ... |
9f95a23c TL |
43 | def _ceph_get_mgr_id(self):... |
44 | def _ceph_get_module_option(self, key, prefix=None):... | |
45 | def _ceph_get_option(self, key):... | |
46 | def _ceph_get_store(self, key):... | |
47 | def _ceph_get_active_uri(self):... | |
48 | ||
f67539c2 TL |
49 | |
50 | OptionValue = Optional[Union[bool, int, float, str]] | |
51 | ||
52 | ||
53 | class CompletionT(Protocol): | |
54 | def complete(self, r: int, outb: str, outs: str) -> None: ... | |
55 | ||
56 | ||
57 | ServerInfoT = Dict[str, Union[str, List[Dict[str, str]]]] | |
58 | HealthCheckT = Mapping[str, Union[int, str, Sequence[str]]] | |
59 | PerfCounterT = Dict[str, Any] | |
60 | ||
9f95a23c | 61 | class BaseMgrModule(object): |
f67539c2 TL |
62 | def __init__(self, py_modules_ptr: object, this_ptr: object) -> None: pass |
63 | def _ceph_get_version(self) -> str: ... | |
64 | def _ceph_get_release_name(self) -> str: ... | |
65 | def _ceph_lookup_release_name(self, release: int) -> str: ... | |
66 | def _ceph_cluster_log(self, channel: str, priority: int, message: str) -> None: ... | |
67 | def _ceph_get_context(self) -> object: ... | |
68 | def _ceph_get(self, data_name: str) -> Dict[str, Any]: ... | |
69 | def _ceph_get_server(self, hostname: Optional[str]) -> Union[ServerInfoT, | |
70 | List[ServerInfoT]]: ... | |
71 | def _ceph_get_perf_schema(self, svc_type: str, svc_name: str) -> Dict[str, Any]: ... | |
72 | def _ceph_get_counter(self, svc_type: str, svc_name: str, path: str) -> Dict[str, List[Tuple[float, int]]]: ... | |
73 | def _ceph_get_latest_counter(self, svc_type, svc_name, path): ... | |
74 | def _ceph_get_metadata(self, svc_type, svc_id): ... | |
75 | def _ceph_get_daemon_status(self, svc_type, svc_id): ... | |
76 | def _ceph_send_command(self, | |
77 | result: CompletionT, | |
78 | svc_type: str, | |
79 | svc_id: str, | |
80 | command: str, | |
81 | tag: str, | |
82 | inbuf: Optional[str]) -> None: ... | |
83 | def _ceph_set_health_checks(self, checks: Mapping[str, HealthCheckT]) -> None: ... | |
84 | def _ceph_get_mgr_id(self) -> str: ... | |
b3b6e05e | 85 | def _ceph_get_ceph_conf_path(self) -> str: ... |
f67539c2 TL |
86 | def _ceph_get_option(self, key: str) -> OptionValue: ... |
87 | def _ceph_get_foreign_option(self, entity: str, key: str) -> OptionValue: ... | |
88 | def _ceph_get_module_option(self, | |
89 | key: str, | |
90 | default: str, | |
91 | localized_prefix: str = "") -> OptionValue: ... | |
92 | def _ceph_get_store_prefix(self, key_prefix) -> Dict[str, str]: ... | |
93 | def _ceph_set_module_option(self, module: str, key: str, val: Optional[str]) -> None: ... | |
94 | def _ceph_set_store(self, key: str, val: Optional[str]) -> None: ... | |
95 | def _ceph_get_store(self, key: str) -> Optional[str]: ... | |
96 | # mgr actually imports OSDMap from mgr_module and constructs an OSDMap | |
97 | def _ceph_get_osdmap(self) -> BasePyOSDMap: ... | |
98 | def _ceph_set_uri(self, uri: str) -> None: ... | |
99 | def _ceph_set_device_wear_level(self, devid: str, val: float) -> None: ... | |
100 | def _ceph_have_mon_connection(self) -> bool: ... | |
101 | def _ceph_update_progress_event(self, evid: str, desc: str, progress: float, add_to_ceph_s: bool) -> None: ... | |
102 | def _ceph_complete_progress_event(self, evid: str) -> None: ... | |
103 | def _ceph_clear_all_progress_events(self) -> None: ... | |
104 | def _ceph_dispatch_remote(self, module_name: str, method_name: str, *args: Any, **kwargs: Any) -> Any: ... | |
105 | def _ceph_add_osd_perf_query(self, query: Dict[str, Dict[str, Any]]) -> Optional[int]: ... | |
106 | def _ceph_remove_osd_perf_query(self, query_id: int) -> None: ... | |
107 | def _ceph_get_osd_perf_counters(self, query_id: int) -> Optional[Dict[str, List[PerfCounterT]]]: ... | |
108 | def _ceph_add_mds_perf_query(self, query: Dict[str, Dict[str, Any]]) -> Optional[int]: ... | |
109 | def _ceph_remove_mds_perf_query(self, query_id: int) -> None: ... | |
110 | def _ceph_get_mds_perf_counters(self, query_id: int) -> Optional[Dict[str, List[PerfCounterT]]]: ... | |
111 | def _ceph_unregister_client(self, addrs: str) -> None: ... | |
112 | def _ceph_register_client(self, addrs: str) -> None: ... | |
113 | def _ceph_is_authorized(self, arguments: Dict[str, str]) -> bool: ... |