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

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

        if not isinstance(data, dict):
            raise PyK8SError('Type dict required')
        else:
            return ResourceQuotas(
                items=[
                    ResourceQuota.newFromDict(item)
                    for item in (data.get('items', {}) if (
                        data.get('items', {}) is not None) else {})
                ],
                kind=data.get('kind', None),
                selfLink=data.get('selfLink', None),
                creationTimestamp=data.get('creationTimestamp', None),
                apiVersion=data.get('apiVersion', None),
                resourceVersion=data.get('resourceVersion', None),
            )
Exemple #3
0
 def addResourceQuotaFromFile(self, filename):
     ob = ResourceQuota.newFromJsonFile(filename)
     return self.postResourceQuota(ob.toDict())
Exemple #4
0
 def getResourceQuota(self, name):
     response = self.get('resourceQuotas/' + name)
     return ResourceQuota.newFromDict(response)
Exemple #5
0
 def addResourceQuotaFromFile(self,filename):
     ob=ResourceQuota.newFromJsonFile(filename)
     return self.postResourceQuota(ob.toDict())
Exemple #6
0
 def getResourceQuota(self,name):
     response = self.get('resourceQuotas/'+name)
     return ResourceQuota.newFromDict(response)