Пример #1
0
    def newFromDict(data):
        if data is None:
            data = {}

        if not isinstance(data, dict):
            raise PyK8SError('Type dict required')
        else:
            return Services(
                apiVersion=data.get('apiVersion', None),
                resourceVersion=data.get('resourceVersion', None),
                items = [Service.newFromDict(item) for item in (data.get('items',{}) if (data.get('items',{}) is not None) else {})],
                creationTimestamp=data.get('creationTimestamp', None),
                selfLink=data.get('selfLink', None),
                kind=data.get('kind', None),
            )
Пример #2
0
 def addServiceFromFile(self,filename):
     ob=Service.newFromJsonFile(filename)
     return self.postService(ob.toDict())
Пример #3
0
 def addServiceFromFile(self, filename):
     ob = Service.newFromJsonFile(filename)
     return self.postService(ob.toDict())
Пример #4
0
 def getService(self,name):
     response = self.get('services/'+name)
     return Service.newFromDict(response)
Пример #5
0
 def getService(self, name):
     response = self.get('services/' + name)
     return Service.newFromDict(response)