Adding support for Quotas to the Cisco plugin

Registered by Sumit Naiksatam

The API quotas support as implemented in https://blueprints.launchpad.net/quantum/+spec/quantum-api-quotas for the Cisco plugin.

Blueprint information

Status:
Complete
Approver:
Kyle Mestery
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
Kyle Mestery
Definition:
Superseded
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Armando Migliaccio

Related branches

Sprints

Whiteboard

Yong sheng gong:
If the resource is countable by the default count function:
def _count_resource(context, plugin, resources, tenant_id):
    obj_getter = getattr(plugin, "get_%s" % resources)
    obj_list = obj_getter(context, filters={'tenant_id': [tenant_id]})
    return len(obj_list) if obj_list else 0
we can enforce the quota by one of:
1.defining it in quantum.conf:
[QUOTAS]
# resource name(s) that are supported in quota features
# quota_items = network,subnet,port,newresource

# default number of resource allowed per tenant, minus for unlimited
# quota_newresource = 10
2. register it just like the way l3 extension does:
quota.QUOTAS.register_resource_by_name(resource_name)

End of yong sheng gong comment

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.