MCPcopy Index your code
hub / github.com/kubernetes-client/python / serialize_body

Method serialize_body

kubernetes/base/dynamic/client.py:95–103  ·  view source on GitHub ↗

Serialize body to raw dict so apiserver can handle it :param body: kubernetes resource body, current support: Union[Dict, ResourceInstance]

(self, body)

Source from the content-addressed store, hash-verified

93 return namespace
94
95 def serialize_body(self, body):
96 """Serialize body to raw dict so apiserver can handle it
97
98 :param body: kubernetes resource body, current support: Union[Dict, ResourceInstance]
99 """
100 # This should match any `ResourceInstance` instances
101 if callable(getattr(body, 'to_dict', None)):
102 return body.to_dict()
103 return body or {}
104
105 def get(self, resource, name=None, namespace=None, **kwargs):
106 path = resource.path(name=name, namespace=namespace)

Callers 8

createMethod · 0.95
replaceMethod · 0.95
patchMethod · 0.95
server_side_applyMethod · 0.95
createMethod · 0.80
test_dict_typeMethod · 0.80
test_resource_fieldMethod · 0.80

Calls 1

to_dictMethod · 0.45

Tested by 3

test_dict_typeMethod · 0.64
test_resource_fieldMethod · 0.64