blob: ac01bda77feee510e2826ecdd080a05d3b446978 [file] [log] [blame] [edit]
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>gRPC Status &#8212; gRPC Python 1.71.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=5ecbeea2" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=84b2ca11" />
<script src="_static/documentation_options.js?v=026573dc"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="gRPC Testing" href="grpc_testing.html" />
<link rel="prev" title="gRPC Reflection" href="grpc_reflection.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">gRPC Python</a></h1>
<p class="blurb">1.71.0</p>
<h3>Navigation</h3>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="grpc.html">gRPC</a></li>
<li class="toctree-l1"><a class="reference internal" href="grpc_asyncio.html">gRPC AsyncIO API</a></li>
<li class="toctree-l1"><a class="reference internal" href="grpc_admin.html">gRPC Admin</a></li>
<li class="toctree-l1"><a class="reference internal" href="grpc_channelz.html">gRPC Channelz</a></li>
<li class="toctree-l1"><a class="reference internal" href="grpc_csds.html">gRPC CSDS</a></li>
<li class="toctree-l1"><a class="reference internal" href="grpc_health_checking.html">gRPC Health Checking</a></li>
<li class="toctree-l1"><a class="reference internal" href="grpc_reflection.html">gRPC Reflection</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">gRPC Status</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#module-grpc_status.rpc_status">Module Contents</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#grpc_status.rpc_status.from_call"><code class="docutils literal notranslate"><span class="pre">from_call()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#grpc_status.rpc_status.to_status"><code class="docutils literal notranslate"><span class="pre">to_status()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="grpc_testing.html">gRPC Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="grpc_observability.html">gRPC Python Observability</a></li>
<li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="grpc_reflection.html" title="previous chapter">gRPC Reflection</a></li>
<li>Next: <a href="grpc_testing.html" title="next chapter">gRPC Testing</a></li>
</ul></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="grpc-status">
<h1>gRPC Status<a class="headerlink" href="#grpc-status" title="Link to this heading"></a></h1>
<section id="module-grpc_status.rpc_status">
<span id="module-contents"></span><h2>Module Contents<a class="headerlink" href="#module-grpc_status.rpc_status" title="Link to this heading"></a></h2>
<p>Reference implementation for status mapping in gRPC Python.</p>
<dl class="py function">
<dt class="sig sig-object py" id="grpc_status.rpc_status.from_call">
<span class="sig-prename descclassname"><span class="pre">grpc_status.rpc_status.</span></span><span class="sig-name descname"><span class="pre">from_call</span></span><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="Link to this definition"></a></dt>
<dd><p>Returns a google.rpc.status.Status message corresponding to a given grpc.Call.</p>
<p>This is an EXPERIMENTAL API.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>call</strong> – A grpc.Call instance.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A google.rpc.status.Status message representing the status of the RPC.</p>
</dd>
<dt class="field-odd">Raises<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>ValueError</strong> – If the gRPC call’s code or details are inconsistent with the
status code and message inside of the google.rpc.status.Status.</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="grpc_status.rpc_status.to_status">
<span class="sig-prename descclassname"><span class="pre">grpc_status.rpc_status.</span></span><span class="sig-name descname"><span class="pre">to_status</span></span><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="Link to this definition"></a></dt>
<dd><p>Convert a google.rpc.status.Status message to grpc.Status.</p>
<p>This is an EXPERIMENTAL API.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>status</strong> – a google.rpc.status.Status message representing the non-OK status
to terminate the RPC with and communicate it to the client.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A grpc.Status instance representing the input google.rpc.status.Status message.</p>
</dd>
</dl>
</dd></dl>
</section>
</section>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&#169;2020, The gRPC Authors.
|
<a href="_sources/grpc_status.rst.txt"
rel="nofollow">Page source</a>
</div>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-60127042-1']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>