コード例 #1
0
ファイル: models.py プロジェクト: jaeko44/nodeconductor
 class Quotas(quotas_models.QuotaModelMixin.Quotas):
     enable_fields_caching = False
     nc_resource_count = quotas_fields.CounterQuotaField(
         target_models=lambda: ResourceMixin.get_all_models(),
         path_to_scope='project',
     )
     nc_app_count = quotas_fields.CounterQuotaField(
         target_models=lambda: ApplicationMixin.get_all_models(),
         path_to_scope='project',
     )
     nc_vm_count = quotas_fields.CounterQuotaField(
         target_models=lambda: VirtualMachine.get_all_models(),
         path_to_scope='project',
     )
     nc_private_cloud_count = quotas_fields.CounterQuotaField(
         target_models=lambda: PrivateCloud.get_all_models(),
         path_to_scope='project',
     )
     nc_storage_count = quotas_fields.CounterQuotaField(
         target_models=lambda: Storage.get_all_models(),
         path_to_scope='project',
     )
     nc_volume_count = quotas_fields.CounterQuotaField(
         target_models=lambda: Volume.get_all_models(),
         path_to_scope='project',
     )
     nc_snapshot_count = quotas_fields.CounterQuotaField(
         target_models=lambda: Snapshot.get_all_models(),
         path_to_scope='project',
     )
     nc_service_project_link_count = quotas_fields.CounterQuotaField(
         target_models=lambda: ServiceProjectLink.get_all_models(),
         path_to_scope='project',
     )
コード例 #2
0
 class Quotas(quotas_models.QuotaModelMixin.Quotas):
     nc_resource_count = quotas_fields.CounterQuotaField(
         target_models=lambda: Resource.get_all_models(),
         path_to_scope='project',
     )
     nc_app_count = quotas_fields.CounterQuotaField(
         target_models=lambda: Resource.get_app_models(),
         path_to_scope='project',
     )
     nc_vm_count = quotas_fields.CounterQuotaField(
         target_models=lambda: Resource.get_vm_models(),
         path_to_scope='project',
     )
     nc_service_project_link_count = quotas_fields.CounterQuotaField(
         target_models=lambda: ServiceProjectLink.get_all_models(),
         path_to_scope='project',
     )
コード例 #3
0
 class Quotas(quotas_models.QuotaModelMixin.Quotas):
     counter_quota = fields.CounterQuotaField(
         target_models=lambda: [ChildModel],
         path_to_scope='parent',
     )
     two_targets_counter_quota = fields.CounterQuotaField(
         target_models=lambda: [ChildModel, SecondChildModel],
         path_to_scope='parent',
     )
     usage_aggregator_quota = fields.UsageAggregatorQuotaField(
         get_children=lambda scope: scope.children.all(), )
     limit_aggregator_quota = fields.LimitAggregatorQuotaField(
         get_children=lambda scope: scope.children.all(),
         default_limit=0,
     )
     second_usage_aggregator_quota = fields.UsageAggregatorQuotaField(
         get_children=lambda scope: scope.children.all(),
         child_quota_name='usage_aggregator_quota',
     )
コード例 #4
0
 class Quotas(quotas_models.QuotaModelMixin.Quotas):
     nc_project_count = quotas_fields.CounterQuotaField(
         target_models=lambda: [Project],
         path_to_scope='customer',
     )
     nc_service_count = quotas_fields.CounterQuotaField(
         target_models=lambda: Service.get_all_models(),
         path_to_scope='customer',
     )
     nc_user_count = quotas_fields.QuotaField()
     nc_resource_count = quotas_fields.AggregatorQuotaField(
         get_children=lambda customer: customer.projects.all(),
     )
     nc_app_count = quotas_fields.AggregatorQuotaField(
         get_children=lambda customer: customer.projects.all(),
     )
     nc_vm_count = quotas_fields.AggregatorQuotaField(
         get_children=lambda customer: customer.projects.all(),
     )
     nc_service_project_link_count = quotas_fields.AggregatorQuotaField(
         get_children=lambda customer: customer.projects.all(),
     )