grpc_status.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>gRPC Status &#8212; gRPC Python 1.36.1 documentation</title>
  7. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
  9. <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
  10. <script src="_static/jquery.js"></script>
  11. <script src="_static/underscore.js"></script>
  12. <script src="_static/doctools.js"></script>
  13. <link rel="index" title="Index" href="genindex.html" />
  14. <link rel="search" title="Search" href="search.html" />
  15. <link rel="next" title="gRPC Testing" href="grpc_testing.html" />
  16. <link rel="prev" title="gRPC Reflection" href="grpc_reflection.html" />
  17. <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  18. <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
  19. </head><body>
  20. <div class="document">
  21. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  22. <div class="sphinxsidebarwrapper">
  23. <h1 class="logo"><a href="index.html">gRPC Python</a></h1>
  24. <p class="blurb">1.36.1</p>
  25. <h3>Navigation</h3>
  26. <p class="caption"><span class="caption-text">Contents:</span></p>
  27. <ul class="current">
  28. <li class="toctree-l1"><a class="reference internal" href="grpc.html">gRPC</a></li>
  29. <li class="toctree-l1"><a class="reference internal" href="grpc_asyncio.html">gRPC AsyncIO API</a></li>
  30. <li class="toctree-l1"><a class="reference internal" href="grpc_channelz.html">gRPC Channelz</a></li>
  31. <li class="toctree-l1"><a class="reference internal" href="grpc_health_checking.html">gRPC Health Checking</a></li>
  32. <li class="toctree-l1"><a class="reference internal" href="grpc_reflection.html">gRPC Reflection</a></li>
  33. <li class="toctree-l1 current"><a class="current reference internal" href="#">gRPC Status</a><ul>
  34. <li class="toctree-l2"><a class="reference internal" href="#module-grpc_status.rpc_status">Module Contents</a></li>
  35. </ul>
  36. </li>
  37. <li class="toctree-l1"><a class="reference internal" href="grpc_testing.html">gRPC Testing</a></li>
  38. <li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary</a></li>
  39. </ul>
  40. <div class="relations">
  41. <h3>Related Topics</h3>
  42. <ul>
  43. <li><a href="index.html">Documentation overview</a><ul>
  44. <li>Previous: <a href="grpc_reflection.html" title="previous chapter">gRPC Reflection</a></li>
  45. <li>Next: <a href="grpc_testing.html" title="next chapter">gRPC Testing</a></li>
  46. </ul></li>
  47. </ul>
  48. </div>
  49. <div id="searchbox" style="display: none" role="search">
  50. <h3 id="searchlabel">Quick search</h3>
  51. <div class="searchformwrapper">
  52. <form class="search" action="search.html" method="get">
  53. <input type="text" name="q" aria-labelledby="searchlabel" />
  54. <input type="submit" value="Go" />
  55. </form>
  56. </div>
  57. </div>
  58. <script>$('#searchbox').show(0);</script>
  59. </div>
  60. </div>
  61. <div class="documentwrapper">
  62. <div class="bodywrapper">
  63. <div class="body" role="main">
  64. <div class="section" id="grpc-status">
  65. <h1>gRPC Status<a class="headerlink" href="#grpc-status" title="Permalink to this headline">¶</a></h1>
  66. <div class="section" id="module-grpc_status.rpc_status">
  67. <span id="module-contents"></span><h2>Module Contents<a class="headerlink" href="#module-grpc_status.rpc_status" title="Permalink to this headline">¶</a></h2>
  68. <p>Reference implementation for status mapping in gRPC Python.</p>
  69. <dl class="py function">
  70. <dt id="grpc_status.rpc_status.from_call">
  71. <code class="sig-prename descclassname"><span class="pre">grpc_status.rpc_status.</span></code><code class="sig-name descname"><span class="pre">from_call</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">call</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc_status/rpc_status.html#from_call"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc_status.rpc_status.from_call" title="Permalink to this definition">¶</a></dt>
  72. <dd><p>Returns a google.rpc.status.Status message corresponding to a given grpc.Call.</p>
  73. <p>This is an EXPERIMENTAL API.</p>
  74. <dl class="field-list simple">
  75. <dt class="field-odd">Parameters</dt>
  76. <dd class="field-odd"><p><strong>call</strong> – A grpc.Call instance.</p>
  77. </dd>
  78. <dt class="field-even">Returns</dt>
  79. <dd class="field-even"><p>A google.rpc.status.Status message representing the status of the RPC.</p>
  80. </dd>
  81. <dt class="field-odd">Raises</dt>
  82. <dd class="field-odd"><p><strong>ValueError</strong> – If the gRPC call’s code or details are inconsistent with the
  83. status code and message inside of the google.rpc.status.Status.</p>
  84. </dd>
  85. </dl>
  86. </dd></dl>
  87. <dl class="py function">
  88. <dt id="grpc_status.rpc_status.to_status">
  89. <code class="sig-prename descclassname"><span class="pre">grpc_status.rpc_status.</span></code><code class="sig-name descname"><span class="pre">to_status</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">status</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/grpc_status/rpc_status.html#to_status"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#grpc_status.rpc_status.to_status" title="Permalink to this definition">¶</a></dt>
  90. <dd><p>Convert a google.rpc.status.Status message to grpc.Status.</p>
  91. <p>This is an EXPERIMENTAL API.</p>
  92. <dl class="field-list simple">
  93. <dt class="field-odd">Parameters</dt>
  94. <dd class="field-odd"><p><strong>status</strong> – a google.rpc.status.Status message representing the non-OK status
  95. to terminate the RPC with and communicate it to the client.</p>
  96. </dd>
  97. <dt class="field-even">Returns</dt>
  98. <dd class="field-even"><p>A grpc.Status instance representing the input google.rpc.status.Status message.</p>
  99. </dd>
  100. </dl>
  101. </dd></dl>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="clearer"></div>
  108. </div>
  109. <div class="footer">
  110. &copy;2020, The gRPC Authors.
  111. |
  112. <a href="_sources/grpc_status.rst.txt"
  113. rel="nofollow">Page source</a>
  114. </div>
  115. <script type="text/javascript">
  116. var _gaq = _gaq || [];
  117. _gaq.push(['_setAccount', 'UA-60127042-1']);
  118. _gaq.push(['_setDomainName', 'none']);
  119. _gaq.push(['_setAllowLinker', true]);
  120. _gaq.push(['_trackPageview']);
  121. (function() {
  122. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  123. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  124. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  125. })();
  126. </script>
  127. </body>
  128. </html>