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

        if not isinstance(data, dict):
            raise PyK8SError('Type dict required')
        else:
            return LimitRanges(
                items = [LimitRange.newFromDict(item) for item in (data.get('items',{}) if (data.get('items',{}) is not None) else {})],
                selfLink=data.get('selfLink', None),
                resourceVersion=data.get('resourceVersion', None),
                creationTimestamp=data.get('creationTimestamp', None),
                kind=data.get('kind', None),
                apiVersion=data.get('apiVersion', None),
            )
示例#2
0
    def newFromDict(data):
        if data is None:
            data = {}

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