<spanid="vmware-vapi-vmc-package"></span><h1>vmware.vapi.vmc package<aclass="headerlink"href="#module-vmware.vapi.vmc"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="submodules">
<h2>Submodules<aclass="headerlink"href="#submodules"title="Permalink to this headline">¶</a></h2>
<spanid="vmware-vapi-vmc-client-module"></span><h2>vmware.vapi.vmc.client module<aclass="headerlink"href="#module-vmware.vapi.vmc.client"title="Permalink to this headline">¶</a></h2>
<p>CSP Refresh token based SecurityContextFilter</p>
<dlclass="class">
<dtid="vmware.vapi.vmc.client.VmcClient">
<emclass="property">class </em><codeclass="descclassname">vmware.vapi.vmc.client.</code><codeclass="descname">VmcClient</code><spanclass="sig-paren">(</span><em>session</em>, <em>refresh_token</em>, <em>vmc_url</em>, <em>csp_url</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#vmware.vapi.vmc.client.VmcClient"title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">vmware.vapi.vmc.client.</code><codeclass="descname">create_vmc_client</code><spanclass="sig-paren">(</span><em>refresh_token</em>, <em>session=None</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#vmware.vapi.vmc.client.create_vmc_client"title="Permalink to this definition">¶</a></dt>
<dd><p>Helper method to create an instance of the VMC API client using the public
<li><p><strong>session</strong> (<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">requests.Session</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>) – Requests HTTP session instance. If not specified, then one
<spanid="vmware-vapi-vmc-csp-filter-module"></span><h2>vmware.vapi.vmc.csp_filter module<aclass="headerlink"href="#module-vmware.vapi.vmc.csp_filter"title="Permalink to this headline">¶</a></h2>
<p>CSP Refresh token based SecurityContextFilter</p>
<emclass="property">class </em><codeclass="descclassname">vmware.vapi.vmc.csp_filter.</code><codeclass="descname">CSPSecurityContextFilter</code><spanclass="sig-paren">(</span><em>session</em>, <em>refresh_token</em>, <em>refresh_url</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#vmware.vapi.vmc.csp_filter.CSPSecurityContextFilter"title="Permalink to this definition">¶</a></dt>
<li><p><strong>session</strong> (<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">requests.Session</span></code>) – Requests Session object to use for making HTTP calls</p></li>
<li><p><strong>refresh_token</strong> (<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">str</span></code>) – Refresh token to use for obtaining an access token</p></li>
<li><p><strong>refresh_url</strong> (<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">str</span></code>) – URL that allows exchanging a refresh token for an
<codeclass="descname">get_max_retries</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#vmware.vapi.vmc.csp_filter.CSPSecurityContextFilter.get_max_retries"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_security_context</code><spanclass="sig-paren">(</span><em>on_error</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#vmware.vapi.vmc.csp_filter.CSPSecurityContextFilter.get_security_context"title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve security context. If this method is called after an error
occured, then a new access token is obtained using the refresh token and
<ddclass="field-odd"><p><strong>on_error</strong> (<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">bool</span></code>) – Whether this method is called after getting an error</p>
<codeclass="descname">should_retry</code><spanclass="sig-paren">(</span><em>error_value</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#vmware.vapi.vmc.csp_filter.CSPSecurityContextFilter.should_retry"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns whether the request should be retried or not based on the error
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.