def newFromDict(data): if data is None: data = {} if not isinstance(data, dict): raise PyK8SError('Type dict required') else: return Pods( apiVersion=data.get('apiVersion', None), resourceVersion=data.get('resourceVersion', None), kind=data.get('kind', None), items = [Pod.newFromDict(item) for item in (data.get('items',{}) if (data.get('items',{}) is not None) else {})], selfLink=data.get('selfLink', None), creationTimestamp=data.get('creationTimestamp', None), )
def newFromDict(data): if data is None: data = {} if not isinstance(data, dict): raise PyK8SError('Type dict required') else: return Pods( apiVersion=data.get('apiVersion', None), resourceVersion=data.get('resourceVersion', None), kind=data.get('kind', None), items=[ Pod.newFromDict(item) for item in (data.get('items', {}) if ( data.get('items', {}) is not None) else {}) ], selfLink=data.get('selfLink', None), creationTimestamp=data.get('creationTimestamp', None), )
def getPod(self,name): response = self.get('pods/'+name) return Pod.newFromDict(response)
def addPodFromFile(self,filename): ob=Pod.newFromJsonFile(filename) return self.postPod(ob.toDict())
def getPod(self, name): response = self.get('pods/' + name) return Pod.newFromDict(response)
def addPodFromFile(self, filename): ob = Pod.newFromJsonFile(filename) return self.postPod(ob.toDict())