grpc_status.html 6.8 KB

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