MCPcopy Index your code
hub / github.com/couchbase/couchbase-python-client / as_json

Method as_json

couchbase/result.py:236–249  ·  view source on GitHub ↗

Returns a JSON formatted diagnostics report. Returns: str: JSON formatted diagnostics report.

(self)

Source from the content-addressed store, hash-verified

234 return ClusterState.Offline
235
236 def as_json(self) -> str:
237 """Returns a JSON formatted diagnostics report.
238
239 Returns:
240 str: JSON formatted diagnostics report.
241 """
242 return_val = {
243 'version': self.version,
244 'id': self.id,
245 'sdk': self.sdk,
246 'services': {k.value: list(map(lambda epr: epr.as_dict(), v)) for k, v in self.endpoints.items()}
247 }
248
249 return json.dumps(return_val)
250
251 def __repr__(self):
252 return "DiagnosticsResult:{}".format(self._orig)

Callers

nothing calls this directly

Calls 2

as_dictMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected