Exemplo n.º 1
0
 def get_usages(self, with_volume=True):
     quotas = {
         'injected_file_content_bytes': {
             'quota': 1
         },
         'metadata_items': {
             'quota': 1
         },
         'injected_files': {
             'quota': 1
         },
         'security_groups': {
             'quota': 10
         },
         'security_group_rules': {
             'quota': 20
         },
         'fixed_ips': {
             'quota': 10
         },
         'ram': {
             'available': 8976,
             'used': 1024,
             'quota': 10000
         },
         'floating_ips': {
             'available': 0,
             'used': 2,
             'quota': 1
         },
         'instances': {
             'available': 8,
             'used': 2,
             'quota': 10
         },
         'cores': {
             'available': 8,
             'used': 2,
             'quota': 10
         }
     }
     if with_volume:
         quotas.update({
             'volumes': {
                 'available': 0,
                 'used': 3,
                 'quota': 1
             },
             'snapshots': {
                 'available': 0,
                 'used': 3,
                 'quota': 1
             },
             'gigabytes': {
                 'available': 920,
                 'used': 80,
                 'quota': 1000
             }
         })
     return quotas
Exemplo n.º 2
0
 def get_usages(self, with_volume=True):
     quotas = {'injected_file_content_bytes': {'quota': 1},
               'metadata_items': {'quota': 1},
               'injected_files': {'quota': 1},
               'security_groups': {'quota': 10},
               'security_group_rules': {'quota': 20},
               'fixed_ips': {'quota': 10},
               'ram': {'available': 8976, 'used': 1024, 'quota': 10000},
               'floating_ips': {'available': 0, 'used': 2, 'quota': 1},
               'instances': {'available': 8, 'used': 2, 'quota': 10},
               'cores': {'available': 8, 'used': 2, 'quota': 10}}
     if with_volume:
         quotas.update({'volumes': {'available': 0, 'used': 3, 'quota': 1},
                        'gigabytes': {'available': 920, 'used': 80,
                                      'quota': 1000}})
     return quotas