MCPcopy Create free account
hub / github.com/ceph/ceph / __init__

Method __init__

src/ceph-node-proxy/ceph_node_proxy/redfish.py:81–99  ·  view source on GitHub ↗
(self, url: str, client: RedFishClient)

Source from the content-addressed store, hash-verified

79 NAME: str = "Endpoint"
80
81 def __init__(self, url: str, client: RedFishClient) -> None:
82 self.log = get_logger(f"{__name__}:{Endpoint.NAME}")
83 self.url: str = url
84 self.client: RedFishClient = client
85 self._children: Dict[str, "Endpoint"] = {}
86 self.data: Dict[str, Any] = self.get_data()
87 self.id: str = ""
88 self.members_names: List[str] = []
89
90 if self.has_members:
91 self.members_names = self.get_members_names()
92
93 if self.data:
94 try:
95 self.id = self.data["Id"]
96 except KeyError:
97 self.id = self.data["@odata.id"].split("/")[-1]
98 else:
99 self.log.warning(f"No data could be loaded for {self.url}")
100
101 def __getitem__(self, key: str) -> "Endpoint":
102 if not isinstance(key, str) or not key or "/" in key:

Callers

nothing calls this directly

Calls 5

get_dataMethod · 0.95
get_members_namesMethod · 0.95
get_loggerFunction · 0.90
splitMethod · 0.45
warningMethod · 0.45

Tested by

no test coverage detected