def newFromDict(data): if data is None: data = {} if not isinstance(data, dict): raise PyK8SError('Type dict required') else: return Nodes( resourceVersion=data.get('resourceVersion', None), creationTimestamp=data.get('creationTimestamp', None), items = [Node.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), )
def newFromDict(data): if data is None: data = {} if not isinstance(data, dict): raise PyK8SError('Type dict required') else: return Nodes( resourceVersion=data.get('resourceVersion', None), creationTimestamp=data.get('creationTimestamp', None), items=[ Node.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), )
def addNodeFromFile(self,filename): ob=Node.newFromJsonFile(filename) return self.postNode(ob.toDict())
def getNode(self,name): response = self.get('nodes/'+name) return Node.newFromDict(response)
def addNodeFromFile(self, filename): ob = Node.newFromJsonFile(filename) return self.postNode(ob.toDict())
def getNode(self, name): response = self.get('nodes/' + name) return Node.newFromDict(response)