]>
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):... | |
20effc67 TL |
25 | @classmethod |
26 | def _build_simple(cls, epoch: int, uuid: Optional[str], num_osd: int) -> 'BasePyOSDMap' :... | |
9f95a23c TL |
27 | |
28 | class BasePyOSDMapIncremental(object): | |
29 | def _get_epoch(self):... | |
30 | def _dump(self):... | |
31 | def _set_osd_reweights(self, weightmap):... | |
32 | def _set_crush_compat_weight_set_weights(self, weightmap):... | |
33 | ||
34 | class BasePyCRUSH(object): | |
35 | def _dump(self):... | |
36 | def _get_item_weight(self, item):... | |
37 | def _get_item_name(self, item):... | |
b3b6e05e | 38 | def _find_roots(self):... |
9f95a23c TL |
39 | def _find_takes(self):... |
40 | def _get_take_weight_osd_map(self, root):... | |
41 | ||
42 | class BaseMgrStandbyModule(object): | |
43 | def __init__(self, capsule): pass | |
b3b6e05e | 44 | def _ceph_get(self, data_name: str) -> Dict[str, Any]: ... |
9f95a23c TL |
45 | def _ceph_get_mgr_id(self):... |
46 | def _ceph_get_module_option(self, key, prefix=None):... | |
47 | def _ceph_get_option(self, key):... | |
48 | def _ceph_get_store(self, key):... | |
49 | def _ceph_get_active_uri(self):... | |
50 | ||
f67539c2 TL |
51 | |
52 | OptionValue = Optional[Union[bool, int, float, str]] | |
53 | ||
54 | ||
55 | class CompletionT(Protocol): | |
56 | def complete(self, r: int, outb: str, outs: str) -> None: ... | |
57 | ||
58 | ||
59 | ServerInfoT = Dict[str, Union[str, List[Dict[str, str]]]] | |
60 | HealthCheckT = Mapping[str, Union[int, str, Sequence[str]]] | |
61 | PerfCounterT = Dict[str, Any] | |
62 | ||
9f95a23c | 63 | class BaseMgrModule(object): |
f67539c2 TL |
64 | def __init__(self, py_modules_ptr: object, this_ptr: object) -> None: pass |
65 | def _ceph_get_version(self) -> str: ... | |
66 | def _ceph_get_release_name(self) -> str: ... | |
67 | def _ceph_lookup_release_name(self, release: int) -> str: ... | |
68 | def _ceph_cluster_log(self, channel: str, priority: int, message: str) -> None: ... | |
69 | def _ceph_get_context(self) -> object: ... | |
20effc67 | 70 | def _ceph_get(self, data_name: str) -> Any: ... |
f67539c2 TL |
71 | def _ceph_get_server(self, hostname: Optional[str]) -> Union[ServerInfoT, |
72 | List[ServerInfoT]]: ... | |
73 | def _ceph_get_perf_schema(self, svc_type: str, svc_name: str) -> Dict[str, Any]: ... | |
20effc67 | 74 | def _ceph_get_rocksdb_version(self) -> str: ... |
f67539c2 TL |
75 | def _ceph_get_counter(self, svc_type: str, svc_name: str, path: str) -> Dict[str, List[Tuple[float, int]]]: ... |
76 | def _ceph_get_latest_counter(self, svc_type, svc_name, path): ... | |
77 | def _ceph_get_metadata(self, svc_type, svc_id): ... | |
78 | def _ceph_get_daemon_status(self, svc_type, svc_id): ... | |
79 | def _ceph_send_command(self, | |
80 | result: CompletionT, | |
81 | svc_type: str, | |
82 | svc_id: str, | |
83 | command: str, | |
84 | tag: str, | |
85 | inbuf: Optional[str]) -> None: ... | |
86 | def _ceph_set_health_checks(self, checks: Mapping[str, HealthCheckT]) -> None: ... | |
87 | def _ceph_get_mgr_id(self) -> str: ... | |
b3b6e05e | 88 | def _ceph_get_ceph_conf_path(self) -> str: ... |
f67539c2 TL |
89 | def _ceph_get_option(self, key: str) -> OptionValue: ... |
90 | def _ceph_get_foreign_option(self, entity: str, key: str) -> OptionValue: ... | |
91 | def _ceph_get_module_option(self, | |
92 | key: str, | |
93 | default: str, | |
94 | localized_prefix: str = "") -> OptionValue: ... | |
95 | def _ceph_get_store_prefix(self, key_prefix) -> Dict[str, str]: ... | |
96 | def _ceph_set_module_option(self, module: str, key: str, val: Optional[str]) -> None: ... | |
97 | def _ceph_set_store(self, key: str, val: Optional[str]) -> None: ... | |
98 | def _ceph_get_store(self, key: str) -> Optional[str]: ... | |
99 | # mgr actually imports OSDMap from mgr_module and constructs an OSDMap | |
100 | def _ceph_get_osdmap(self) -> BasePyOSDMap: ... | |
101 | def _ceph_set_uri(self, uri: str) -> None: ... | |
102 | def _ceph_set_device_wear_level(self, devid: str, val: float) -> None: ... | |
103 | def _ceph_have_mon_connection(self) -> bool: ... | |
104 | def _ceph_update_progress_event(self, evid: str, desc: str, progress: float, add_to_ceph_s: bool) -> None: ... | |
105 | def _ceph_complete_progress_event(self, evid: str) -> None: ... | |
106 | def _ceph_clear_all_progress_events(self) -> None: ... | |
107 | def _ceph_dispatch_remote(self, module_name: str, method_name: str, *args: Any, **kwargs: Any) -> Any: ... | |
108 | def _ceph_add_osd_perf_query(self, query: Dict[str, Dict[str, Any]]) -> Optional[int]: ... | |
109 | def _ceph_remove_osd_perf_query(self, query_id: int) -> None: ... | |
110 | def _ceph_get_osd_perf_counters(self, query_id: int) -> Optional[Dict[str, List[PerfCounterT]]]: ... | |
111 | def _ceph_add_mds_perf_query(self, query: Dict[str, Dict[str, Any]]) -> Optional[int]: ... | |
112 | def _ceph_remove_mds_perf_query(self, query_id: int) -> None: ... | |
113 | def _ceph_get_mds_perf_counters(self, query_id: int) -> Optional[Dict[str, List[PerfCounterT]]]: ... | |
114 | def _ceph_unregister_client(self, addrs: str) -> None: ... | |
115 | def _ceph_register_client(self, addrs: str) -> None: ... | |
116 | def _ceph_is_authorized(self, arguments: Dict[str, str]) -> bool: ... |