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

Method replace

kubernetes/base/dynamic/client.py:124–132  ·  view source on GitHub ↗
(self, resource, body=None, name=None, namespace=None, **kwargs)

Source from the content-addressed store, hash-verified

122 return self.request('delete', path, body=body, label_selector=label_selector, field_selector=field_selector, **kwargs)
123
124 def replace(self, resource, body=None, name=None, namespace=None, **kwargs):
125 body = self.serialize_body(body)
126 name = name or body.get('metadata', {}).get('name')
127 if not name:
128 raise ValueError("name is required to replace {}.{}".format(resource.group_version, resource.kind))
129 if resource.namespaced:
130 namespace = self.ensure_namespace(resource, namespace, body)
131 path = resource.path(name=name, namespace=namespace)
132 return self.request('put', path, body=body, **kwargs)
133
134 def patch(self, resource, body=None, name=None, namespace=None, **kwargs):
135 body = self.serialize_body(body)

Callers 14

__call_apiMethod · 0.45
create_from_dictFunction · 0.45
parse_rfc3339Function · 0.45
format_rfc3339Function · 0.45
__call_apiMethod · 0.45
create_from_dictFunction · 0.45
parse_rfc3339Function · 0.45

Calls 6

serialize_bodyMethod · 0.95
ensure_namespaceMethod · 0.95
requestMethod · 0.95
getMethod · 0.45
formatMethod · 0.45
pathMethod · 0.45