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

Method _from_json_impl

src/python-common/ceph/deployment/service_spec.py:1174–1188  ·  view source on GitHub ↗
(cls: Type[ServiceSpecT], json_spec: dict)

Source from the content-addressed store, hash-verified

1172
1173 @classmethod
1174 def _from_json_impl(cls: Type[ServiceSpecT], json_spec: dict) -> ServiceSpecT:
1175 args = {} # type: Dict[str, Any]
1176 for k, v in json_spec.items():
1177 if k == 'placement':
1178 v = PlacementSpec.from_json(v)
1179 if k == 'custom_configs':
1180 v = [CustomConfig.from_json(c) for c in v]
1181 if k == 'spec':
1182 args.update(v)
1183 continue
1184 args.update({k: v})
1185 _cls = cls(**args)
1186 if _service_spec_from_json_validate:
1187 _cls.validate()
1188 return _cls
1189
1190 def service_name(self) -> str:
1191 n = self.service_type

Callers 3

from_jsonMethod · 0.45
_from_json_implMethod · 0.45
get_dg_specMethod · 0.45

Calls 4

itemsMethod · 0.45
from_jsonMethod · 0.45
updateMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected