def replace(self, obj):
"""
Issue a I{PUT} to replace an existing object with a new one.
"""
action = start_action(
action_type=u"network-client:replace",
)
with action.context():
url = self.kubernetes.base_url.child(*object_location(obj))
document = self.model.iobject_to_raw(obj)
Message.log(submitted_object=document)
d = DeferredContext(self._put(url, document))
d.addCallback(check_status, (OK,), self.model)
d.addCallback(readBody)
d.addCallback(loads)
d.addCallback(log_response_object, action)
d.addCallback(self.model.iobject_from_raw)
return d.addActionFinish()
评论列表
文章目录