_network.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:txkube 作者: LeastAuthority 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号