# License for the specific language governing permissions and limitations
# under the License.
-"""Quotas for instances, volumes, and floating ips."""
+"""Quotas for volumes."""
import datetime
"""
Initializes a Resource.
- :param name: The name of the resource, i.e., "instances".
+ :param name: The name of the resource, i.e., "volumes".
:param flag: The name of the flag or configuration option
which specifies the default value of the quota
for this resource.
Initializes a ReservableResource.
Reservable resources are those resources which directly
- correspond to objects in the database, i.e., instances, cores,
+ correspond to objects in the database, i.e., volumes, gigabytes,
etc. A ReservableResource must be constructed with a usage
synchronization function, which will be called to determine the
current counts of one or more resources.
synchronization functions may be associated with more than one
ReservableResource.
- :param name: The name of the resource, i.e., "instances".
+ :param name: The name of the resource, i.e., "volumes".
:param sync: A callable which returns a dictionary to
resynchronize the in_use count for one or more
resources, as described above.
Initializes a CountableResource.
Countable resources are those resources which directly
- correspond to objects in the database, i.e., instances, cores,
+ correspond to objects in the database, i.e., volumes, gigabytes,
etc., but for which a count by project ID is inappropriate. A
CountableResource must be constructed with a counting
function, which will be called to determine the current counts
required functionality, until a better approach to solving
this problem can be evolved.
- :param name: The name of the resource, i.e., "instances".
+ :param name: The name of the resource, i.e., "volumes".
:param count: A callable which returns the count of the
resource. The arguments passed are as described
above.
return sorted(self._resources.keys())
-def _sync_instances(context, project_id, session):
- return dict(zip(('instances', 'cores', 'ram'),
- db.instance_data_get_for_project(context,
- project_id,
- session=session)))
-
-
def _sync_volumes(context, project_id, session):
return dict(zip(('volumes', 'gigabytes'),
db.volume_data_get_for_project(context,