class Quotas(quotas_models.QuotaModelMixin.Quotas): regular_quota = fields.QuotaField() usage_aggregator_quota = fields.QuotaField( ) # this quota is aggregated by parent and grandparent limit_aggregator_quota = fields.QuotaField( default_limit=0 ) # this quota is aggregated by parent and grandparent
class Quotas(quotas_models.QuotaModelMixin.Quotas): regular_quota = fields.QuotaField() quota_with_default_limit = fields.QuotaField(default_limit=100) usage_aggregator_quota = fields.UsageAggregatorQuotaField( get_children=lambda scope: ChildModel.objects.filter(parent__parent =scope), ) limit_aggregator_quota = fields.LimitAggregatorQuotaField( get_children=lambda scope: ChildModel.objects.filter(parent__parent =scope), )
class Quotas(quotas_models.QuotaModelMixin.Quotas): enable_fields_caching = False 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_service_project_link_count = quotas_fields.CounterQuotaField( target_models=lambda: ServiceProjectLink.get_all_models(), path_to_scope='project.customer', ) nc_user_count = quotas_fields.QuotaField() nc_resource_count = quotas_fields.CounterQuotaField( target_models=lambda: ResourceMixin.get_all_models(), path_to_scope='project.customer', ) nc_app_count = quotas_fields.CounterQuotaField( target_models=lambda: ApplicationMixin.get_all_models(), path_to_scope='project.customer', ) nc_vm_count = quotas_fields.CounterQuotaField( target_models=lambda: VirtualMachine.get_all_models(), path_to_scope='project.customer', ) nc_private_cloud_count = quotas_fields.CounterQuotaField( target_models=lambda: PrivateCloud.get_all_models(), path_to_scope='project.customer', ) nc_storage_count = quotas_fields.CounterQuotaField( target_models=lambda: Storage.get_all_models(), path_to_scope='project.customer', )
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(), )
class Quotas(quotas_models.QuotaModelMixin.Quotas): vcpu = quotas_fields.QuotaField() ram = quotas_fields.QuotaField() storage = quotas_fields.QuotaField()