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

Method from_json

src/python-common/ceph/deployment/service_spec.py:447–456  ·  view source on GitHub ↗
(cls, data: dict)

Source from the content-addressed store, hash-verified

445 @classmethod
446 @handle_type_error
447 def from_json(cls, data: dict) -> 'PlacementSpec':
448 c = data.copy()
449 hosts = c.get('hosts', [])
450 if hosts:
451 c['hosts'] = []
452 for host in hosts:
453 c['hosts'].append(HostPlacementSpec.from_json(host))
454 _cls = cls(**c)
455 _cls.validate()
456 return _cls
457
458 def to_json(self) -> dict:
459 r: Dict[str, Any] = {}

Callers

nothing calls this directly

Calls 5

copyMethod · 0.45
getMethod · 0.45
appendMethod · 0.45
from_jsonMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected