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

Method as_json

couchbase/result.py:300–313  ·  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

298 return self._endpoints
299
300 def as_json(self) -> str:
301 """Returns a JSON formatted diagnostics report.
302
303 Returns:
304 str: JSON formatted diagnostics report.
305 """
306 return_val = {
307 'version': self.version,
308 'id': self.id,
309 'sdk': self.sdk,
310 'services': {k.value: list(map(lambda epr: epr.as_dict(), v)) for k, v in self.endpoints.items()}
311 }
312
313 return json.dumps(return_val)
314
315 def __repr__(self):
316 return "PingResult:{}".format(self._orig)

Callers 9

test_ping_as_jsonMethod · 0.45
test_ping_as_jsonMethod · 0.45
test_ping_as_jsonMethod · 0.45
test_ping_as_jsonMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 2

as_dictMethod · 0.45
itemsMethod · 0.45

Tested by 6

test_ping_as_jsonMethod · 0.36
test_ping_as_jsonMethod · 0.36
test_ping_as_jsonMethod · 0.36
test_ping_as_jsonMethod · 0.36