示例#1
0
    def newFromDict(data):
        if data is None:
            data = {}

        if not isinstance(data, dict):
            raise PyK8SError('Type dict required')
        else:
            return ReplicationControllers(
                items = [ReplicationController.newFromDict(item) for item in (data.get('items',{}) if (data.get('items',{}) is not None) else {})],
                apiVersion=data.get('apiVersion', None),
                kind=data.get('kind', None),
                selfLink=data.get('selfLink', None),
                creationTimestamp=data.get('creationTimestamp', None),
                resourceVersion=data.get('resourceVersion', None),
            )
示例#2
0
 def addReplicationControllerFromFile(self, filename):
     ob = ReplicationController.newFromJsonFile(filename)
     return self.postReplicationController(ob.toDict())
示例#3
0
文件: endpoints.py 项目: chixq/pyk8s
 def addReplicationControllerFromFile(self,filename):
     ob=ReplicationController.newFromJsonFile(filename)
     return self.postReplicationController(ob.toDict())
示例#4
0
 def getReplicationController(self, name):
     response = self.get('replicationControllers/' + name)
     return ReplicationController.newFromDict(response)
示例#5
0
文件: endpoints.py 项目: chixq/pyk8s
 def getReplicationController(self,name):
     response = self.get('replicationControllers/'+name)
     return ReplicationController.newFromDict(response)