<p>I'm currently using the Python APIs for Kubernetes and I have to:</p>
<ul>
<li><p>Retrieve the instance of a custom resource name <code>FADepl</code>.</p>
</li>
<li><p>Edit the value of that instance.</p>
</li>
</ul>
<p>In the terminal, I would simply list all <code>FADepls</code> with <code>kubectl get fadepl</code> and then edit the right one using <code>kubectl edit fadepl &lt;fadepl_name&gt;</code>. I checked the <a href="https://github.com/kubernetes-client/python/blob/master/kubernetes/README.md" rel="nofollow noreferrer">K8s APIs for Python</a> but I can't find what I need. Is it something I can do with the APIs?</p>
<p>Thank you in advance!</p>

texdade
<p>You're right. Using <a href="https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/CustomObjectsApi.md#get_namespaced_custom_object" rel="nofollow noreferrer"><strong><code>get_namespaced_custom_object</code></strong></a> you can retrieve the instance. This method returns a namespace scoped custom object. By default it uses a synchronous HTTP request.</p>
<p>Since the output of that method returns an object, you can simply replace it using <a href="https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/CustomObjectsApi.md#replace_cluster_custom_object" rel="nofollow noreferrer"><strong><code>replace_cluster_custom_object</code></strong></a>.</p>
<p><a href="https://www.programcreek.com/python/?CodeExample=replace+namespaced+custom+object" rel="nofollow noreferrer">Here</a> you can find implementation examples.</p>
<p>See also whole list of <a href="https://aiokubernetes.readthedocs.io/en/latest/api_reference.html" rel="nofollow noreferrer">API Reference for Python</a>.</p>
