grpc_status.html 7.4 KB

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