I am trying to get yaml for the particular storage class using Kubernetes python client, following code does the job:
list_storage_class = v1.list_storage_class(_preload_content=False)
storageclass = list_storage_class.read().decode('utf-8') # <class 'urllib3.response.HTTPResponse'>
print(json.dumps(json.loads(storageclass),indent=2))
Is it a way to specify storage class with the call? On the same hand is it possible to get response directly in yaml conforming to k get sc NAME -o yaml
?