def get(self, obj):
"""
Issue a I{GET} to retrieve the given object.
The object must have identifying metadata such as a namespace and a
name but other fields are ignored.
"""
action = start_action(
action_type=u"network-client:get",
kind=obj.kind,
name=obj.metadata.name,
namespace=getattr(obj.metadata, "namespace", None),
)
with action.context():
url = self.kubernetes.base_url.child(*object_location(obj))
d = DeferredContext(self._get(url))
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()
评论列表
文章目录